pub struct Consumer { /* private fields */ }Expand description
Consumes bandwidth estimates, allowing reads and async change notifications.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn poll_changed(&mut self, waiter: &Waiter) -> Poll<Result<Option<u64>>>
pub fn poll_changed(&mut self, waiter: &Waiter) -> Poll<Result<Option<u64>>>
Poll for a bandwidth change without blocking.
Ok(None) means the estimate is unavailable for now: the backend
stopped reporting one, or the handle spans reconnects and is between
sessions. Err means the producer is gone and no further change will ever
arrive. They’re distinct because a caller holds its current rate for the
first and stops watching for the second.
A backend with no bandwidth estimation at all yields no Consumer in the first place, so that case never reaches here.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Consumer
impl RefUnwindSafe for Consumer
impl Send for Consumer
impl Sync for Consumer
impl Unpin for Consumer
impl UnsafeUnpin for Consumer
impl UnwindSafe for Consumer
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