Skip to main content

ObjectCodec

Trait ObjectCodec 

Source
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§

Source

fn serialize_object<T: Serialize>(&self, obj: &T) -> FsResult<Vec<u8>>

Source

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.

Implementors§