Skip to main content

PersistedByKindCodec

Trait PersistedByKindCodec 

Source
pub trait PersistedByKindCodec: Sized {
    // Required methods
    fn encode_persisted_slot_payload_by_kind(
        &self,
        kind: FieldKind,
        field_name: &'static str,
    ) -> Result<Vec<u8>, InternalError>;
    fn decode_persisted_option_slot_payload_by_kind(
        bytes: &[u8],
        kind: FieldKind,
        field_name: &'static str,
    ) -> Result<Option<Self>, InternalError>;
}
Expand description

PersistedByKindCodec

PersistedByKindCodec lets one field type own the stricter schema-selected ByKind persisted-row storage contract. This contract is persistence-only and MUST NOT depend on runtime Value conversion, generic fallback bridges, or the runtime value-surface traits.

Required Methods§

Source

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

Encode one field payload through the explicit ByKind storage lane.

Source

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

Decode one optional field payload through the explicit ByKind storage lane, preserving the null sentinel for wrapper-owned optional handling.

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 PersistedByKindCodec for bool

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for i8

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for i16

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for i32

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for i64

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for u8

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for u16

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for u32

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for u64

Source§

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

Source§

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

Source§

impl PersistedByKindCodec for String

Source§

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

Source§

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

Source§

impl<K, V> PersistedByKindCodec for BTreeMap<K, V>

Source§

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

Source§

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

Source§

impl<T> PersistedByKindCodec for Option<T>

Source§

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

Source§

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

Source§

impl<T> PersistedByKindCodec for Box<T>

Source§

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

Source§

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

Source§

impl<T> PersistedByKindCodec for BTreeSet<T>

Source§

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

Source§

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

Source§

impl<T> PersistedByKindCodec for Vec<T>

Source§

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

Source§

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

Implementors§