Skip to main content

SerdeCodec

Trait SerdeCodec 

Source
pub trait SerdeCodec {
    // Required methods
    fn write<T, W>(item: T, w: W) -> Result<(), Status>
       where T: Serialize,
             W: Write;
    fn read<T, R>(r: R) -> Result<T, Status>
       where T: for<'de> Deserialize<'de>,
             R: Read;
}

Required Methods§

Source

fn write<T, W>(item: T, w: W) -> Result<(), Status>
where T: Serialize, W: Write,

Source

fn read<T, R>(r: R) -> Result<T, Status>
where T: for<'de> Deserialize<'de>, R: Read,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl SerdeCodec for BincodeSerdeCodec

Available on crate feature bincode only.
Source§

impl SerdeCodec for CborSerdeCodec

Available on crate feature cbor only.
Source§

impl SerdeCodec for JsonSerdeCodec

Available on crate feature json only.
Source§

impl SerdeCodec for MessagePackSerdeCodec

Available on crate feature messagepack only.