pub struct RowShape(/* private fields */);Expand description
A shape describing the structure of encoded row data.
Implementations§
Source§impl RowShape
impl RowShape
pub fn set_any(&self, row: &mut EncodedRow, index: usize, value: &Value)
pub fn get_any(&self, row: &EncodedRow, index: usize) -> Value
Source§impl RowShape
impl RowShape
pub fn set_blob(&self, row: &mut EncodedRow, index: usize, value: &Blob)
pub fn get_blob(&self, row: &EncodedRow, index: usize) -> Blob
pub fn try_get_blob(&self, row: &EncodedRow, index: usize) -> Option<Blob>
Source§impl RowShape
impl RowShape
pub fn set_bool( &self, row: &mut EncodedRow, index: usize, value: impl Into<bool>, )
pub fn get_bool(&self, row: &EncodedRow, index: usize) -> bool
pub fn try_get_bool(&self, row: &EncodedRow, index: usize) -> Option<bool>
Source§impl RowShape
impl RowShape
pub fn set_date(&self, row: &mut EncodedRow, index: usize, value: Date)
pub fn get_date(&self, row: &EncodedRow, index: usize) -> Date
pub fn try_get_date(&self, row: &EncodedRow, index: usize) -> Option<Date>
Source§impl RowShape
impl RowShape
pub fn set_datetime(&self, row: &mut EncodedRow, index: usize, value: DateTime)
pub fn get_datetime(&self, row: &EncodedRow, index: usize) -> DateTime
pub fn try_get_datetime( &self, row: &EncodedRow, index: usize, ) -> Option<DateTime>
Source§impl RowShape
impl RowShape
Sourcepub fn set_decimal(&self, row: &mut EncodedRow, index: usize, value: &Decimal)
pub fn set_decimal(&self, row: &mut EncodedRow, index: usize, value: &Decimal)
Set a Decimal value with 2-tier storage optimization
- Values that fit in i128: stored inline with MSB=0
- Large values: stored in dynamic section with MSB=1
Sourcepub fn get_decimal(&self, row: &EncodedRow, index: usize) -> Decimal
pub fn get_decimal(&self, row: &EncodedRow, index: usize) -> Decimal
Get a Decimal value, detecting storage mode from MSB
Sourcepub fn try_get_decimal(&self, row: &EncodedRow, index: usize) -> Option<Decimal>
pub fn try_get_decimal(&self, row: &EncodedRow, index: usize) -> Option<Decimal>
Try to get a Decimal value, returning None if undefined
Source§impl RowShape
impl RowShape
pub fn set_dictionary_id( &self, row: &mut EncodedRow, index: usize, entry: &DictionaryEntryId, )
pub fn get_dictionary_id( &self, row: &EncodedRow, index: usize, ) -> DictionaryEntryId
pub fn try_get_dictionary_id( &self, row: &EncodedRow, index: usize, ) -> Option<DictionaryEntryId>
Source§impl RowShape
impl RowShape
pub fn set_duration(&self, row: &mut EncodedRow, index: usize, value: Duration)
pub fn get_duration(&self, row: &EncodedRow, index: usize) -> Duration
pub fn try_get_duration( &self, row: &EncodedRow, index: usize, ) -> Option<Duration>
Source§impl RowShape
impl RowShape
pub fn set_f32(&self, row: &mut EncodedRow, index: usize, value: impl Into<f32>)
pub fn get_f32(&self, row: &EncodedRow, index: usize) -> f32
pub fn try_get_f32(&self, row: &EncodedRow, index: usize) -> Option<f32>
Source§impl RowShape
impl RowShape
pub fn set_f64(&self, row: &mut EncodedRow, index: usize, value: impl Into<f64>)
pub fn get_f64(&self, row: &EncodedRow, index: usize) -> f64
pub fn try_get_f64(&self, row: &EncodedRow, index: usize) -> Option<f64>
Source§impl RowShape
impl RowShape
pub fn set_i128( &self, row: &mut EncodedRow, index: usize, value: impl Into<i128>, )
pub fn get_i128(&self, row: &EncodedRow, index: usize) -> i128
pub fn try_get_i128(&self, row: &EncodedRow, index: usize) -> Option<i128>
Source§impl RowShape
impl RowShape
pub fn set_i16(&self, row: &mut EncodedRow, index: usize, value: impl Into<i16>)
pub fn get_i16(&self, row: &EncodedRow, index: usize) -> i16
pub fn try_get_i16(&self, row: &EncodedRow, index: usize) -> Option<i16>
Source§impl RowShape
impl RowShape
pub fn set_i32(&self, row: &mut EncodedRow, index: usize, value: impl Into<i32>)
pub fn get_i32(&self, row: &EncodedRow, index: usize) -> i32
pub fn try_get_i32(&self, row: &EncodedRow, index: usize) -> Option<i32>
Source§impl RowShape
impl RowShape
pub fn set_i64(&self, row: &mut EncodedRow, index: usize, value: impl Into<i64>)
pub fn get_i64(&self, row: &EncodedRow, index: usize) -> i64
pub fn try_get_i64(&self, row: &EncodedRow, index: usize) -> Option<i64>
Source§impl RowShape
impl RowShape
pub fn set_i8(&self, row: &mut EncodedRow, index: usize, value: impl Into<i8>)
pub fn get_i8(&self, row: &EncodedRow, index: usize) -> i8
pub fn try_get_i8(&self, row: &EncodedRow, index: usize) -> Option<i8>
Source§impl RowShape
impl RowShape
pub fn set_identity_id( &self, row: &mut EncodedRow, index: usize, value: IdentityId, )
pub fn get_identity_id(&self, row: &EncodedRow, index: usize) -> IdentityId
pub fn try_get_identity_id( &self, row: &EncodedRow, index: usize, ) -> Option<IdentityId>
Source§impl RowShape
impl RowShape
Sourcepub fn set_int(&self, row: &mut EncodedRow, index: usize, value: &Int)
pub fn set_int(&self, row: &mut EncodedRow, index: usize, value: &Int)
Set a Int value with 2-tier storage optimization
- Values fitting in 127 bits: stored inline with MSB=0
- Large values: stored in dynamic section with MSB=1
Sourcepub fn get_int(&self, row: &EncodedRow, index: usize) -> Int
pub fn get_int(&self, row: &EncodedRow, index: usize) -> Int
Get a Int value, detecting storage mode from MSB
Sourcepub fn try_get_int(&self, row: &EncodedRow, index: usize) -> Option<Int>
pub fn try_get_int(&self, row: &EncodedRow, index: usize) -> Option<Int>
Try to get a Int value, returning None if undefined
Source§impl RowShape
impl RowShape
Sourcepub fn new(fields: Vec<RowShapeField>) -> Self
pub fn new(fields: Vec<RowShapeField>) -> Self
Create a new shape from a list of fields.
This computes the memory layout (offsets, alignment) and fingerprint.
Sourcepub fn from_parts(
fingerprint: RowShapeFingerprint,
fields: Vec<RowShapeField>,
) -> Self
pub fn from_parts( fingerprint: RowShapeFingerprint, fields: Vec<RowShapeField>, ) -> Self
Create a shape from pre-computed fields and fingerprint. Used when loading from storage.
Sourcepub fn fingerprint(&self) -> RowShapeFingerprint
pub fn fingerprint(&self) -> RowShapeFingerprint
Get the shape’s fingerprint
Sourcepub fn fields(&self) -> &[RowShapeField]
pub fn fields(&self) -> &[RowShapeField]
Get the fields in this shape
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Get the number of fields
Sourcepub fn find_field(&self, name: &str) -> Option<&RowShapeField>
pub fn find_field(&self, name: &str) -> Option<&RowShapeField>
Find a field by name
Sourcepub fn find_field_index(&self, name: &str) -> Option<usize>
pub fn find_field_index(&self, name: &str) -> Option<usize>
Find field index by name
Sourcepub fn get_field(&self, index: usize) -> Option<&RowShapeField>
pub fn get_field(&self, index: usize) -> Option<&RowShapeField>
Find a field by index
Sourcepub fn get_field_name(&self, index: usize) -> Option<&str>
pub fn get_field_name(&self, index: usize) -> Option<&str>
Get field name by index
Sourcepub fn field_names(&self) -> impl Iterator<Item = &str>
pub fn field_names(&self) -> impl Iterator<Item = &str>
Get all field names as an iterator
Sourcepub fn bitvec_size(&self) -> usize
pub fn bitvec_size(&self) -> usize
Size of the bitvec section in bytes
Sourcepub fn data_offset(&self) -> usize
pub fn data_offset(&self) -> usize
Offset where field data starts (after header and bitvec)
Sourcepub fn total_static_size(&self) -> usize
pub fn total_static_size(&self) -> usize
Total size of the static section
Sourcepub fn dynamic_section_start(&self) -> usize
pub fn dynamic_section_start(&self) -> usize
Start of the dynamic section
Sourcepub fn dynamic_section_size(&self, row: &EncodedRow) -> usize
pub fn dynamic_section_size(&self, row: &EncodedRow) -> usize
Size of the dynamic section
Sourcepub fn allocate(&self) -> EncodedRow
pub fn allocate(&self) -> EncodedRow
Allocate a new encoded row
Sourcepub fn set_none(&self, row: &mut EncodedRow, index: usize)
pub fn set_none(&self, row: &mut EncodedRow, index: usize)
Set a field as undefined (not set)
Source§impl RowShape
impl RowShape
pub fn set_time(&self, row: &mut EncodedRow, index: usize, value: Time)
pub fn get_time(&self, row: &EncodedRow, index: usize) -> Time
pub fn try_get_time(&self, row: &EncodedRow, index: usize) -> Option<Time>
Source§impl RowShape
impl RowShape
pub fn set_u128( &self, row: &mut EncodedRow, index: usize, value: impl Into<u128>, )
pub fn get_u128(&self, row: &EncodedRow, index: usize) -> u128
pub fn try_get_u128(&self, row: &EncodedRow, index: usize) -> Option<u128>
Source§impl RowShape
impl RowShape
pub fn set_u16(&self, row: &mut EncodedRow, index: usize, value: impl Into<u16>)
pub fn get_u16(&self, row: &EncodedRow, index: usize) -> u16
pub fn try_get_u16(&self, row: &EncodedRow, index: usize) -> Option<u16>
Source§impl RowShape
impl RowShape
pub fn set_u32(&self, row: &mut EncodedRow, index: usize, value: impl Into<u32>)
pub fn get_u32(&self, row: &EncodedRow, index: usize) -> u32
pub fn try_get_u32(&self, row: &EncodedRow, index: usize) -> Option<u32>
Source§impl RowShape
impl RowShape
pub fn set_u64(&self, row: &mut EncodedRow, index: usize, value: impl Into<u64>)
pub fn get_u64(&self, row: &EncodedRow, index: usize) -> u64
pub fn try_get_u64(&self, row: &EncodedRow, index: usize) -> Option<u64>
Source§impl RowShape
impl RowShape
pub fn set_u8(&self, row: &mut EncodedRow, index: usize, value: impl Into<u8>)
pub fn get_u8(&self, row: &EncodedRow, index: usize) -> u8
pub fn try_get_u8(&self, row: &EncodedRow, index: usize) -> Option<u8>
Source§impl RowShape
impl RowShape
Sourcepub fn set_uint(&self, row: &mut EncodedRow, index: usize, value: &Uint)
pub fn set_uint(&self, row: &mut EncodedRow, index: usize, value: &Uint)
Set a Uint value with 2-tier storage optimization
- Values fitting in 127 bits: stored inline with MSB=0
- Large values: stored in dynamic section with MSB=1
Sourcepub fn get_uint(&self, row: &EncodedRow, index: usize) -> Uint
pub fn get_uint(&self, row: &EncodedRow, index: usize) -> Uint
Get a Uint value, detecting storage mode from MSB
Sourcepub fn try_get_uint(&self, row: &EncodedRow, index: usize) -> Option<Uint>
pub fn try_get_uint(&self, row: &EncodedRow, index: usize) -> Option<Uint>
Try to get a Uint value, returning None if undefined
Source§impl RowShape
impl RowShape
pub fn set_utf8( &self, row: &mut EncodedRow, index: usize, value: impl AsRef<str>, )
pub fn get_utf8<'a>(&'a self, row: &'a EncodedRow, index: usize) -> &'a str
pub fn try_get_utf8<'a>( &'a self, row: &'a EncodedRow, index: usize, ) -> Option<&'a str>
Source§impl RowShape
impl RowShape
pub fn set_uuid4(&self, row: &mut EncodedRow, index: usize, value: Uuid4)
pub fn get_uuid4(&self, row: &EncodedRow, index: usize) -> Uuid4
pub fn try_get_uuid4(&self, row: &EncodedRow, index: usize) -> Option<Uuid4>
Source§impl RowShape
impl RowShape
pub fn set_uuid7(&self, row: &mut EncodedRow, index: usize, value: Uuid7)
pub fn get_uuid7(&self, row: &EncodedRow, index: usize) -> Uuid7
pub fn try_get_uuid7(&self, row: &EncodedRow, index: usize) -> Option<Uuid7>
Source§impl RowShape
impl RowShape
pub fn set_values(&self, row: &mut EncodedRow, values: &[Value])
pub fn set_value(&self, row: &mut EncodedRow, index: usize, val: &Value)
pub fn get_value(&self, row: &EncodedRow, index: usize) -> Value
Trait Implementations§
impl Eq for RowShape
Auto Trait Implementations§
impl Freeze for RowShape
impl RefUnwindSafe for RowShape
impl Send for RowShape
impl Sync for RowShape
impl Unpin for RowShape
impl UnsafeUnpin for RowShape
impl UnwindSafe for RowShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more