pub struct Producer { /* private fields */ }Expand description
The authorizing side of a lease: applies new grants and revokes.
Dropping it revokes with Reason::Dropped unless the lease already ended.
Implementations§
Source§impl Producer
impl Producer
Sourcepub fn update(&self, grant: Grant)
pub fn update(&self, grant: Grant)
Replace the grant, waking the consumer. A no-op once the lease ended.
Sourcepub fn revoke(self, reason: Reason) -> Reason
pub fn revoke(self, reason: Reason) -> Reason
End the lease with reason, consuming the handle, and return the reason
the lease ended with: reason, or the consumer’s if it closed first.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<(Reason, Bytes)>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<(Reason, Bytes)>
Poll for the lease ending, from either side: why it ended, and the totals the session reported. A producer-side revoke, or a drop, reports zero bytes.
Sourcepub fn poll_revalidate(&self, waiter: &Waiter) -> Poll<()>
pub fn poll_revalidate(&self, waiter: &Waiter) -> Poll<()>
Poll until at least one re-check has been asked since the last observation. A burst of asks resolves once.
Sourcepub async fn revalidate_requested(&self)
pub async fn revalidate_requested(&self)
Wait until a re-check has been asked since the last observation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Producer
impl RefUnwindSafe for Producer
impl Send for Producer
impl Sync for Producer
impl Unpin for Producer
impl UnsafeUnpin for Producer
impl UnwindSafe for Producer
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