pub struct DownstreamWatch { /* private fields */ }Expand description
A pull leg’s view of its session’s two downstream frontiers: the paid frontier
(FillSession::served_frontier) and the serve demand
(FillSession::serve_demand). Read-only and cheap to clone, so a pull on its
own runtime holds an owned copy. Minted by FillSession::downstream_watch.
Implementations§
Source§impl DownstreamWatch
impl DownstreamWatch
Sourcepub fn served_paid(&self) -> u64
pub fn served_paid(&self) -> u64
The current paid content frontier.
Sourcepub fn serve_demand(&self) -> u64
pub fn serve_demand(&self) -> u64
The nearest content end a starved serve leg awaits, or 0 when none waits.
Sourcepub async fn past(&self, observed_paid: u64, observed_demand: u64)
pub async fn past(&self, observed_paid: u64, observed_demand: u64)
Resolve once served_paid lies past observed_paid or the serve demand
differs from observed_demand. Returns at once when either already holds.
The demand counts any change: a nearer leg parking lowers it, and the pull
must re-decide for that leg as much as for a farther one.
Registers the wakeup BEFORE it re-reads the frontiers. notify_waiters wakes
only waiters registered when it fires and stores no permit, so an advance
that lands between the caller reading the frontiers and this park would
otherwise be lost, and the pull would wait forever (#1673).
Trait Implementations§
Source§impl Clone for DownstreamWatch
impl Clone for DownstreamWatch
Auto Trait Implementations§
impl Freeze for DownstreamWatch
impl RefUnwindSafe for DownstreamWatch
impl Send for DownstreamWatch
impl Sync for DownstreamWatch
impl Unpin for DownstreamWatch
impl UnsafeUnpin for DownstreamWatch
impl UnwindSafe for DownstreamWatch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more