Struct tokio::stream::Empty [−][src]
#[must_use = "streams do nothing unless polled"]pub struct Empty<T>(_);
Stream for the empty
function.
Trait Implementations
impl<T: Debug> Debug for Empty<T>
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl<T> Send for Empty<T>
[src]
impl<T> Stream for Empty<T>
[src][+]
type Item = T
Values yielded by the stream.
fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>>
[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<T> Sync for Empty<T>
[src]
impl<T> Unpin for Empty<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Empty<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Empty<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<St> StreamExt for St where
St: Stream + ?Sized,
[src][+]
St: Stream + ?Sized,
fn next(&mut self) -> Next<'_, Self> where
Self: Unpin,
[src][−]
Self: Unpin,
Consumes and returns the next value in the stream or None
if the
stream is finished. Read more
fn try_next<T, E>(&mut self) -> TryNext<'_, Self> where
Self: Stream<Item = Result<T, E>> + Unpin,
[src][−]
Self: Stream<Item = Result<T, E>> + Unpin,
Consumes and returns the next item in the stream. If an error is encountered before the next item, the error is returned instead. Read more
fn map<T, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> T,
Self: Sized,
[src][−]
F: FnMut(Self::Item) -> T,
Self: Sized,
Maps this stream’s items to a different type, returning a new stream of the resulting type. Read more
fn merge<U>(self, other: U) -> Merge<Self, U> where
U: Stream<Item = Self::Item>,
Self: Sized,
[src][−]
U: Stream<Item = Self::Item>,
Self: Sized,
Combine two streams into one by interleaving the output of both as it is produced. Read more
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
Self: Sized,
[src][−]
F: FnMut(&Self::Item) -> bool,
Self: Sized,
Filters the values produced by this stream according to the provided predicate. Read more
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<T>,
Self: Sized,
[src][−]
F: FnMut(Self::Item) -> Option<T>,
Self: Sized,
Filters the values produced by this stream while simultaneously mapping them to a different type according to the provided closure. Read more
fn fuse(self) -> Fuse<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a stream which ends after the first None
. Read more
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a new stream of at most n
items of the underlying stream. Read more
fn take_while<F>(self, f: F) -> TakeWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
Self: Sized,
[src][−]
F: FnMut(&Self::Item) -> bool,
Self: Sized,
Take elements from this stream while the provided predicate
resolves to true
. Read more
fn skip(self, n: usize) -> Skip<Self> where
Self: Sized,
[src][−]
Self: Sized,
Creates a new stream that will skip the n
first items of the
underlying stream. Read more
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
Self: Sized,
[src][−]
F: FnMut(&Self::Item) -> bool,
Self: Sized,
Skip elements from the underlying stream while the provided predicate
resolves to true
. Read more
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin,
F: FnMut(Self::Item) -> bool,
Tests if every element of the stream matches a predicate. Read more
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> bool,
[src][−]
Self: Unpin,
F: FnMut(Self::Item) -> bool,
Tests if any element of the stream matches a predicate. Read more
fn chain<U>(self, other: U) -> Chain<Self, U> where
U: Stream<Item = Self::Item>,
Self: Sized,
[src][−]
U: Stream<Item = Self::Item>,
Self: Sized,
Combine two streams into one by first returning all values from the first stream then all values from the second stream. Read more
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F> 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 collect<T>(self) -> Collect<Self, T> where
T: FromStream<Self::Item>,
Self: Sized,
[src][−]
T: FromStream<Self::Item>,
Self: Sized,
Drain stream pushing all emitted values into a collection. Read more
fn timeout(self, duration: Duration) -> Timeout<Self> where
Self: Sized,
[src][−]
Self: Sized,
Applies a per-item timeout to the passed stream. Read more
fn throttle(self, duration: Duration) -> Throttle<Self> where
Self: Sized,
[src][−]
Self: Sized,
Slows down a stream by enforcing a delay between items. 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