Struct async_sse::Decoder [−][src]
pub struct Decoder<R: AsyncBufRead + Unpin> { /* fields omitted */ }
Expand description
An SSE protocol decoder.
Trait Implementations
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read more
Auto Trait Implementations
impl<R> RefUnwindSafe for Decoder<R> where
R: RefUnwindSafe,
impl<R> UnwindSafe for Decoder<R> where
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
A convenience for calling [Stream::poll_next()
] on !
Unpin
types.
Retrieves the next item in the stream. Read more
fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self> where
Self: Stream<Item = Result<T, E>> + Unpin,
fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self> where
Self: Stream<Item = Result<T, E>> + Unpin,
Retrieves the next item in the stream. Read more
Counts the number of items in the stream. Read more
Maps items of the stream to new values using a closure. Read more
Maps items to streams and then concatenates them. Read more
Concatenates inner streams. Read more
Maps items of the stream to new values using an async closure. Read more
Keeps items of the stream for which predicate
returns true
. Read more
Filters and maps items of the stream using a closure. Read more
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
Takes items while predicate
returns true
. Read more
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
Skips items while predicate
returns true
. Read more
Appends another stream to the end of this one. Read more
Clones all items. Read more
Copies all items. Read more
Collects all items in the stream into a collection. Read more
fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C> where
Self: Stream<Item = Result<T, E>>,
C: Default + Extend<T>,
fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C> where
Self: Stream<Item = Result<T, E>>,
C: Default + Extend<T>,
Collects all items in the fallible stream into a collection. Read more
Partitions items into those for which predicate
is true
and those for which it is
false
, and then collects them into two collections. Read more
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
Accumulates a computation over the stream. Read more
Accumulates a fallible computation over the stream. Read more
Maps items of the stream to new values using a state value and a closure. Read more
Repeats the stream from beginning to end, forever. Read more
Enumerates items, mapping them to (index, item)
. Read more
Calls a closure on each item and passes it on. Read more
Gets the n
th item of the stream. Read more
Returns the last item in the stream. Read more
Finds the first item of the stream for which predicate
returns true
. Read more
Finds the index of the first item of the stream for which predicate
returns true
. Read more
Tests if predicate
returns true
for all items in the stream. Read more
Tests if predicate
returns true
for any item in the stream. Read more
Calls a closure on each item of the stream. Read more
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
Calls a fallible closure on each item of the stream, stopping on first error. Read more
Zips up two streams into a single stream of pairs. Read more
Collects a stream of pairs into a pair of collections. Read more
Merges with other
stream, preferring items from self
whenever both streams are ready. Read more
Merges with other
stream, with no preference for either stream when both are ready. Read more
Boxes the stream and changes its type to dyn Stream + Send + 'a
. Read more