pub struct Receiver { /* private fields */ }
Expand description
The throttler of a stream
See new
for more details
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn has_capacity(&mut self) -> HasCapacity<'_> ⓘ
pub fn has_capacity(&mut self) -> HasCapacity<'_> ⓘ
Return future which resolves when the current number active of tokens is less than a limit
If you create tokens in different task than the task that waits
on HasCapacity
there is a race condition.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Receiver
impl RefUnwindSafe for Receiver
impl Send for Receiver
impl Sync for Receiver
impl Unpin for Receiver
impl UnwindSafe for Receiver
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