AsDecoder

Trait AsDecoder 

Source
pub trait AsDecoder {
    type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>;
    type Error;
    type Allocator: Allocator;
    type Mode: 'static;
    type Decoder<'this>: Decoder<'this, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
       where Self: 'this;

    // Required method
    fn as_decoder(&self) -> Result<Self::Decoder<'_>, Self::Error>;
}
Expand description

Trait that allows a type to be repeatedly coerced into a decoder.

Required Associated Types§

Source

type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>

Context associated with the decoder.

Source

type Error

Error associated with decoding.

Source

type Allocator: Allocator

The allocator associated with the decoder.

Source

type Mode: 'static

The mode of the decoder.

Source

type Decoder<'this>: Decoder<'this, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode> where Self: 'this

The decoder we reborrow as.

Required Methods§

Source

fn as_decoder(&self) -> Result<Self::Decoder<'_>, Self::Error>

Borrow self as a new decoder.

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§