pub struct OffsetTable {
pub fields: Vec<FieldOffset>,
pub root_size: usize,
pub root_align: usize,
}Expand description
Computed offset table for a schema’s flat record area.
root_size covers the fixed area only — the per-field slot
(inline payload or pointer) plus padding to root_align. Variable
payloads (Phase 2.c String / List<Int>) live in a tail area
the crate::buffer::BufferBuilder appends after root_size
bytes; the wasm side reaches them through the pointer slots.
Fields§
§fields: Vec<FieldOffset>Field slots in declaration order.
root_size: usizeTotal fixed record area size, padded to root_align.
root_align: usizeMaximum alignment required by any field. For an empty schema
this defaults to 1 so callers can still allocate a zero-size
buffer with a benign alignment hint.
Implementations§
Source§impl OffsetTable
impl OffsetTable
Sourcepub fn fixed_area_size(&self) -> usize
pub fn fixed_area_size(&self) -> usize
Alias for root_size that documents the Phase 2.c split — the
returned value covers only the fixed (root) area, not any
String / List<Int> tail-area bytes the builder appends.
Sourcepub fn requires_tail_area(&self) -> bool
pub fn requires_tail_area(&self) -> bool
true when at least one field is PointerIndirect, meaning
the builder needs a tail area beyond root_size. Lets the
codegen pass skip the tail-cursor bookkeeping for purely
scalar schemas.
Trait Implementations§
Source§impl Clone for OffsetTable
impl Clone for OffsetTable
Source§fn clone(&self) -> OffsetTable
fn clone(&self) -> OffsetTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OffsetTable
impl Debug for OffsetTable
impl Eq for OffsetTable
Source§impl PartialEq for OffsetTable
impl PartialEq for OffsetTable
Source§fn eq(&self, other: &OffsetTable) -> bool
fn eq(&self, other: &OffsetTable) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OffsetTable
Auto Trait Implementations§
impl Freeze for OffsetTable
impl RefUnwindSafe for OffsetTable
impl Send for OffsetTable
impl Sync for OffsetTable
impl Unpin for OffsetTable
impl UnsafeUnpin for OffsetTable
impl UnwindSafe for OffsetTable
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<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