#[repr(transparent)]pub struct RowRef {
data: [u8],
}
Expand description
A wrapper around a byte slice that guarantees the data are row-formatted.
This type exists to allow row-formatted data to be stored in types that
need not contain a Row
, for example large contiguous [u8]
allocations.
It is not expected that most users will use this type, especially as its
only constructor is unsafe.
Fields§
§data: [u8]
Implementations§
source§impl RowRef
impl RowRef
sourcepub unsafe fn from_bytes_unchecked(data: &[u8]) -> &Self
pub unsafe fn from_bytes_unchecked(data: &[u8]) -> &Self
Construct a RowRef
from a byte slice.
Safety
This method is unsafe because if the byte slice is not a valid row encoding, then unpacking its contents can cause undefined behavior.
sourcepub fn unpack(&self) -> Vec<Datum<'_>>
pub fn unpack(&self) -> Vec<Datum<'_>>
Unpack self
into a Vec<Datum>
for efficient random access.
sourcepub fn unpack_first(&self) -> Datum<'_>
pub fn unpack_first(&self) -> Datum<'_>
Return the first Datum
in self
Panics if the Row
is empty.
sourcepub fn iter(&self) -> DatumListIter<'_> ⓘ
pub fn iter(&self) -> DatumListIter<'_> ⓘ
Iterate the Datum
elements of the Row
.