struct Progress {
base: Instant,
at: AtomicU64,
showing: Mutex<Option<SessionSlot>>,
}Expand description
The connection’s own clock: one stamp per completed socket write, and the seat it last said it was showing.
A task cannot watch itself. The keepalive answers a peer that went
away while the loop still runs; it cannot see the loop itself parked in an
await, because a select! branch never fires while another branch is being
driven. A loop turn is not progress either: one pass can issue several
bounded writes (batch::flush feeds one or two frames, then a snapshot,
then an optional home snapshot), so a turn-based stamp would claim progress
the connection did not make. The stamp sits where every frame crosses -
ClientSocket’s flush - so the watchdog’s bound means “no write
completed in the bound”, which is what it claims.
Fields§
§base: Instanttokio’s clock rather than the standard one, so a test that pauses
time pauses the watchdog with it.
at: AtomicU64§showing: Mutex<Option<SessionSlot>>The seat this connection last showed, for a wedge’s own record: a connection can watch several seats, and the one on screen is what a person would name.
Implementations§
Source§impl Progress
impl Progress
fn new() -> Self
Sourcefn silent_for(&self, now: Instant) -> Duration
fn silent_for(&self, now: Instant) -> Duration
How long the connection has been parked since its last write.
Sourcefn note_showing(&self, seat: Option<&SessionSlot>)
fn note_showing(&self, seat: Option<&SessionSlot>)
Record the seat this connection says it is showing.
Sourcefn showing_seat(&self) -> Option<SessionSlot>
fn showing_seat(&self) -> Option<SessionSlot>
The seat this connection was showing when it stopped.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
impl UnwindSafe for Progress
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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