Skip to main content

Encodes

Trait Encodes 

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ยง

type Error: Display + Debug

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

Required Methodsยง

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".

Implementations on Foreign Typesยง

ยง

impl Encodes<BackendError<ServerFnErrorErr>> for Encoder

ยง

type Error = String

ยง

fn encode( output: &BackendError<ServerFnErrorErr>, ) -> Result<Bytes, <Encoder as Encodes<BackendError<ServerFnErrorErr>>>::Error>

Implementorsยง