Skip to main content

SlotReader

Trait SlotReader 

Source
pub trait SlotReader {
    // Required methods
    fn model(&self) -> &'static EntityModel;
    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 model(&self) -> &'static EntityModel

Return the structural model that owns this slot mapping.

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 model declares a scalar codec.

Source

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

Decode one slot value on demand using the field contract declared by the model.

Implementors§