pub struct ThenTry<E, First: Decoder, Second: Decoder, Fun: FnOnce(First::Value) -> Result<Second, E>>(/* private fields */)
where
E: From<First::Error> + From<Second::Error>;Trait Implementations§
Source§impl<E, First: Debug + Decoder, Second: Debug + Decoder, Fun: Debug + FnOnce(First::Value) -> Result<Second, E>> Debug for ThenTry<E, First, Second, Fun>
impl<E, First: Debug + Decoder, Second: Debug + Decoder, Fun: Debug + FnOnce(First::Value) -> Result<Second, E>> Debug for ThenTry<E, First, Second, Fun>
Source§impl<E, First: Decoder, Second: Decoder, Fun: FnOnce(First::Value) -> Result<Second, E>> Decoder for ThenTry<E, First, Second, Fun>
impl<E, First: Decoder, Second: Decoder, Fun: FnOnce(First::Value) -> Result<Second, E>> Decoder for ThenTry<E, First, Second, Fun>
Source§fn decode_chunk(&mut self, bytes: &mut &[u8]) -> Result<(), Self::Error>
fn decode_chunk(&mut self, bytes: &mut &[u8]) -> Result<(), Self::Error>
Processes nex chunk of bytes and updates the cursor. Read more
Source§fn end(self) -> Result<Self::Value, Self::Error>
fn end(self) -> Result<Self::Value, Self::Error>
Called when decoding has ended or there are no more bytes. Read more
Source§fn bytes_received(&mut self, bytes: &[u8]) -> Result<usize, Self::Error>
fn bytes_received(&mut self, bytes: &[u8]) -> Result<usize, Self::Error>
Processes nex chunk of bytes without updating the cursor. Read more
Source§fn then<R: Decoder, F: FnOnce(Self::Value) -> R>(
self,
fun: F,
) -> Then<Self, R, F>
fn then<R: Decoder, F: FnOnce(Self::Value) -> R>( self, fun: F, ) -> Then<Self, R, F>
Chains another decoder after this one finishes such that the value of this one is used to
initialize the next one.
Source§fn then_try<E, R: Decoder, F: FnOnce(Self::Value) -> Result<R, E>>(
self,
fun: F,
) -> ThenTry<E, Self, R, F>
fn then_try<E, R: Decoder, F: FnOnce(Self::Value) -> Result<R, E>>( self, fun: F, ) -> ThenTry<E, Self, R, F>
Chains another decoder after this one finishes such that the value of this one is used to
initialize the next one. Read more
Source§fn chain<D: Decoder>(self, following: D) -> Chain<Self, D>
fn chain<D: Decoder>(self, following: D) -> Chain<Self, D>
Chains another decoder after this one to decode two values.
Source§fn wrap_sub_decode<F: FnOnce() -> ControlFlow<Result<(), Self::Error>, Infallible>>(
f: F,
) -> Result<(), Self::Error>
fn wrap_sub_decode<F: FnOnce() -> ControlFlow<Result<(), Self::Error>, Infallible>>( f: F, ) -> Result<(), Self::Error>
Helper for using sub_decode. Read more
Auto Trait Implementations§
impl<E, First, Second, Fun> Freeze for ThenTry<E, First, Second, Fun>
impl<E, First, Second, Fun> RefUnwindSafe for ThenTry<E, First, Second, Fun>
impl<E, First, Second, Fun> Send for ThenTry<E, First, Second, Fun>
impl<E, First, Second, Fun> Sync for ThenTry<E, First, Second, Fun>
impl<E, First, Second, Fun> Unpin for ThenTry<E, First, Second, Fun>
impl<E, First, Second, Fun> UnwindSafe for ThenTry<E, First, Second, Fun>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more