pub struct RowSchema { /* private fields */ }Expand description
Pre-computed row layout derived from an Arrow schema.
Converts an Arrow [SchemaRef] into a fixed layout suitable for compiled
field access via pointer arithmetic. The layout is computed once and reused
across all rows sharing the same schema.
Implementations§
Source§impl RowSchema
impl RowSchema
Sourcepub fn from_arrow(schema: &SchemaRef) -> Result<Self, RowError>
pub fn from_arrow(schema: &SchemaRef) -> Result<Self, RowError>
Creates a RowSchema from an Arrow schema.
§Errors
Returns RowError::UnsupportedType if any field has an unsupported [DataType].
Sourcepub const fn header_size() -> usize
pub const fn header_size() -> usize
Returns the header size in bytes (always 8).
Sourcepub fn null_bitmap_size(&self) -> usize
pub fn null_bitmap_size(&self) -> usize
Returns the padded null bitmap size in bytes.
Sourcepub fn fixed_region_offset(&self) -> usize
pub fn fixed_region_offset(&self) -> usize
Returns the byte offset where the fixed data region begins.
Sourcepub fn min_row_size(&self) -> usize
pub fn min_row_size(&self) -> usize
Returns the minimum row size in bytes (header + bitmap + fixed region, no variable data).
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields in the schema.
Sourcepub fn field(&self, idx: usize) -> &FieldLayout
pub fn field(&self, idx: usize) -> &FieldLayout
Sourcepub fn fields(&self) -> &[FieldLayout]
pub fn fields(&self) -> &[FieldLayout]
Returns all field layouts.
Sourcepub fn arrow_schema(&self) -> &SchemaRef
pub fn arrow_schema(&self) -> &SchemaRef
Returns the Arrow schema this row layout was derived from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RowSchema
impl RefUnwindSafe for RowSchema
impl Send for RowSchema
impl Sync for RowSchema
impl Unpin for RowSchema
impl UnsafeUnpin for RowSchema
impl UnwindSafe for RowSchema
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.