[−][src]Struct async_std::stream::Pending
pub struct Pending<T> { /* fields omitted */ }
A stream that never returns any items.
This stream is created by the pending
function. See its
documentation for more.
Trait Implementations
impl<T: Debug> Debug for Pending<T>
[src][+]
pub fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl<T> DoubleEndedStream for Pending<T>
[src][+]
pub fn poll_next_back(
self: Pin<&mut Self>,
_: &mut Context<'_>
) -> Poll<Option<T>>
[src][−]
self: Pin<&mut Self>,
_: &mut Context<'_>
) -> Poll<Option<T>>
unstable
only.Attempts to receive the next item from the back of the stream. Read more
pub fn next_back(&mut self) -> NextBackFuture<'_, Self> where
Self: Unpin,
[src][−]
Self: Unpin,
unstable
only.Advances the stream and returns the next value. Read more
pub fn nth_back(&mut self, n: usize) -> NthBackFuture<'_, Self> where
Self: Unpin + Sized,
[src][−]
Self: Unpin + Sized,
unstable
only.Returns the nth element from the back of the stream. Read more
pub fn rfind<P>(&mut self, p: P) -> RFindFuture<'_, Self, P> where
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
unstable
only.Returns the the frist element from the right that matches the predicate. Read more
pub fn rfold<B, F>(self, accum: B, f: F) -> RFoldFuture<Self, F, B> where
Self: Sized,
F: FnMut(B, Self::Item) -> B,
[src][−]
Self: Sized,
F: FnMut(B, Self::Item) -> B,
unstable
only.Examples Read more
pub fn try_rfold<B, F, E>(self, accum: B, f: F) -> TryRFoldFuture<Self, F, B> where
Self: Sized,
F: FnMut(B, Self::Item) -> Result<B, E>,
[src][−]
Self: Sized,
F: FnMut(B, Self::Item) -> Result<B, E>,
unstable
only.A combinator that applies a function as long as it returns successfully, producing a single, final value. Immediately returns the error when the function returns unsuccessfully. Read more
impl<T> ExactSizeStream for Pending<T>
[src][+]
pub fn len(&self) -> usize
[src][−]
unstable
only.Returns the exact number of times the stream will iterate. Read more
impl<T> FusedStream for Pending<T>
[src]
impl<T> Stream for Pending<T>
[src][+]
type Item = T
The type of items yielded by this stream.
pub fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>>
[src][−]
Attempts to receive the next item from the stream. Read more
pub fn next(&mut self) -> ImplFuture<Option<Self::Item>> where
Self: Unpin,
[src][−]
Self: Unpin,
Advances the stream and returns the next value. Read more
pub fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream that yields its first n
elements. Read more
pub 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,
Creates a stream that yields elements based on a predicate. Read more
pub fn throttle(self, d: Duration) -> Throttle<Self> where
Self: Sized,
[src][−]
Self: Sized,
unstable
only.Limit the amount of items yielded per timeslice in a stream. Read more
pub fn step_by(self, step: usize) -> StepBy<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream that yields each step
th element. Read more
pub 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,
Takes two streams and creates a new stream over both in sequence. Read more
pub fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Sized + Stream<Item = &'a T>,
T: Clone + 'a,
[src][−]
Self: Sized + Stream<Item = &'a T>,
T: Clone + 'a,
Creates an stream which copies all of its elements. Read more
pub fn copied<'a, T>(self) -> Copied<Self> where
Self: Sized + Stream<Item = &'a T>,
T: Copy + 'a,
[src][−]
Self: Sized + Stream<Item = &'a T>,
T: Copy + 'a,
Creates an stream which copies all of its elements. Read more
pub fn cycle(self) -> Cycle<Self> where
Self: Clone + Sized,
[src][−]
Self: Clone + Sized,
Creates a stream that yields the provided values infinitely and in order. Read more
pub fn enumerate(self) -> Enumerate<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream that gives the current element's count as well as the next value. Read more
pub fn delay(self, dur: Duration) -> Delay<Self> where
Self: Sized,
[src][−]
Self: Sized,
unstable
only.Creates a stream that is delayed before it starts yielding items. Read more
pub fn map<B, F>(self, f: F) -> Map<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> B,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> B,
Takes a closure and creates a stream that calls that closure on every element of this stream. Read more
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
Self: Sized,
F: FnMut(&Self::Item),
[src][−]
Self: Sized,
F: FnMut(&Self::Item),
A combinator that does something with each element in the stream, passing the value on. Read more
pub fn last(self) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
[src][−]
Self: Sized,
Returns the last element of the stream. Read more
pub fn fuse(self) -> Fuse<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream which ends after the first None
. Read more
pub 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,
Creates a stream that uses a predicate to determine if an element should be yielded. Read more
pub fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
Self: Sized,
U: IntoStream,
F: FnMut(Self::Item) -> U,
[src][−]
Self: Sized,
U: IntoStream,
F: FnMut(Self::Item) -> U,
unstable
only.Creates an stream that works like map, but flattens nested structure. Read more
pub fn flatten(self) -> Flatten<Self> where
Self: Sized,
Self::Item: IntoStream,
[src][−]
Self: Sized,
Self::Item: IntoStream,
unstable
only.Creates an stream that flattens nested structure. Read more
pub fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
Both filters and maps a stream. Read more
pub fn min_by_key<B, F>(self, key_by: F) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
[src][−]
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
Returns the element that gives the minimum value with respect to the
specified key function. If several elements are equally minimum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn max_by_key<B, F>(self, key_by: F) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
[src][−]
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
Returns the element that gives the maximum value with respect to the
specified key function. If several elements are equally maximum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn min_by<F>(self, compare: F) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
[src][−]
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
Returns the element that gives the minimum value with respect to the
specified comparison function. If several elements are equally minimum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn max(self) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
Self::Item: Ord,
[src][−]
Self: Sized,
Self::Item: Ord,
Returns the element that gives the maximum value. If several elements are equally maximum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn min(self) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
Self::Item: Ord,
[src][−]
Self: Sized,
Self::Item: Ord,
Returns the element that gives the minimum value. If several elements are equally minimum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn max_by<F>(self, compare: F) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
[src][−]
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
Returns the element that gives the maximum value with respect to the
specified comparison function. If several elements are equally maximum,
the first element is returned. If the stream is empty, None
is returned. Read more
pub fn nth(&mut self, n: usize) -> ImplFuture<Option<Self::Item>> where
Self: Unpin + Sized,
[src][−]
Self: Unpin + Sized,
Returns the nth element of the stream. Read more
pub fn all<F>(&mut self, f: F) -> ImplFuture<bool> where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
Tests if every element of the stream matches a predicate. Read more
pub fn find<P>(&mut self, p: P) -> ImplFuture<Option<Self::Item>> where
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
Searches for an element in a stream that satisfies a predicate. Read more
pub fn find_map<F, B>(&mut self, f: F) -> ImplFuture<Option<B>> where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Option<B>,
[src][−]
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Option<B>,
Applies function to the elements of stream and returns the first non-none result. Read more
pub fn fold<B, F>(self, init: B, f: F) -> ImplFuture<B> where
Self: Sized,
F: FnMut(B, Self::Item) -> B,
[src][−]
Self: Sized,
F: FnMut(B, Self::Item) -> B,
A combinator that applies a function to every element in a stream producing a single, final value. Read more
pub fn partition<B, F>(self, f: F) -> ImplFuture<(B, B)> where
Self: Sized,
F: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
[src][−]
Self: Sized,
F: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
unstable
only.A combinator that applies a function to every element in a stream creating two collections from it. Read more
pub fn for_each<F>(self, f: F) -> ImplFuture<()> where
Self: Sized,
F: FnMut(Self::Item),
[src][−]
Self: Sized,
F: FnMut(Self::Item),
Call a closure on each element of the stream. Read more
pub fn any<F>(&mut self, f: F) -> ImplFuture<bool> where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
Tests if any element of the stream matches a predicate. Read more
pub fn by_ref(&mut self) -> &mut Self
[src][−]
unstable
only.Borrows an stream, rather than consuming it. Read more
pub 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>,
pub 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,
Combinator that skip
s elements based on a predicate. Read more
pub fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a combinator that skips the first n
elements. Read more
pub fn timeout(self, dur: Duration) -> Timeout<Self> where
Self: Stream + Sized,
[src][−]
Self: Stream + Sized,
unstable
only.Await a stream or times out after a duration of time. Read more
pub fn try_fold<B, F, T, E>(
&mut self,
init: T,
f: F
) -> ImplFuture<Result<T, E>> where
Self: Unpin + Sized,
F: FnMut(B, Self::Item) -> Result<T, E>,
[src][−]
&mut self,
init: T,
f: F
) -> ImplFuture<Result<T, E>> where
Self: Unpin + Sized,
F: FnMut(B, Self::Item) -> Result<T, E>,
A combinator that applies a function as long as it returns successfully, producing a single, final value. Immediately returns the error when the function returns unsuccessfully. Read more
pub fn try_for_each<F, E>(&mut self, f: F) -> ImplFuture<E> where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Result<(), E>,
[src][−]
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Result<(), E>,
Applies a falliable function to each element in a stream, stopping at first error and returning it. Read more
pub 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
pub fn unzip<A, B, FromA, FromB>(self) -> ImplFuture<(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,
unstable
only.Converts an stream of pairs into a pair of containers. Read more
pub fn collect<'a, B>(self) -> ImplFuture<B> where
Self: Sized + 'a + Send,
B: FromStream<Self::Item>,
Self::Item: Send,
[src][−]
Self: Sized + 'a + Send,
B: FromStream<Self::Item>,
Self::Item: Send,
unstable
only.Transforms a stream into a collection. Read more
pub fn merge<U>(self, other: U) -> Merge<Self, U> where
Self: Sized,
U: Stream<Item = Self::Item> + Sized,
[src][−]
Self: Sized,
U: Stream<Item = Self::Item> + Sized,
unstable
only.Combines multiple streams into a single stream of all their outputs. Read more
pub fn partial_cmp<S>(self, other: S) -> ImplFuture<Option<Ordering>> where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
Lexicographically compares the elements of this Stream
with those
of another. Read more
pub fn position<P>(&mut self, predicate: P) -> ImplFuture<Option<usize>> where
Self: Unpin + Sized,
P: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin + Sized,
P: FnMut(Self::Item) -> bool,
Searches for an element in a Stream that satisfies a predicate, returning its index. Read more
pub fn cmp<S>(self, other: S) -> ImplFuture<Ordering> where
Self: Sized + Stream,
S: Stream,
Self::Item: Ord,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: Ord,
Lexicographically compares the elements of this Stream
with those
of another using 'Ord'. Read more
pub fn count(self) -> ImplFuture<usize> where
Self: Sized,
[src][−]
Self: Sized,
unstable
only.Counts the number of elements in the stream. Read more
pub fn ne<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized,
S: Sized + Stream,
Self::Item: PartialEq<S::Item>,
[src][−]
Self: Sized,
S: Sized + Stream,
Self::Item: PartialEq<S::Item>,
Determines if the elements of this Stream
are lexicographically
not equal to those of another. Read more
pub fn ge<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
Determines if the elements of this Stream
are lexicographically
greater than or equal to those of another. Read more
pub fn eq<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized + Stream,
S: Sized + Stream,
Self::Item: PartialEq<S::Item>,
[src][−]
Self: Sized + Stream,
S: Sized + Stream,
Self::Item: PartialEq<S::Item>,
Determines if the elements of this Stream
are lexicographically
equal to those of another. Read more
pub fn gt<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
Determines if the elements of this Stream
are lexicographically
greater than those of another. Read more
pub fn le<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
Determines if the elements of this Stream
are lexicographically
less or equal to those of another. Read more
pub fn lt<S>(self, other: S) -> ImplFuture<bool> where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
[src][−]
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<S::Item>,
Determines if the elements of this Stream
are lexicographically
less than those of another. Read more
pub fn sum<'a, S>(self) -> ImplFuture<S> where
Self: Sized + Stream<Item = S> + 'a,
S: Sum<Self::Item>,
[src][−]
Self: Sized + Stream<Item = S> + 'a,
S: Sum<Self::Item>,
unstable
only.Sums the elements of a stream. Read more
pub fn product<'a, P>(self) -> ImplFuture<P> where
Self: Sized + Stream<Item = P> + 'a,
P: Product,
[src][−]
Self: Sized + Stream<Item = P> + 'a,
P: Product,
unstable
only.Multiplies all elements of the stream. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Pending<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Pending<T> where
T: Send,
T: Send,
impl<T> Sync for Pending<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pending<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Pending<T> where
T: UnwindSafe,
T: 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<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>,