Skip to main content

PersistedFieldSlotCodec

Trait PersistedFieldSlotCodec 

Source
pub trait PersistedFieldSlotCodec: Sized {
    // Required methods
    fn encode_persisted_slot(
        &self,
        field_name: &'static str,
    ) -> Result<Vec<u8>, InternalError>;
    fn decode_persisted_slot(
        bytes: &[u8],
        field_name: &'static str,
    ) -> Result<Self, InternalError>;
    fn encode_persisted_option_slot(
        value: &Option<Self>,
        field_name: &'static str,
    ) -> Result<Vec<u8>, InternalError>;
    fn decode_persisted_option_slot(
        bytes: &[u8],
        field_name: &'static str,
    ) -> Result<Option<Self>, InternalError>;
}
Expand description

PersistedFieldSlotCodec

PersistedFieldSlotCodec is the single persisted-row field boundary used by derive-generated row bridges. Implementations own every storage decision for their type, including primitive fast paths, optional null handling, and schema/type metadata.

Required Methods§

Source

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Encode one required field slot payload through this type’s storage contract.

Source

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Decode one required field slot payload through this type’s storage contract.

Source

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Encode one optional field slot payload through this type’s storage contract while preserving explicit null.

Source

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Decode one optional field slot payload through this type’s storage contract while preserving explicit null.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PersistedFieldSlotCodec for bool

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for i8

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for i16

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for i32

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for i64

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for u8

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for u16

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for u32

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for u64

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for ()

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl PersistedFieldSlotCodec for String

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl<K, V> PersistedFieldSlotCodec for BTreeMap<K, V>
where K: Ord + PersistedByKindCodec + PersistedFieldSlotKind, V: PersistedByKindCodec + PersistedFieldSlotKind,

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl<T> PersistedFieldSlotCodec for BTreeSet<T>
where T: Ord + PersistedByKindCodec + PersistedFieldSlotKind,

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Source§

impl<T> PersistedFieldSlotCodec for Vec<T>
where T: PersistedByKindCodec + PersistedFieldSlotKind,

Source§

fn encode_persisted_slot( &self, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Self, InternalError>

Source§

fn encode_persisted_option_slot( value: &Option<Self>, field_name: &'static str, ) -> Result<Vec<u8>, InternalError>

Source§

fn decode_persisted_option_slot( bytes: &[u8], field_name: &'static str, ) -> Result<Option<Self>, InternalError>

Implementors§