Trait musli::de::AsDecoder

source ·
pub trait AsDecoder {
    type Cx: Context + ?Sized;
    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: Context + ?Sized

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, const OPT: Options, C: ?Sized + Context> AsDecoder for AsValueDecoder<'a, OPT, C>

Available on crate feature value only.
§

type Cx = C

§

type Decoder<'this> = ValueDecoder<'a, 'this, OPT, C> where Self: 'this