pub struct DecoderTryMapInto<D, B, E> { /* private fields */ }Expand description
A decoder for applying a fallible conversion onto the success type.
The result of crate::decode::DecoderExt::try_map_into.
Trait Implementations§
source§impl<D, A, B, E, EE> Decoder for DecoderTryMapInto<D, B, EE>where
D: Decoder<Item = A, Error = E>,
B: TryFrom<A, Error = EE>,
E: From<Error>,
EE: From<Error> + From<E>,
impl<D, A, B, E, EE> Decoder for DecoderTryMapInto<D, B, EE>where D: Decoder<Item = A, Error = E>, B: TryFrom<A, Error = EE>, E: From<Error>, EE: From<Error> + From<E>,
source§fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, src: &mut BytesMut ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Auto Trait Implementations§
impl<D, B, E> RefUnwindSafe for DecoderTryMapInto<D, B, E>where B: RefUnwindSafe, D: RefUnwindSafe, E: RefUnwindSafe,
impl<D, B, E> Send for DecoderTryMapInto<D, B, E>where B: Send, D: Send, E: Send,
impl<D, B, E> Sync for DecoderTryMapInto<D, B, E>where B: Sync, D: Sync, E: Sync,
impl<D, B, E> Unpin for DecoderTryMapInto<D, B, E>where B: Unpin, D: Unpin, E: Unpin,
impl<D, B, E> UnwindSafe for DecoderTryMapInto<D, B, E>where B: UnwindSafe, D: UnwindSafe, E: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<D, A, E> DecoderExt<A, E> for Dwhere
D: Decoder<Item = A, Error = E>,
impl<D, A, E> DecoderExt<A, E> for Dwhere D: Decoder<Item = A, Error = E>,
source§fn try_map<F, B, EE>(self, f: F) -> DecoderTryMap<Self, F, EE>where
F: Fn(A) -> Result<B, EE>,
Self: Sized,
fn try_map<F, B, EE>(self, f: F) -> DecoderTryMap<Self, F, EE>where F: Fn(A) -> Result<B, EE>, Self: Sized,
Applies a fallible function
f of type A -> Result<B, EE> over the decoded value when that is Ok(Some(a)). Read moresource§fn try_map_into<B>(self) -> DecoderTryMapInto<Self, B, B::Error>where
B: TryFrom<A>,
Self: Sized,
fn try_map_into<B>(self) -> DecoderTryMapInto<Self, B, B::Error>where B: TryFrom<A>, Self: Sized,
source§fn then<DNext, B, EE>(self, next: DNext) -> DecoderThen<Self, DNext, A, EE>where
DNext: Decoder<Item = B, Error = EE>,
EE: From<E>,
Self: Sized,
fn then<DNext, B, EE>(self, next: DNext) -> DecoderThen<Self, DNext, A, EE>where DNext: Decoder<Item = B, Error = EE>, EE: From<E>, Self: Sized,
Chains a decoder of
B on the remaining bytes after applying this decoder, then returns a pair of the individual values (a, b). Read moresource§fn and_then<F, DNext, B, EE>(
self,
f: F
) -> DecoderAndThen<Self, F, DNext, A, EE>where
F: Fn(&A) -> DNext,
DNext: Decoder<Item = B, Error = EE>,
EE: From<E>,
Self: Sized,
fn and_then<F, DNext, B, EE>( self, f: F ) -> DecoderAndThen<Self, F, DNext, A, EE>where F: Fn(&A) -> DNext, DNext: Decoder<Item = B, Error = EE>, EE: From<E>, Self: Sized,
Chains a function
f of type &A -> Box<Decoder<Item = B, Error = E>> over the decoded value when that is Ok(Some(a)). Read more