Decodes

Trait Decodes 

pub trait Decodes<T> {
    type Error: Display;

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

A trait for types that can be decoded from a bytes for a response body.

Required Associated Typesยง

type Error: Display

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

Required Methodsยง

fn decode(bytes: Bytes) -> Result<T, Self::Error>

Decodes the given bytes into a value.

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.

Implementations on Foreign Typesยง

ยง

impl Decodes<BackendError<ServerFnErrorErr>> for Encoder

ยง

type Error = String

ยง

fn decode( bytes: Bytes, ) -> Result<BackendError<ServerFnErrorErr>, <Encoder as Decodes<BackendError<ServerFnErrorErr>>>::Error>

Implementorsยง