pub struct Demand { /* private fields */ }Expand description
A cloneable, watch-only handle to a group’s readers.
A paced flight watches it to stop once its riders leave.
A frame being read counts as a reader of its group, and a group a track subscription
or fetch handed out keeps that track wanted until a reader reads its end
(track::Demand).
Once every handle to a finished group is gone, demand waits end with
Error::Dropped; an aborted group’s keep its abort reason. Each clone watches on
its own, so its first poll_wanted_changed reports the
current value.
Implementations§
Source§impl Demand
impl Demand
Sourcepub fn poll_wanted_changed(&mut self, waiter: &Waiter) -> Poll<Result<bool>>
pub fn poll_wanted_changed(&mut self, waiter: &Waiter) -> Poll<Result<bool>>
wanted once it differs from what this handle last returned:
immediately on the first call, then on each change. Errors once the group is closed.
Sourcepub async fn wanted_changed(&mut self) -> Result<bool>
pub async fn wanted_changed(&mut self) -> Result<bool>
wanted once it differs from what this handle last returned:
immediately on the first call, then on each change. Errors once the group is closed.
Awaits poll_wanted_changed.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<()>>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<()>>
Resolves once the group’s outcome is final: Ok once finished, or the abort error.
Sourcepub async fn closed(&self) -> Result<()>
pub async fn closed(&self) -> Result<()>
Resolves once the group’s outcome is final: Ok once finished, or the abort error.
Awaits poll_closed.