Skip to main content

Format

Trait Format 

Source
pub trait Format {
    // Required methods
    fn serialize<T: Serialize + ?Sized>(value: &T) -> Result<Vec<u8>>;
    fn deserialize<T: DeserializeOwned>(bytes: &[u8]) -> Result<T>;
}

Required Methods§

Source

fn serialize<T: Serialize + ?Sized>(value: &T) -> Result<Vec<u8>>

Source

fn deserialize<T: DeserializeOwned>(bytes: &[u8]) -> Result<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Format for Json

Available on crate feature json only.
Source§

impl Format for Postcard