Skip to main content

Encode

Trait Encode 

Source
pub trait Encode {
    type Error: Error;

    // Required method
    fn encode<W, T>(
        &mut self,
        writer: W,
        message: &T,
    ) -> Result<(), Self::Error>
       where W: Write,
             T: Serialize;
}
Expand description

Trait for encoders.

Required Associated Types§

Source

type Error: Error

Error type.

Required Methods§

Source

fn encode<W, T>(&mut self, writer: W, message: &T) -> Result<(), Self::Error>
where W: Write, T: Serialize,

Encode message into writer.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§