musli_core::de

Trait AsDecoder

Source
pub trait AsDecoder {
    type Cx: ?Sized + Context;
    type Decoder<'this>: Decoder<'this, Cx = Self::Cx, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
       where Self: 'this;

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

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

Required Associated Types§

Source

type Cx: ?Sized + Context

Context associated with the decoder.

Source

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

The decoder we reborrow as.

Required Methods§

Source

fn as_decoder(&self) -> Result<Self::Decoder<'_>, <Self::Cx as Context>::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§