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§
Sourcefn encode_persisted_slot_payload_by_kind(
&self,
kind: FieldKind,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
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.
Sourcefn decode_persisted_option_slot_payload_by_kind(
bytes: &[u8],
kind: FieldKind,
field_name: &'static str,
) -> Result<Option<Self>, InternalError>
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.