pub trait ObjectCodec: Send + Sync {
// Required methods
fn serialize_object<T: Serialize>(&self, obj: &T) -> FsResult<Vec<u8>>;
fn deserialize_object<T: DeserializeOwned>(
&self,
bytes: &[u8],
) -> FsResult<T>;
}Expand description
Trait for serializing and deserializing logical objects to/from bytes.
Required Methods§
fn serialize_object<T: Serialize>(&self, obj: &T) -> FsResult<Vec<u8>>
fn deserialize_object<T: DeserializeOwned>(&self, bytes: &[u8]) -> FsResult<T>
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.