pub trait TryStreamExt where
    Self: TryStream, 
{ fn try_enumerate(self) -> TryEnumerate<Self, Self::Ok, Self::Error>;
fn take_until_error(self) -> TakeUntilError<Self, Self::Ok, Self::Error>;
fn catch_error(self) -> (ErrorNotify<Self::Error>, CatchError<Self>);
fn try_stateful_then<B, U, F, Fut>(
        self,
        init: B,
        f: F
    ) -> TryStatefulThen<Self, B, Self::Ok, U, Self::Error, F, Fut>
    where
        F: FnMut(B, Self::Ok) -> Fut,
        Fut: Future<Output = Result<Option<(B, U)>, Self::Error>>
;
fn try_stateful_map<B, U, F>(
        self,
        init: B,
        f: F
    ) -> TryStatefulMap<Self, B, Self::Ok, U, Self::Error, F>
    where
        F: FnMut(B, Self::Ok) -> Result<Option<(B, U)>, Self::Error>
; }
Expand description

The trait extends TryStream types with combinators.

Required methods

Create a fallible stream that gives the current iteration count.

Overflow Behavior

The method does no guarding against overflows, so enumerating more than usize::MAX elements either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.

Panics The returned iterator might panic if the to-be-returned index would overflow a usize.

Takes elements until an Err(_).

Split the stream of Result<T, E> to a stream of T and a future of Result<(), E>.

The method returns (future, stream). If this combinator encoutners an Err, future.await returns that error, and returned stream fuses. If the input stream is depleted without error, future.await resolves to Ok(()).

Similar to and_then but with a state.

Similar to map but with a state and is fallible.

Implementors