pub struct MasterTime { /* private fields */ }Expand description
Master time as this worker knows it, for one session.
Implementations§
Source§impl MasterTime
impl MasterTime
Sourcepub fn keeping(self, most: usize) -> Self
pub fn keeping(self, most: usize) -> Self
This, keeping at most most messages waiting to be heard of
(SCHEDR_HIDDEN__WORKER__UNACKED_MESSAGES_KEPT).
Sourcepub fn with_window(window: Duration) -> Self
pub fn with_window(window: Duration) -> Self
Nothing known yet; the tightest sample looked for over window.
Sourcepub fn open(&mut self) -> Instant
pub fn open(&mut self) -> Instant
A session opens: a new outbox, its first message (the Register) numbered 0 as the
session’s sender queues it. Returns now on the agent’s own timer clock, the session’s
opening.
Sourcepub fn outbox(&self) -> SharedOutbox
pub fn outbox(&self) -> SharedOutbox
The session’s outbox, for its sender.
Sourcepub fn estimate(&self, now: Local) -> Option<(u64, i64)>
pub fn estimate(&self, now: Local) -> Option<(u64, i64)>
Master time at now as the narrowest sample says (M5.1m): its stamp was made after the
worker sent what it heard and before it arrived, so master time now is within
master_ms + (now - arrived) and master_ms + (now - sent); the middle, with its
timeline. None without a sample, or after a pause the boot clock didn’t count.
(Not the tightest lower bound’s sample: a reply stamped at once and delivered late is
that, and its middle lies half the late return behind; Grok’s review of M5.1m.)
Sourcepub fn reading(&self, now: Local) -> Option<SampleReading>
pub fn reading(&self, now: Local) -> Option<SampleReading>
The best sample’s age and round trip at now; None without one.
Sourcepub fn sent(&mut self, at: Local) -> u64
pub fn sent(&mut self, at: Local) -> u64
A message leaves after at: its number (as Outbox::sent).
Sourcepub fn heard(&mut self, clock: &MasterClock, now: Local) -> Option<Duration>
pub fn heard(&mut self, clock: &MasterClock, now: Local) -> Option<Duration>
A master message’s clock, arrived at now: a sample if it names what this session
sent. For a sample, how far the master’s wall clock on it lies outside this worker’s
over the round trip, the heartbeat’s send to now (decision 449: for a warning only).
Sourcepub fn cutoff_in(&self, lease: Duration, now: Local) -> Option<Duration>
pub fn cutoff_in(&self, lease: Duration, now: Local) -> Option<Duration>
How long from now until the master may count this worker lost: the earlier of master
time passing the latest stamp’s plus lease (decision 445) and lease after the send
of the latest heartbeat a stamp said the master had heard, on this clock less the drift
allowance (B233: the master counts its lease from what it last heard, which a one-way
cut leaves behind the stamps still arriving). None without a stamp and a sample.
Sourcepub fn until(&self, by_ms: i64, now: Local) -> Duration
pub fn until(&self, by_ms: i64, now: Local) -> Duration
How long from now until master time by_ms may be reached, by the same bound as
Self::past: zero when it may be already (no sample, a pause, the bound past).
Trait Implementations§
Source§impl Clone for MasterTime
impl Clone for MasterTime
Source§impl Debug for MasterTime
impl Debug for MasterTime
Auto Trait Implementations§
impl Freeze for MasterTime
impl RefUnwindSafe for MasterTime
impl Send for MasterTime
impl Sync for MasterTime
impl Unpin for MasterTime
impl UnsafeUnpin for MasterTime
impl UnwindSafe for MasterTime
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,
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);