Trait StorageFormat

Source
pub trait StorageFormat {
    type SerializeError;
    type DeserializeError;

    // Required methods
    fn to_vec<T>(value: &T) -> Result<Vec<u8>, Self::SerializeError>
       where T: Serialize + ?Sized;
    fn from_slice<T>(v: &[u8]) -> Result<T, Self::DeserializeError>
       where T: DeserializeOwned;
}

Required Associated Types§

Required Methods§

Source

fn to_vec<T>(value: &T) -> Result<Vec<u8>, Self::SerializeError>
where T: Serialize + ?Sized,

Source

fn from_slice<T>(v: &[u8]) -> Result<T, Self::DeserializeError>

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§