Struct mz_repr::RowRef

source ·
#[repr(transparent)]
pub struct RowRef([u8]);
Expand description

A contiguous slice of bytes that are row data.

A RowRef is to Row as str is to String.

Tuple Fields§

§0: [u8]

Implementations§

source§

impl RowRef

source

pub fn from_slice(row: &[u8]) -> &RowRef

Create a RowRef from a slice of data.

We do not check that the provided slice is valid Row data, will panic on read if the data is invalid.

source

pub fn unpack(&self) -> Vec<Datum<'_>>

Unpack self into a Vec<Datum> for efficient random access.

source

pub fn unpack_first(&self) -> Datum<'_>

Return the first Datum in self

Panics if the RowRef is empty.

source

pub fn iter(&self) -> DatumListIter<'_>

Iterate the Datum elements of the RowRef.

source

pub fn data(&self) -> &[u8]

For debugging only.

source

pub fn is_empty(&self) -> bool

True iff there is no data in this RowRef.

Trait Implementations§

source§

impl AsRef<RowRef> for Row

source§

fn as_ref(&self) -> &RowRef

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<RowRef> for Row

source§

fn borrow(&self) -> &RowRef

Immutably borrows from an owned value. Read more
source§

impl Debug for RowRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Debug representation using the internal datums

source§

impl<'a> IntoIterator for &'a RowRef

§

type Item = Datum<'a>

The type of the elements being iterated over.
§

type IntoIter = DatumListIter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> DatumListIter<'a>

Creates an iterator from a value. Read more
source§

impl Ord for RowRef

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl PartialEq for RowRef

source§

fn eq(&self, other: &RowRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for RowRef

These implementations order first by length, and then by slice contents. This allows many comparisons to complete without dereferencing memory. Warning: These order by the u8 array representation, and NOT by Datum::cmp.

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ToOwned for RowRef

§

type Owned = Row

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for RowRef

source§

impl StructuralPartialEq for RowRef

Auto Trait Implementations§

§

impl Freeze for RowRef

§

impl RefUnwindSafe for RowRef

§

impl Send for RowRef

§

impl !Sized for RowRef

§

impl Sync for RowRef

§

impl Unpin for RowRef

§

impl UnwindSafe for RowRef

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.