pub trait Row:
Sized
+ Debug
+ PartialEq
+ Eq {
Show 16 methods
// Required methods
fn datum_at(&self, index: usize) -> Option<ScalarRefImpl<'_>>;
unsafe fn datum_at_unchecked(
&self,
index: usize,
) -> Option<ScalarRefImpl<'_>>;
fn len(&self) -> usize;
fn iter(&self) -> impl Iterator<Item = Option<ScalarRefImpl<'_>>>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn to_owned_row(&self) -> OwnedRow { ... }
fn into_owned_row(self) -> OwnedRow { ... }
fn value_serialize_into(&self, buf: impl BufMut) { ... }
fn value_serialize(&self) -> Vec<u8> ⓘ { ... }
fn value_serialize_bytes(&self) -> Bytes { ... }
fn value_estimate_size(&self) -> usize { ... }
fn memcmp_serialize_into(&self, serde: &OrderedRowSerde, buf: impl BufMut) { ... }
fn memcmp_serialize(&self, serde: &OrderedRowSerde) -> Vec<u8> ⓘ { ... }
fn hash_datums_into<H>(&self, state: &mut H)
where H: Hasher { ... }
fn hash<H>(&self, hash_builder: H) -> HashCode<H>
where H: BuildHasher { ... }
fn eq(this: &Self, other: impl Row) -> bool { ... }
}
Expand description
The trait for abstracting over a Row-like type.
Required Methods§
sourcefn datum_at(&self, index: usize) -> Option<ScalarRefImpl<'_>>
fn datum_at(&self, index: usize) -> Option<ScalarRefImpl<'_>>
Returns the DatumRef
at the given index
.
sourceunsafe fn datum_at_unchecked(&self, index: usize) -> Option<ScalarRefImpl<'_>>
unsafe fn datum_at_unchecked(&self, index: usize) -> Option<ScalarRefImpl<'_>>
Provided Methods§
sourcefn to_owned_row(&self) -> OwnedRow
fn to_owned_row(&self) -> OwnedRow
Converts the row into an OwnedRow
.
Prefer into_owned_row
if the row is already owned.
sourcefn into_owned_row(self) -> OwnedRow
fn into_owned_row(self) -> OwnedRow
Consumes self
and converts it into an OwnedRow
.
sourcefn value_serialize_into(&self, buf: impl BufMut)
fn value_serialize_into(&self, buf: impl BufMut)
Serializes the row with value encoding, into the given buf
.
sourcefn value_serialize(&self) -> Vec<u8> ⓘ
fn value_serialize(&self) -> Vec<u8> ⓘ
Serializes the row with value encoding and returns the bytes.
sourcefn value_serialize_bytes(&self) -> Bytes
fn value_serialize_bytes(&self) -> Bytes
Serializes the row with value encoding and returns the bytes.
fn value_estimate_size(&self) -> usize
sourcefn memcmp_serialize_into(&self, serde: &OrderedRowSerde, buf: impl BufMut)
fn memcmp_serialize_into(&self, serde: &OrderedRowSerde, buf: impl BufMut)
Serializes the row with memcomparable encoding, into the given buf
. As each datum may have
different order type, a serde
should be provided.
sourcefn memcmp_serialize(&self, serde: &OrderedRowSerde) -> Vec<u8> ⓘ
fn memcmp_serialize(&self, serde: &OrderedRowSerde) -> Vec<u8> ⓘ
Serializes the row with memcomparable encoding and return the bytes. As each datum may have
different order type, a serde
should be provided.
sourcefn hash_datums_into<H>(&self, state: &mut H)where
H: Hasher,
fn hash_datums_into<H>(&self, state: &mut H)where
H: Hasher,
Hash the datums of this row into the given hasher.
Implementors should delegate std::hash::Hash::hash
to this method.
sourcefn hash<H>(&self, hash_builder: H) -> HashCode<H>where
H: BuildHasher,
fn hash<H>(&self, hash_builder: H) -> HashCode<H>where
H: BuildHasher,
Returns the hash code of the row.
Object Safety§
Implementations on Foreign Types§
source§impl<D> Row for &[D]where
D: ToDatumRef,
impl<D> Row for &[D]where
D: ToDatumRef,
source§impl<R1, R2> Row for Either<R1, R2>
impl<R1, R2> Row for Either<R1, R2>
Implements Row
for an either::Either
of two different types of rows.
fn datum_at(&self, index: usize) -> Option<ScalarRefImpl<'_>>
unsafe fn datum_at_unchecked(&self, index: usize) -> Option<ScalarRefImpl<'_>>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn iter(&self) -> impl Iterator<Item = Option<ScalarRefImpl<'_>>>
fn to_owned_row(&self) -> OwnedRow
fn into_owned_row(self) -> OwnedRow
fn value_serialize_into(&self, buf: impl BufMut)
fn value_serialize(&self) -> Vec<u8> ⓘ
fn value_serialize_bytes(&self) -> Bytes
fn memcmp_serialize_into(&self, serde: &OrderedRowSerde, buf: impl BufMut)
fn memcmp_serialize(&self, serde: &OrderedRowSerde) -> Vec<u8> ⓘ
fn hash_datums_into<H>(&self, state: &mut H)where
H: Hasher,
fn hash<H>(&self, hash_builder: H) -> HashCode<H>where
H: BuildHasher,
fn eq(this: &Either<R1, R2>, other: impl Row) -> bool
source§impl<R> Row for Cow<'_, R>
impl<R> Row for Cow<'_, R>
fn datum_at(&self, index: usize) -> Option<ScalarRefImpl<'_>>
unsafe fn datum_at_unchecked(&self, index: usize) -> Option<ScalarRefImpl<'_>>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn iter(&self) -> impl Iterator<Item = Option<ScalarRefImpl<'_>>>
fn to_owned_row(&self) -> OwnedRow
fn value_serialize_into(&self, buf: impl BufMut)
fn value_serialize(&self) -> Vec<u8> ⓘ
fn memcmp_serialize_into(&self, serde: &OrderedRowSerde, buf: impl BufMut)
fn memcmp_serialize(&self, serde: &OrderedRowSerde) -> Vec<u8> ⓘ
fn hash<H>(&self, hash_builder: H) -> HashCode<H>where
H: BuildHasher,
fn hash_datums_into<H>(&self, state: &mut H)where
H: Hasher,
fn eq(this: &Cow<'_, R>, other: impl Row) -> bool
fn into_owned_row(self) -> OwnedRow
source§impl<R> Row for Option<R>where
R: Row,
impl<R> Row for Option<R>where
R: Row,
Implements Row
for an optional row.