pub trait SerializeKey: Sized {
type Output<'a, B: Buffer + 'a>: Into<KeySerializerFinalized>;
// Required methods
fn serialize_key_to<'a, B: Buffer>(
&self,
serializer: KeySerializer<'a, B>,
) -> Self::Output<'a, B>;
fn deserialize_key_from(
deserializer: &mut KeyDeserializer<'_>,
) -> Result<Self, Error>;
// Provided methods
fn serialize_key_into<B: Buffer>(&self, buffer: &mut B) { ... }
fn serialize_key_with_base_into<B: Buffer>(&self, buffer: &mut B, base: u64)
where Self: SortByU64 { ... }
}Expand description
Trait defining the translation logic from Fxfs types into order-consistent binaries.
Required Associated Types§
Sourcetype Output<'a, B: Buffer + 'a>: Into<KeySerializerFinalized>
type Output<'a, B: Buffer + 'a>: Into<KeySerializerFinalized>
The serializer state returned after writing this type (KeySerializer for non-terminal
types, or KeySerializerFinalized for variable-length trailing types).
Required Methods§
Sourcefn serialize_key_to<'a, B: Buffer>(
&self,
serializer: KeySerializer<'a, B>,
) -> Self::Output<'a, B>
fn serialize_key_to<'a, B: Buffer>( &self, serializer: KeySerializer<'a, B>, ) -> Self::Output<'a, B>
Encodes key representation sequentially into serialization stream.
Sourcefn deserialize_key_from(
deserializer: &mut KeyDeserializer<'_>,
) -> Result<Self, Error>
fn deserialize_key_from( deserializer: &mut KeyDeserializer<'_>, ) -> Result<Self, Error>
Decodes serializations sequentially from underlying raw bytes.
Provided Methods§
Sourcefn serialize_key_into<B: Buffer>(&self, buffer: &mut B)
fn serialize_key_into<B: Buffer>(&self, buffer: &mut B)
Serializes this key directly into buffer with its length prefix and no delta base.
Matches the ergonomics of serde/bincode serialize_into.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".