Skip to main content

SlotReader

Trait SlotReader 

Source
pub trait SlotReader {
    // Required methods
    fn generated_compatible_field_model(
        &self,
        slot: usize,
    ) -> Result<&FieldModel, InternalError>;
    fn has(&self, slot: usize) -> bool;
    fn get_bytes(&self, slot: usize) -> Option<&[u8]>;
    fn get_scalar(
        &self,
        slot: usize,
    ) -> Result<Option<ScalarSlotValueRef<'_>>, InternalError>;
    fn get_value(&mut self, slot: usize) -> Result<Option<Value>, InternalError>;
}
Expand description

SlotReader

SlotReader exposes one persisted row as stable slot-addressable fields. Callers may inspect field presence, borrow raw field bytes, or decode one field value on demand.

Required Methods§

Source

fn generated_compatible_field_model( &self, slot: usize, ) -> Result<&FieldModel, InternalError>

Resolve one generated-compatible field model by stable slot index.

This is a typed materialization compatibility bridge. Runtime decode paths that only need payload decode facts should use field_decode_contract.

Source

fn has(&self, slot: usize) -> bool

Return whether the given slot is present in the persisted row.

Source

fn get_bytes(&self, slot: usize) -> Option<&[u8]>

Borrow the raw persisted payload for one slot when present.

Source

fn get_scalar( &self, slot: usize, ) -> Result<Option<ScalarSlotValueRef<'_>>, InternalError>

Decode one slot as a scalar leaf when the field contract declares a scalar codec.

Source

fn get_value(&mut self, slot: usize) -> Result<Option<Value>, InternalError>

Decode one slot value on demand using the generated-compatible field model bridge.

Implementors§