pub trait Row:
Sized
+ Debug
+ PartialEq
+ Eq {
Show 16 methods
// Required methods
fn datum_at(&self, index: usize) -> DatumRef<'_>;
unsafe fn datum_at_unchecked(&self, index: usize) -> DatumRef<'_>;
fn len(&self) -> usize;
fn iter(&self) -> impl Iterator<Item = DatumRef<'_>>;
// 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: Hasher>(&self, state: &mut H) { ... }
fn hash<H: BuildHasher>(&self, hash_builder: H) -> HashCode<H> { ... }
fn eq(this: &Self, other: impl Row) -> bool { ... }
}
Expand description
The trait for abstracting over a Row-like type.
Required Methods§
sourceunsafe fn datum_at_unchecked(&self, index: usize) -> DatumRef<'_>
unsafe fn datum_at_unchecked(&self, index: usize) -> DatumRef<'_>
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: Hasher>(&self, state: &mut H)
fn hash_datums_into<H: Hasher>(&self, state: &mut H)
Hash the datums of this row into the given hasher.
Implementors should delegate std::hash::Hash::hash
to this method.
sourcefn hash<H: BuildHasher>(&self, hash_builder: H) -> HashCode<H>
fn hash<H: BuildHasher>(&self, hash_builder: H) -> HashCode<H>
Returns the hash code of the row.
Object Safety§
Implementations on Foreign Types§
source§impl<D: ToDatumRef> Row for &[D]
impl<D: ToDatumRef> Row for &[D]
source§impl<R1: Row, R2: Row> Row for Either<R1, R2>
impl<R1: Row, R2: Row> Row for Either<R1, R2>
Implements Row
for an either::Either
of two different types of rows.
fn datum_at(&self, index: usize) -> DatumRef<'_>
unsafe fn datum_at_unchecked(&self, index: usize) -> DatumRef<'_>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn iter(&self) -> impl Iterator<Item = DatumRef<'_>>
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: Hasher>(&self, state: &mut H)
fn hash<H: BuildHasher>(&self, hash_builder: H) -> HashCode<H>
fn eq(this: &Self, other: impl Row) -> bool
source§impl<R: Row + Clone> Row for Cow<'_, R>
impl<R: Row + Clone> Row for Cow<'_, R>
fn datum_at(&self, index: usize) -> DatumRef<'_>
unsafe fn datum_at_unchecked(&self, index: usize) -> DatumRef<'_>
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn iter(&self) -> impl Iterator<Item = DatumRef<'_>>
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: BuildHasher>(&self, hash_builder: H) -> HashCode<H>
fn hash_datums_into<H: Hasher>(&self, state: &mut H)
fn eq(this: &Self, other: impl Row) -> bool
fn into_owned_row(self) -> OwnedRow
source§impl<R: Row> Row for Option<R>
impl<R: Row> Row for Option<R>
Implements Row
for an optional row.