Struct futures_lite::stream::Once [−][src]
#[must_use = "streams do nothing unless polled"]pub struct Once<T> { /* fields omitted */ }
Expand description
Stream for the once()
function.
Trait Implementations
impl<T> Stream for Once<T>
[src]
impl<T> Stream for Once<T>
[src]type Item = T
type Item = T
Values yielded by the stream.
impl<'__pin, T> Unpin for Once<T> where
__Origin<'__pin, T>: Unpin,
[src]
__Origin<'__pin, T>: Unpin,
Auto Trait Implementations
impl<T> RefUnwindSafe for Once<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Once<T> where
T: Send,
T: Send,
impl<T> Sync for Once<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for Once<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<S> StreamExt for S where
S: Stream + ?Sized,
[src]
impl<S> StreamExt for S where
S: Stream + ?Sized,
[src]fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> where
Self: Unpin,
[src]
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> where
Self: Unpin,
[src]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]
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]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]
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]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]
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]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]
fn map<T, F>(self, f: F) -> Map<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> T,
[src]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]
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
Self: Sized,
U: Stream,
F: FnMut(Self::Item) -> U,
[src]Maps items to streams and then concatenates them. Read more
fn flatten(self) -> Flatten<Self> where
Self: Sized,
Self::Item: Stream,
[src]
fn flatten(self) -> Flatten<Self> where
Self: Sized,
Self::Item: Stream,
[src]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]
fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut> where
Self: Sized,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
[src]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]
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src]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]
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> Option<T>,
[src]Filters and maps items of the stream using a closure. Read more
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src]
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src]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]
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src]Takes items while predicate
returns true
. Read more
fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src]
fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src]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]
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src]Skips items while predicate
returns true
. Read more
fn step_by(self, step: usize) -> StepBy<Self> where
Self: Sized,
[src]
fn step_by(self, step: usize) -> StepBy<Self> where
Self: Sized,
[src]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]
fn chain<U>(self, other: U) -> Chain<Self, U> where
Self: Sized,
U: Stream<Item = Self::Item> + Sized,
[src]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]
fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Stream<Item = &'a T> + Sized,
T: Clone + 'a,
[src]Clones all items. Read more
fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T> + Sized,
T: Copy + 'a,
[src]
fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T> + Sized,
T: Copy + 'a,
[src]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]
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]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]
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]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]
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]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]
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]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]
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]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]
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]Maps items of the stream to new values using a state value and a closure. Read more
fn cycle(self) -> Cycle<Self> where
Self: Clone + Sized,
[src]
fn cycle(self) -> Cycle<Self> where
Self: Clone + Sized,
[src]Repeats the stream from beginning to end, forever. Read more
fn enumerate(self) -> Enumerate<Self> where
Self: Sized,
[src]
fn enumerate(self) -> Enumerate<Self> where
Self: Sized,
[src]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]
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
Self: Sized,
F: FnMut(&Self::Item),
[src]Calls a closure on each item and passes it on. Read more
fn nth(&mut self, n: usize) -> NthFuture<'_, Self>ⓘ where
Self: Unpin,
[src]
fn nth(&mut self, n: usize) -> NthFuture<'_, Self>ⓘ where
Self: Unpin,
[src]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]
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]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]
fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
[src]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]
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>ⓘ where
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
[src]fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src]
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src]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]
fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src]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]
fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P>ⓘ where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[src]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]
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]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]
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>ⓘ where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
[src]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]
fn zip<U>(self, other: U) -> Zip<Self, U> where
Self: Sized,
U: Stream,
[src]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]
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]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]
fn or<S>(self, other: S) -> Or<Self, S> where
Self: Sized,
S: Stream<Item = Self::Item>,
[src]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]
fn race<S>(self, other: S) -> Race<Self, S> where
Self: Sized,
S: Stream<Item = Self::Item>,
[src]Merges with other
stream, with no preference for either stream when both are ready. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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