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: Sized + for<'de> AsDecoder<'de>,
             T: Wire<Constraint = ()>,
             <T as Wire>::Narrowed<'de>: for<'de> Decode<Self::Decoder, Constraint = ()>;
    fn into_decoded_with_constraint<T>(
        self,
        constraint: <T as Constrained>::Constraint,
    ) -> Result<Decoded<T, Self>, DecodeError>
       where Self: Sized + for<'de> AsDecoder<'de>,
             T: Wire,
             <T as Wire>::Narrowed<'de>: for<'de> Decode<Self::Decoder, Constraint = <T as Constrained>::Constraint>;
}
Expand description

Extension methods for AsDecoder.

Required Methods§

Source

fn into_decoded<T>(self) -> Result<Decoded<T, Self>, DecodeError>
where Self: Sized + for<'de> AsDecoder<'de>, T: Wire<Constraint = ()>, <T as Wire>::Narrowed<'de>: for<'de> Decode<Self::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 as Constrained>::Constraint, ) -> Result<Decoded<T, Self>, DecodeError>
where Self: Sized + for<'de> AsDecoder<'de>, T: Wire, <T as Wire>::Narrowed<'de>: for<'de> Decode<Self::Decoder, Constraint = <T as Constrained>::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> AsDecoderExt for D
where D: for<'de> AsDecoder<'de>,