Struct futures_lite::stream::Cycle[][src]

#[must_use = "streams do nothing unless polled"]
pub struct Cycle<S> { /* fields omitted */ }
Expand description

Stream for the StreamExt::cycle() method.

Trait Implementations

impl<S: Clone> Clone for Cycle<S>[src]

fn clone(&self) -> Cycle<S>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for Cycle<S>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<S> Stream for Cycle<S> where
    S: Stream + Clone
[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]

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

fn size_hint(&self) -> (usize, Option<usize>)[src]

Returns the bounds on the remaining length of the stream. Read more

impl<'__pin, S> Unpin for Cycle<S> where
    __Origin<'__pin, S>: Unpin
[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Cycle<S> where
    S: RefUnwindSafe

impl<S> Send for Cycle<S> where
    S: Send

impl<S> Sync for Cycle<S> where
    S: Sync

impl<S> UnwindSafe for Cycle<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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]

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]

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]

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]

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]

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]

Maps items to streams and then concatenates them. Read more

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]

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]

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]

Filters and maps items of the stream using a closure. Read more

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]

Takes items while predicate returns true. Read more

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]

Skips items while predicate returns true. Read more

fn step_by(self, step: usize) -> StepBy<Self> where
    Self: Sized
[src]

Yields every stepth item. Read more

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]

Clones all items. Read more

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]

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]

Collects all items in the fallible stream into a collection. Read more

fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B>

Notable traits for PartitionFuture<S, P, B>

impl<S, P, B> Future for PartitionFuture<S, P, B> where
    S: Stream + Sized,
    P: FnMut(&S::Item) -> bool,
    B: Default + Extend<S::Item>, 
type Output = (B, 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]

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]

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]

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]

Fuses the stream so that it stops yielding items after the first None. Read more

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]

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]

Calls a closure on each item and passes it on. Read more

fn nth(&mut self, n: usize) -> NthFuture<'_, Self>

Notable traits for NthFuture<'a, S>

impl<'a, S: ?Sized> Future for NthFuture<'a, S> where
    S: Stream + Unpin
type Output = Option<S::Item>;
where
    Self: Unpin
[src]

Gets the nth 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]

Returns the last item in the stream. Read more

fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P>

Notable traits for FindFuture<'a, S, P>

impl<'a, S: ?Sized, P> Future for FindFuture<'a, S, P> where
    S: Stream + Unpin,
    P: FnMut(&S::Item) -> bool
type Output = Option<S::Item>;
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>

Notable traits for FindMapFuture<'a, S, F>

impl<'a, S: ?Sized, B, F> Future for FindMapFuture<'a, S, F> where
    S: Stream + Unpin,
    F: FnMut(S::Item) -> Option<B>, 
type Output = Option<B>;
where
    Self: Unpin,
    F: FnMut(Self::Item) -> Option<B>, 
[src]

Applies a closure to items in the stream and returns the first Some result. Read more

fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>

Notable traits for PositionFuture<'a, S, P>

impl<'a, S: ?Sized, P> Future for PositionFuture<'a, S, P> where
    S: Stream + Unpin,
    P: FnMut(S::Item) -> bool
type Output = Option<usize>;
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>

Notable traits for AllFuture<'_, S, P>

impl<S: ?Sized, P> Future for AllFuture<'_, S, P> where
    S: Stream + Unpin,
    P: FnMut(S::Item) -> bool
type Output = bool;
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>

Notable traits for AnyFuture<'_, S, P>

impl<S: ?Sized, P> Future for AnyFuture<'_, S, P> where
    S: Stream + Unpin,
    P: FnMut(S::Item) -> bool
type Output = bool;
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]

Calls a closure on each item of the stream. Read more

fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>

Notable traits for TryForEachFuture<'a, S, F>

impl<'a, S: ?Sized, F, E> Future for TryForEachFuture<'a, S, F> where
    S: Stream + Unpin,
    F: FnMut(S::Item) -> Result<(), E>, 
type Output = Result<(), E>;
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]

Zips up two streams into a single stream of pairs. Read more

fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>

Notable traits for UnzipFuture<S, FromA, FromB>

impl<S, A, B, FromA, FromB> Future for UnzipFuture<S, FromA, FromB> where
    S: Stream<Item = (A, B)>,
    FromA: Default + Extend<A>,
    FromB: Default + Extend<B>, 
type Output = (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]

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]

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]

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]

Boxes the stream and changes its type to dyn Stream + 'a. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

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]

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]

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]

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]

Poll this TryStream as if it were a Stream. Read more