pub struct FieldOffset {
pub name: String,
pub offset: usize,
pub size: usize,
pub align: usize,
pub kind: FieldKind,
pub list_element: Option<ListElementKind>,
}Expand description
One field’s slot inside a record.
offset is the byte position relative to the buffer base. For
Inline slots size / align reflect the leaf type. For
PointerIndirect slots the fixed-area pointer is always 4 bytes
at 4-byte alignment; the kind carries the tail-area alignment.
Fields§
§name: StringField name as declared in the source schema.
offset: usizeByte offset from the record base. Always a multiple of the
slot’s effective alignment (either kind’s align for Inline
or 4 for PointerIndirect).
size: usizeFixed-area slot size in bytes (excluding any trailing padding
to root_align). For PointerIndirect slots this is always
4 — the pointer width — even though the tail-area payload
can be arbitrarily long.
align: usizeRequired alignment of this slot’s start in bytes. Mirrors the
kind alignment for Inline; 4 for PointerIndirect.
kind: FieldKindHow the field’s payload reaches the wasm side — directly in
the fixed area (Inline), or through a tail-area pointer
(PointerIndirect).
list_element: Option<ListElementKind>Phase 10-c: per-element layout for List<T> fields. None for
non-list fields; Some when the field’s declared TypeRepr is
List<T> and the v1 layout supports T. Carried alongside
FieldKind so the buffer writer / reader can dispatch on the
element shape without re-walking the schema.
Trait Implementations§
Source§impl Clone for FieldOffset
impl Clone for FieldOffset
Source§fn clone(&self) -> FieldOffset
fn clone(&self) -> FieldOffset
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 FieldOffset
impl Debug for FieldOffset
impl Eq for FieldOffset
Source§impl PartialEq for FieldOffset
impl PartialEq for FieldOffset
Source§fn eq(&self, other: &FieldOffset) -> bool
fn eq(&self, other: &FieldOffset) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FieldOffset
Auto Trait Implementations§
impl Freeze for FieldOffset
impl RefUnwindSafe for FieldOffset
impl Send for FieldOffset
impl Sync for FieldOffset
impl Unpin for FieldOffset
impl UnsafeUnpin for FieldOffset
impl UnwindSafe for FieldOffset
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