[−][src]Struct async_std::stream::Empty
pub struct Empty<T> { /* fields omitted */ }
A stream that doesn't yield any items.
This stream is constructed by the empty
function.
Trait Implementations
impl<T> Stream for Empty<T>
[src][+]
type Item = T
The type of items yielded by this stream. Read more
fn poll_next(self: Pin<&mut Self>, _: &mut Context) -> Poll<Option<Self::Item>>
[src][−]
Attempts to receive the next item from the stream. Read more
fn next(&mut self) -> ImplFuture<Option<Self::Item>> where
Self: Unpin,
[src][−]
Self: Unpin,
Advances the stream and returns the next value. Read more
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream that yields its first n
elements. Read more
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
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
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
fn map<B, F>(self, f: F) -> Map<Self, F, Self::Item, B> 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
fn inspect<F>(self, f: F) -> Inspect<Self, F, Self::Item> 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
fn fuse(self) -> Fuse<Self> where
Self: Sized,
[src][−]
Self: Sized,
Transforms this Stream
into a "fused" Stream
such that after the first time poll
returns Poll::Ready(None)
, all future calls to poll
will also return Poll::Ready(None)
. Read more
fn filter<P>(self, predicate: P) -> Filter<Self, P, Self::Item> 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
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F, Self::Item, B> 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
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
fn nth(&mut self, n: usize) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
[src][−]
Self: Sized,
Returns the nth element of the stream. Read more
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
fn find<P>(&mut self, p: P) -> ImplFuture<Option<Self::Item>> where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
[src][−]
Self: Sized,
P: FnMut(&Self::Item) -> bool,
Searches for an element in a stream that satisfies a predicate. Read more
fn find_map<F, B>(&mut self, f: F) -> ImplFuture<Option<B>> where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
[src][−]
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
Applies function to the elements of stream and returns the first non-none result. Read more
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
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
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
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>,
A stream adaptor similar to [fold
] that holds internal state and produces a new stream. Read more
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P, Self::Item> 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
fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a combinator that skips the first n
elements. Read more
fn try_for_each<F, E>(self, f: F) -> ImplFuture<E> where
Self: Sized,
F: FnMut(Self::Item) -> Result<(), E>,
[src][−]
Self: 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
fn zip<U>(self, other: U) -> Zip<Self, U> where
Self: Sized + Stream,
U: Stream,
[src][−]
Self: Sized + Stream,
U: Stream,
'Zips up' two streams into a single stream of pairs. Read more
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead (TODO)"]
fn collect<'a, B>(self) -> ImplFuture<'a, B> where
Self: Sized + 'a,
B: FromStream<Self::Item>,
[src][−]
Self: Sized + 'a,
B: FromStream<Self::Item>,
unstable
only.Transforms a stream into a collection. Read more
impl<T: Debug> Debug for Empty<T>
[src][+]
Auto Trait Implementations
impl<T> Send for Empty<T> where
T: Send,
T: Send,
impl<T> Sync for Empty<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Empty<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Empty<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Empty<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
Performs the conversion.
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
ⓘImportant traits for &'_ mut Ffn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
ⓘImportant traits for &'_ mut Ffn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,