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§
Sourcefn encode_persisted_slot(
&self,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
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.
Sourcefn decode_persisted_slot(
bytes: &[u8],
field_name: &'static str,
) -> Result<Self, InternalError>
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.
Sourcefn encode_persisted_option_slot(
value: &Option<Self>,
field_name: &'static str,
) -> Result<Vec<u8>, InternalError>
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.
Sourcefn decode_persisted_option_slot(
bytes: &[u8],
field_name: &'static str,
) -> Result<Option<Self>, InternalError>
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.