pub struct DecoderAndThen<DFirst, F, DSecond, A, E> { /* private fields */ }
Expand description
A decoder for sequence decoders with interdependency between each other.
The result of crate::decode::DecoderExt::and_then
.
Implementations§
Source§impl<DFirst, F, DSecond, A, EE> DecoderAndThen<DFirst, F, DSecond, A, EE>
impl<DFirst, F, DSecond, A, EE> DecoderAndThen<DFirst, F, DSecond, A, EE>
Sourcepub fn first_value(&self) -> Option<&A>
pub fn first_value(&self) -> Option<&A>
Accesses the first decoder value.
Sourcepub fn first_value_as_mut(&mut self) -> Option<&mut A>
pub fn first_value_as_mut(&mut self) -> Option<&mut A>
Mutably accesses the first decoder value.
Trait Implementations§
Source§impl<DFirst: Debug, F: Debug, DSecond: Debug, A: Debug, E: Debug> Debug for DecoderAndThen<DFirst, F, DSecond, A, E>
impl<DFirst: Debug, F: Debug, DSecond: Debug, A: Debug, E: Debug> Debug for DecoderAndThen<DFirst, F, DSecond, A, E>
Source§impl<DFirst, F, DSecond, A, B, EA, EB, EE> Decoder for DecoderAndThen<DFirst, F, DSecond, A, EE>
impl<DFirst, F, DSecond, A, B, EA, EB, EE> Decoder for DecoderAndThen<DFirst, F, DSecond, A, EE>
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<DFirst, F, DSecond, A, E> Freeze for DecoderAndThen<DFirst, F, DSecond, A, E>
impl<DFirst, F, DSecond, A, E> RefUnwindSafe for DecoderAndThen<DFirst, F, DSecond, A, E>where
DFirst: RefUnwindSafe,
F: RefUnwindSafe,
DSecond: RefUnwindSafe,
A: RefUnwindSafe,
E: RefUnwindSafe,
impl<DFirst, F, DSecond, A, E> Send for DecoderAndThen<DFirst, F, DSecond, A, E>
impl<DFirst, F, DSecond, A, E> Sync for DecoderAndThen<DFirst, F, DSecond, A, E>
impl<DFirst, F, DSecond, A, E> Unpin for DecoderAndThen<DFirst, F, DSecond, A, E>
impl<DFirst, F, DSecond, A, E> UnwindSafe for DecoderAndThen<DFirst, F, DSecond, A, E>
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 map<F, B>(self, f: F) -> DecoderMap<Self, F>
fn map<F, B>(self, f: F) -> DecoderMap<Self, F>
Source§fn map_into<B>(self) -> DecoderMapInto<Self, B>
fn map_into<B>(self) -> DecoderMapInto<Self, B>
Source§fn try_map<F, B, EE>(self, f: F) -> DecoderTryMap<Self, F, EE>
fn try_map<F, B, EE>(self, f: F) -> DecoderTryMap<Self, F, EE>
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>
fn try_map_into<B>(self) -> DecoderTryMapInto<Self, B, B::Error>
Source§fn map_err<F, EE>(self, f: F) -> DecoderMapErr<Self, F>
fn map_err<F, EE>(self, f: F) -> DecoderMapErr<Self, F>
Source§fn then<DNext, B, EE>(self, next: DNext) -> DecoderThen<Self, DNext, A, EE>
fn then<DNext, B, EE>(self, next: DNext) -> DecoderThen<Self, DNext, A, EE>
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>
fn and_then<F, DNext, B, EE>( self, f: F, ) -> DecoderAndThen<Self, F, DNext, A, EE>
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