Struct futures_lite::stream::Chain [−][src]
#[must_use = "streams do nothing unless polled"]pub struct Chain<S, U> { /* fields omitted */ }
Stream for the StreamExt::chain()
method.
Trait Implementations
impl<S: Clone, U: Clone> Clone for Chain<S, U>
[src][+]
fn clone(&self) -> Chain<S, U>
[src][−]
Returns a copy of the value. Read more
pub fn clone_from(&mut self, source: &Self)
1.0.0[src][−]
Performs copy-assignment from source
. Read more
impl<S: Debug, U: Debug> Debug for Chain<S, U>
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl<S: Stream, U: Stream<Item = S::Item>> Stream for Chain<S, U>
[src][+]
type Item = S::Item
Values yielded by the stream.
fn poll_next(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
[src][−]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
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
pub fn size_hint(&self) -> (usize, Option<usize>)
[src][−]
Returns the bounds on the remaining length of the stream. Read more
impl<'__pin, S, U> Unpin for Chain<S, U> where
__Origin<'__pin, S, U>: Unpin,
[src]
__Origin<'__pin, S, U>: Unpin,
Auto Trait Implementations
impl<S, U> RefUnwindSafe for Chain<S, U> where
S: RefUnwindSafe,
U: RefUnwindSafe,
S: RefUnwindSafe,
U: RefUnwindSafe,
impl<S, U> Send for Chain<S, U> where
S: Send,
U: Send,
S: Send,
U: Send,
impl<S, U> Sync for Chain<S, U> where
S: Sync,
U: Sync,
S: Sync,
U: Sync,
impl<S, U> UnwindSafe for Chain<S, U> where
S: UnwindSafe,
U: UnwindSafe,
S: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
pub fn type_id(&self) -> TypeId
[src][−]
Gets the TypeId
of self
. Read more
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<S> StreamExt for S where
S: Stream + ?Sized,
[src][+]
S: Stream + ?Sized,
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> where
Self: Unpin,
[src][−]
Self: Unpin,
A convenience for calling Stream::poll_next()
on !
Unpin
types.
fn next(&mut self) -> NextFuture<'_, Self>ⓘNotable traits for NextFuture<'_, S>
impl<S: Stream + Unpin + ?Sized> Future for NextFuture<'_, S> type Output = Option<S::Item>;
where
Self: Unpin,
[src][−]
Notable traits for NextFuture<'_, S>
impl<S: Stream + Unpin + ?Sized> Future for NextFuture<'_, S> type Output = Option<S::Item>;
Self: Unpin,
Retrieves the next item in the stream. Read more
fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self>ⓘNotable traits for TryNextFuture<'_, S>
impl<T, E, S: ?Sized> Future for TryNextFuture<'_, S> where
S: Stream<Item = Result<T, E>> + Unpin, type Output = Result<Option<T>, E>;
where
Self: Stream<Item = Result<T, E>> + Unpin,
[src][−]
Notable traits for TryNextFuture<'_, S>
impl<T, E, S: ?Sized> Future for TryNextFuture<'_, S> where
S: Stream<Item = Result<T, E>> + Unpin, type Output = Result<Option<T>, E>;
Self: Stream<Item = Result<T, E>> + Unpin,
Retrieves the next item in the stream. Read more
fn count(self) -> CountFuture<Self>ⓘNotable traits for CountFuture<S>
impl<S: Stream + ?Sized> Future for CountFuture<S> type Output = usize;
where
Self: Sized,
[src][−]
Notable traits for CountFuture<S>
impl<S: Stream + ?Sized> Future for CountFuture<S> type Output = usize;
Self: Sized,
Counts the number of items in the stream. Read more
fn map<T, F>(self, f: F) -> Map<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> T,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> T,
Maps items of the stream to new values using a closure. Read more
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
Self: Sized,
U: Stream,
F: FnMut(Self::Item) -> U,
[src][−]
Self: Sized,
U: Stream,
F: FnMut(Self::Item) -> U,
Maps items to streams and then concatenates them. Read more
fn flatten(self) -> Flatten<Self> where
Self: Sized,
Self::Item: Stream,
[src][−]
Self: Sized,
Self::Item: Stream,
Concatenates inner streams. Read more
fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut> where
Self: Sized,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
Maps items of the stream to new values using an async closure. Read more
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Sized,
P: FnMut(&Self::Item) -> bool,
Keeps items of the stream for which predicate
returns true
. Read more
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> Option<T>,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> Option<T>,
Filters and maps items of the stream using a closure. Read more
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src][−]
Self: Sized,
Takes only the first n
items of the stream. Read more
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Sized,
P: FnMut(&Self::Item) -> bool,
Takes items while predicate
returns true
. Read more
fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src][−]
Self: Sized,
Skips the first n
items of the stream. Read more
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Sized,
P: FnMut(&Self::Item) -> bool,
Skips items while predicate
returns true
. Read more
fn step_by(self, step: usize) -> StepBy<Self> where
Self: Sized,
[src][−]
Self: Sized,
Yields every step
th item. Read more
fn chain<U>(self, other: U) -> Chain<Self, U> where
Self: Sized,
U: Stream<Item = Self::Item> + Sized,
[src][−]
Self: Sized,
U: Stream<Item = Self::Item> + Sized,
Appends another stream to the end of this one. Read more
fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Stream<Item = &'a T> + Sized,
T: Clone + 'a,
[src][−]
Self: Stream<Item = &'a T> + Sized,
T: Clone + 'a,
Clones all items. Read more
fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T> + Sized,
T: Copy + 'a,
[src][−]
Self: Stream<Item = &'a T> + Sized,
T: Copy + 'a,
Copies all items. Read more
fn collect<C>(self) -> CollectFuture<Self, C>ⓘNotable traits for CollectFuture<S, C>
impl<S, C> Future for CollectFuture<S, C> where
S: Stream,
C: Default + Extend<S::Item>, type Output = C;
where
Self: Sized,
C: Default + Extend<Self::Item>,
[src][−]
Notable traits for CollectFuture<S, C>
impl<S, C> Future for CollectFuture<S, C> where
S: Stream,
C: Default + Extend<S::Item>, type Output = C;
Self: Sized,
C: Default + Extend<Self::Item>,
Collects all items in the stream into a collection. Read more
fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C>ⓘNotable traits for TryCollectFuture<S, C>
impl<T, E, S, C> Future for TryCollectFuture<S, C> where
S: Stream<Item = Result<T, E>>,
C: Default + Extend<T>, type Output = Result<C, E>;
where
Self: Stream<Item = Result<T, E>> + Sized,
C: Default + Extend<T>,
[src][−]
Notable traits for TryCollectFuture<S, C>
impl<T, E, S, C> Future for TryCollectFuture<S, C> where
S: Stream<Item = Result<T, E>>,
C: Default + Extend<T>, type Output = Result<C, E>;
Self: Stream<Item = Result<T, E>> + Sized,
C: Default + Extend<T>,
Collects all items in the fallible stream into a collection. Read more
fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B>ⓘ where
Self: Sized,
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Sized,
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
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>ⓘNotable traits for FoldFuture<S, F, T>
impl<S, F, T> Future for FoldFuture<S, F, T> where
S: Stream,
F: FnMut(T, S::Item) -> T, type Output = T;
where
Self: Sized,
F: FnMut(T, Self::Item) -> T,
[src][−]
Notable traits for FoldFuture<S, F, T>
impl<S, F, T> Future for FoldFuture<S, F, T> where
S: Stream,
F: FnMut(T, S::Item) -> T, type Output = T;
Self: Sized,
F: FnMut(T, Self::Item) -> T,
Accumulates a computation over the stream. Read more
fn try_fold<T, E, F, B>(
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B>ⓘNotable traits for TryFoldFuture<'a, S, F, B>
impl<'a, T, E, S, F, B> Future for TryFoldFuture<'a, S, F, B> where
S: Stream<Item = Result<T, E>> + Unpin,
F: FnMut(B, T) -> Result<B, E>, type Output = Result<B, E>;
where
Self: Stream<Item = Result<T, E>> + Unpin + Sized,
F: FnMut(B, T) -> Result<B, E>,
[src][−]
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B>ⓘ
Notable traits for TryFoldFuture<'a, S, F, B>
impl<'a, T, E, S, F, B> Future for TryFoldFuture<'a, S, F, B> where
S: Stream<Item = Result<T, E>> + Unpin,
F: FnMut(B, T) -> Result<B, E>, type Output = Result<B, E>;
Self: Stream<Item = Result<T, E>> + Unpin + Sized,
F: FnMut(B, T) -> Result<B, E>,
Accumulates a fallible computation over the stream. Read more
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
[src][−]
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
Maps items of the stream to new values using a state value and a closure. Read more
fn fuse(self) -> Fuse<Self> where
Self: Sized,
[src][−]
Self: Sized,
fn cycle(self) -> Cycle<Self> where
Self: Clone + Sized,
[src][−]
Self: Clone + Sized,
Repeats the stream from beginning to end, forever. Read more
fn enumerate(self) -> Enumerate<Self> where
Self: Sized,
[src][−]
Self: Sized,
Enumerates items, mapping them to (index, item)
. Read more
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
Self: Sized,
F: FnMut(&Self::Item),
[src][−]
Self: Sized,
F: FnMut(&Self::Item),
Calls a closure on each item and passes it on. Read more
fn nth(&mut self, n: usize) -> NthFuture<'_, Self>ⓘ where
Self: Unpin,
[src][−]
Self: Unpin,
Gets the n
th item of the stream. Read more
fn last(self) -> LastFuture<Self>ⓘNotable traits for LastFuture<S>
impl<S: Stream> Future for LastFuture<S> type Output = Option<S::Item>;
where
Self: Sized,
[src][−]
Notable traits for LastFuture<S>
impl<S: Stream> Future for LastFuture<S> type Output = Option<S::Item>;
Self: Sized,
Returns the last item in the stream. Read more
fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
Finds the first item of the stream for which predicate
returns true
. Read more
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>ⓘ where
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
[src][−]
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Finds the index of the first item of the stream for which predicate
returns true
. Read more
fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Tests if predicate
returns true
for all items in the stream. Read more
fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Tests if predicate
returns true
for any item in the stream. Read more
fn for_each<F>(self, f: F) -> ForEachFuture<Self, F>ⓘNotable traits for ForEachFuture<S, F>
impl<S, F> Future for ForEachFuture<S, F> where
S: Stream,
F: FnMut(S::Item), type Output = ();
where
Self: Sized,
F: FnMut(Self::Item),
[src][−]
Notable traits for ForEachFuture<S, F>
impl<S, F> Future for ForEachFuture<S, F> where
S: Stream,
F: FnMut(S::Item), type Output = ();
Self: Sized,
F: FnMut(Self::Item),
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>,
[src][−]
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
Calls a fallible closure on each item of the stream, stopping on first error. Read more
fn zip<U>(self, other: U) -> Zip<Self, U> where
Self: Sized,
U: Stream,
[src][−]
Self: Sized,
U: Stream,
Zips up two streams into a single stream of pairs. Read more
fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>ⓘ where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
[src][−]
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
Collects a stream of pairs into a pair of collections. Read more
fn or<S>(self, other: S) -> Or<Self, S> where
Self: Sized,
S: Stream<Item = Self::Item>,
[src][−]
Self: Sized,
S: Stream<Item = Self::Item>,
Merges with other
stream, preferring items from self
whenever both streams are ready. Read more
fn race<S>(self, other: S) -> Race<Self, S> where
Self: Sized,
S: Stream<Item = Self::Item>,
[src][−]
Self: Sized,
S: Stream<Item = Self::Item>,
Merges with other
stream, with no preference for either stream when both are ready. Read more
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>> where
Self: Send + Sized + 'a,
[src][−]
Self: Send + Sized + 'a,
Boxes the stream and changes its type to dyn Stream + Send + 'a
. Read more
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>> where
Self: Sized + 'a,
[src][−]
Self: Sized + 'a,
Boxes the stream and changes its type to dyn Stream + 'a
. Read more
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src][−]
Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src][−]
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
Performs the conversion.
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
Performs the conversion.
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized,
[src][+]
S: Stream<Item = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
pub fn try_poll_next(
self: Pin<&mut S>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>
[src][−]
self: Pin<&mut S>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>
Poll this TryStream
as if it were a Stream
. Read more