pub struct Throttle<T> { /* private fields */ }
Available on crate features
stream
and time
only.Expand description
Stream for the throttle
function.
Implementations§
Source§impl<T: Unpin> Throttle<T>
impl<T: Unpin> Throttle<T>
Sourcepub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Acquires a reference to the underlying stream that this combinator is pulling from.
Sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Acquires a mutable reference to the underlying stream that this combinator is pulling from.
Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this combinator, returning the underlying stream.
Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.
Trait Implementations§
Source§impl<T: Stream> Stream for Throttle<T>
impl<T: Stream> Stream for Throttle<T>
impl<'__pin, T> Unpin for Throttle<T>where
__Origin<'__pin, T>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for Throttle<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Throttle<T>
impl<T> Send for Throttle<T>where
T: Send,
impl<T> Sync for Throttle<T>where
T: Sync,
impl<T> !UnwindSafe for Throttle<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<St> StreamExt for St
impl<St> StreamExt for St
Source§fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
Available on crate feature
stream
only.Consumes and returns the next value in the stream or
None
if the
stream is finished. Read moreSource§fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
Available on crate feature
stream
only.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
Source§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Available on crate feature
stream
only.Maps this stream’s items to a different type, returning a new stream of
the resulting type. Read more
Source§fn merge<U>(self, other: U) -> Merge<Self, U>
fn merge<U>(self, other: U) -> Merge<Self, U>
Available on crate feature
stream
only.Combine two streams into one by interleaving the output of both as it
is produced. Read more
Source§fn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Available on crate feature
stream
only.Filters the values produced by this stream according to the provided
predicate. Read more
Source§fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
Available on crate feature
stream
only.Filters the values produced by this stream while simultaneously mapping
them to a different type according to the provided closure. Read more
Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
Available on crate feature
stream
only.Creates a stream which ends after the first
None
. Read moreSource§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Available on crate feature
stream
only.Creates a new stream of at most
n
items of the underlying stream. Read moreSource§fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
Available on crate feature
stream
only.Take elements from this stream while the provided predicate
resolves to
true
. Read moreSource§fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
Available on crate feature
stream
only.Tests if every element of the stream matches a predicate. Read more
Source§fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
Available on crate feature
stream
only.Tests if any element of the stream matches a predicate. Read more