pub struct HolderNotice<Sink: Write> { /* private fields */ }Expand description
What: A wait notice that prints a line to a sink once the wait is slow, and again at every interval. Why: Brief contention stays silent, as the incumbent’s waits were; a long wait stops looking like a hang, and a wait that is still going keeps saying so.
In TS you’d write (pseudocode):
const onSlow = (waitedMs) => sink.write(slowWaitLine(...))Implementations§
Trait Implementations§
Source§impl<Sink: Write> WaitNotice for HolderNotice<Sink>
impl<Sink: Write> WaitNotice for HolderNotice<Sink>
Source§fn slow(&mut self, waited: Duration)
fn slow(&mut self, waited: Duration)
Print the wait line naming the holder when its record can be read; the wait calls this after the grace and at every interval.
Source§fn announces_at_start(&self) -> bool
fn announces_at_start(&self) -> bool
Whether
waiting already said so out loud,
so the first slow call comes one interval after the start instead of after the grace.Auto Trait Implementations§
impl<Sink> Freeze for HolderNotice<Sink>where
Sink: Freeze,
impl<Sink> RefUnwindSafe for HolderNotice<Sink>where
Sink: RefUnwindSafe,
impl<Sink> Send for HolderNotice<Sink>where
Sink: Send,
impl<Sink> Sync for HolderNotice<Sink>where
Sink: Sync,
impl<Sink> Unpin for HolderNotice<Sink>where
Sink: Unpin,
impl<Sink> UnsafeUnpin for HolderNotice<Sink>where
Sink: UnsafeUnpin,
impl<Sink> UnwindSafe for HolderNotice<Sink>where
Sink: UnwindSafe,
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
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> ⓘ
Converts
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> ⓘ
Converts
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