Skip to main content

Decodes

Trait Decodes 

Source
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§

Source

type Error: Display

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

Required Methods§

Source

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.

Implementors§