pub struct Consumer { /* private fields */ }Expand description
The session’s side of a lease: reads the grant and learns when it changes or ends.
Dropping it ends the lease with Reason::Dropped; close says why.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn fixed(grant: Grant) -> Self
pub fn fixed(grant: Grant) -> Self
A lease on a grant nobody drives: it never changes and is never revoked, so only the holder ends it. What a static or public grant admits under.
Sourcepub fn poll_changed(&mut self, waiter: &Waiter) -> Poll<Result<Grant, Reason>>
pub fn poll_changed(&mut self, waiter: &Waiter) -> Poll<Result<Grant, Reason>>
Poll for the next update: the new grant, or the reason the lease ended.
Sourcepub async fn changed(&mut self) -> Result<Grant, Reason>
pub async fn changed(&mut self) -> Result<Grant, Reason>
Wait for the next update: the new grant, or the reason the lease ended.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<Reason>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<Reason>
Poll for the lease ending.
Sourcepub fn revalidate(&self)
pub fn revalidate(&self)
Ask the producer to re-check now. A no-op on a fixed
lease, which has nobody to ask.
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