pub struct SchemaLayout { /* private fields */ }Expand description
Pre-computed layout for binary encoding/decoding
Implementations§
Source§impl SchemaLayout
impl SchemaLayout
Sourcepub fn new(
columns: Vec<ColumnLayout>,
row_stride: usize,
null_mask_size: usize,
) -> SchemaLayout
pub fn new( columns: Vec<ColumnLayout>, row_stride: usize, null_mask_size: usize, ) -> SchemaLayout
Create a SchemaLayout directly from components
Sourcepub fn from_schema(schema: &Table) -> SchemaLayout
pub fn from_schema(schema: &Table) -> SchemaLayout
Create a SchemaLayout from a table schema
Sourcepub fn from_schemas(schemas: &[&Table]) -> SchemaLayout
pub fn from_schemas(schemas: &[&Table]) -> SchemaLayout
Create a SchemaLayout by merging multiple table schemas (for JOIN results). Columns are concatenated in order: left table columns, then right table columns, etc. Right-side columns are marked nullable since LEFT JOIN can produce NULLs.
Sourcepub fn from_projection(schema: &Table, column_names: &[String]) -> SchemaLayout
pub fn from_projection(schema: &Table, column_names: &[String]) -> SchemaLayout
Create a SchemaLayout from projected columns
Sourcepub fn columns(&self) -> &[ColumnLayout]
pub fn columns(&self) -> &[ColumnLayout]
Get the columns
Sourcepub fn row_stride(&self) -> usize
pub fn row_stride(&self) -> usize
Get row stride (total bytes per row)
Sourcepub fn null_mask_size(&self) -> usize
pub fn null_mask_size(&self) -> usize
Get null mask size in bytes
Sourcepub fn calculate_fixed_size(&self, row_count: usize) -> usize
pub fn calculate_fixed_size(&self, row_count: usize) -> usize
Calculate required buffer size for N rows (header + fixed section only)
Source§impl SchemaLayout
impl SchemaLayout
Sourcepub fn column_count_js(&self) -> usize
pub fn column_count_js(&self) -> usize
Get the number of columns
Sourcepub fn column_name_js(&self, idx: usize) -> Option<String>
pub fn column_name_js(&self, idx: usize) -> Option<String>
Get column name by index
Sourcepub fn column_type_js(&self, idx: usize) -> Option<u8>
pub fn column_type_js(&self, idx: usize) -> Option<u8>
Get column type by index (returns BinaryDataType as u8)
Sourcepub fn column_offset_js(&self, idx: usize) -> Option<usize>
pub fn column_offset_js(&self, idx: usize) -> Option<usize>
Get column offset by index (offset within row, after null_mask)
Sourcepub fn column_fixed_size_js(&self, idx: usize) -> Option<usize>
pub fn column_fixed_size_js(&self, idx: usize) -> Option<usize>
Get column fixed size by index
Sourcepub fn column_nullable_js(&self, idx: usize) -> Option<bool>
pub fn column_nullable_js(&self, idx: usize) -> Option<bool>
Check if column is nullable
Sourcepub fn row_stride_js(&self) -> usize
pub fn row_stride_js(&self) -> usize
Get row stride (total bytes per row)
Sourcepub fn null_mask_size_js(&self) -> usize
pub fn null_mask_size_js(&self) -> usize
Get null mask size in bytes
Trait Implementations§
Source§impl Clone for SchemaLayout
impl Clone for SchemaLayout
Source§fn clone(&self) -> SchemaLayout
fn clone(&self) -> SchemaLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchemaLayout
impl Debug for SchemaLayout
Source§impl From<SchemaLayout> for JsValue
impl From<SchemaLayout> for JsValue
Source§fn from(value: SchemaLayout) -> JsValue
fn from(value: SchemaLayout) -> JsValue
Source§impl FromWasmAbi for SchemaLayout
impl FromWasmAbi for SchemaLayout
Source§impl IntoWasmAbi for SchemaLayout
impl IntoWasmAbi for SchemaLayout
Source§impl LongRefFromWasmAbi for SchemaLayout
impl LongRefFromWasmAbi for SchemaLayout
Source§type Anchor = RcRef<SchemaLayout>
type Anchor = RcRef<SchemaLayout>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(
js: <SchemaLayout as LongRefFromWasmAbi>::Abi,
) -> <SchemaLayout as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <SchemaLayout as LongRefFromWasmAbi>::Abi, ) -> <SchemaLayout as LongRefFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for SchemaLayout
impl OptionFromWasmAbi for SchemaLayout
Source§fn is_none(abi: &<SchemaLayout as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<SchemaLayout as FromWasmAbi>::Abi) -> bool
None, and otherwise it will be passed to
FromWasmAbi.Source§impl OptionIntoWasmAbi for SchemaLayout
impl OptionIntoWasmAbi for SchemaLayout
Source§fn none() -> <SchemaLayout as IntoWasmAbi>::Abi
fn none() -> <SchemaLayout as IntoWasmAbi>::Abi
None branch of this option. Read moreSource§impl RefFromWasmAbi for SchemaLayout
impl RefFromWasmAbi for SchemaLayout
Source§type Anchor = RcRef<SchemaLayout>
type Anchor = RcRef<SchemaLayout>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <SchemaLayout as RefFromWasmAbi>::Abi,
) -> <SchemaLayout as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <SchemaLayout as RefFromWasmAbi>::Abi, ) -> <SchemaLayout as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for SchemaLayout
impl RefMutFromWasmAbi for SchemaLayout
Source§type Anchor = RcRefMut<SchemaLayout>
type Anchor = RcRefMut<SchemaLayout>
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(
js: <SchemaLayout as RefMutFromWasmAbi>::Abi,
) -> <SchemaLayout as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <SchemaLayout as RefMutFromWasmAbi>::Abi, ) -> <SchemaLayout as RefMutFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abiSource§impl TryFromJsValue for SchemaLayout
impl TryFromJsValue for SchemaLayout
Source§fn try_from_js_value(value: JsValue) -> Result<SchemaLayout, JsValue>
fn try_from_js_value(value: JsValue) -> Result<SchemaLayout, JsValue>
Source§fn try_from_js_value_ref(value: &JsValue) -> Option<SchemaLayout>
fn try_from_js_value_ref(value: &JsValue) -> Option<SchemaLayout>
Source§impl VectorFromWasmAbi for SchemaLayout
impl VectorFromWasmAbi for SchemaLayout
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <SchemaLayout as VectorFromWasmAbi>::Abi, ) -> Box<[SchemaLayout]>
Source§impl VectorIntoWasmAbi for SchemaLayout
impl VectorIntoWasmAbi for SchemaLayout
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[SchemaLayout]>, ) -> <SchemaLayout as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for SchemaLayout
impl RefUnwindSafe for SchemaLayout
impl Send for SchemaLayout
impl Sync for SchemaLayout
impl Unpin for SchemaLayout
impl UnwindSafe for SchemaLayout
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<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.