Encodes

Trait Encodes 

Source
pub trait Encodes<T>: ContentType + FormatType {
    type Error: Display + Debug;

    // Required method
    fn encode(output: &T) -> Result<Bytes, Self::Error>;
}
Expand description

A trait for types that can be encoded into a bytes for a request body.

Required Associated Types§

Source

type Error: Display + Debug

The error type that can be returned if the encoding fails.

Required Methods§

Source

fn encode(output: &T) -> Result<Bytes, Self::Error>

Encodes the given value into a bytes.

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§