Skip to main content

AsDecoderExt

Trait AsDecoderExt 

Source
pub trait AsDecoderExt: for<'de> AsDecoder<'de> {
    // Required methods
    fn into_decoded<T>(self) -> Result<Decoded<T, Self>, DecodeError>
       where Self: for<'de> AsDecoder<'de> + Sized,
             T: Wire<Constraint = ()>,
             for<'de> T::Narrowed<'de>: Decode<<Self as AsDecoder<'de>>::Decoder, Constraint = ()>;
    fn into_decoded_with_constraint<T>(
        self,
        constraint: T::Constraint,
    ) -> Result<Decoded<T, Self>, DecodeError>
       where Self: for<'de> AsDecoder<'de> + Sized,
             T: Wire,
             for<'de> T::Narrowed<'de>: Decode<<Self as AsDecoder<'de>>::Decoder, Constraint = T::Constraint>;
}
Expand description

Extension methods for AsDecoder.

Required Methods§

Source

fn into_decoded<T>(self) -> Result<Decoded<T, Self>, DecodeError>
where Self: for<'de> AsDecoder<'de> + Sized, T: Wire<Constraint = ()>, for<'de> T::Narrowed<'de>: Decode<<Self as AsDecoder<'de>>::Decoder, Constraint = ()>,

Decodes a value from the decoder and finishes it.

On success, returns Ok of a Decoded value with the decoder. Returns Err if decoding failed or the decoder finished with an error.

Source

fn into_decoded_with_constraint<T>( self, constraint: T::Constraint, ) -> Result<Decoded<T, Self>, DecodeError>
where Self: for<'de> AsDecoder<'de> + Sized, T: Wire, for<'de> T::Narrowed<'de>: Decode<<Self as AsDecoder<'de>>::Decoder, Constraint = T::Constraint>,

Decodes a value from the decoder and finishes it.

On success, returns Ok of a Decoded value with the decoder. Returns Err if decoding failed or the decoder finished with an error.

Implementors§

Source§

impl<D: for<'de> AsDecoder<'de>> AsDecoderExt for D