pub struct Arrivals(/* private fields */);Expand description
What has arrived from workers before the master handled it (cheap to clone; clones share it). A stream’s reader records each message as it is read, before the message waits for the master’s lock, so a busy master doesn’t count its own delay against workers:
- when each worker’s latest message arrived: the lease counts from it, so a master stuck in a slow write doesn’t declare workers lost whose messages keep arriving (B6);
- which attempts’
Started(orFinished) arrived and wait to be handled: they aren’t taken back as never started (B11); - on each worker’s current stream, which number each assignment went out with, and the
latest of the master’s messages a message from it said it had handled (B240): an
assignment it had handled without a
Startedbefore never started there.
Implementations§
Source§impl Arrivals
impl Arrivals
Sourcepub fn last(&self, worker_id: &str) -> Option<Timestamp>
pub fn last(&self, worker_id: &str) -> Option<Timestamp>
When the latest message from worker_id arrived, if one has since it was forgotten.
Sourcepub fn forget(&self, worker_id: &str)
pub fn forget(&self, worker_id: &str)
Forgets worker_id (it is gone), and the starts of its that wait: their messages won’t
be handled any more.
Sourcepub fn new_stream(&self, worker_id: &str) -> u64
pub fn new_stream(&self, worker_id: &str) -> u64
worker_id has a new stream (it registered): its ID; what was known of its earlier
stream’s numbering is forgotten (B240), and its unsent assignments: its registration,
just before, has taken back or kept each (so the map doesn’t grow on a long-lived worker).
Sourcepub fn assigned(
&self,
worker_id: &str,
stream: u64,
attempt_id: &str,
number: u64,
)
pub fn assigned( &self, worker_id: &str, stream: u64, attempt_id: &str, number: u64, )
attempt_id’s assignment went out as message number of worker_id’s stream stream.
Sourcepub fn unsent(&self, worker_id: &str, attempt_id: &str)
pub fn unsent(&self, worker_id: &str, attempt_id: &str)
attempt_id’s assignment to worker_id was never sent: no stream to it, or one full
or closed (Grok’s review of B240). It never started there.
Sourcepub fn read(&self, worker_id: &str, stream: u64, number: u64)
pub fn read(&self, worker_id: &str, stream: u64, number: u64)
A message of worker_id’s stream stream said it had handled the master’s messages up
to number.
Sourcepub fn answered(&self, worker_id: &str, attempt_id: &str)
pub fn answered(&self, worker_id: &str, attempt_id: &str)
worker_id started or refused attempt_id, as heard: its assignment’s number isn’t
needed any more.
Sourcepub fn never_started(&self, worker_id: &str, attempt_id: &str) -> bool
pub fn never_started(&self, worker_id: &str, attempt_id: &str) -> bool
Whether worker_id surely never started attempt_id: a message from it said it had
handled the assignment’s message, and no start of it has arrived. What a worker sends
while handling an assignment (Started, Rejected) is queued before anything naming
it, so a start would have arrived first (B240). Not known (another stream, a message
not heard, an older worker): false, it may run there.
Sourcepub fn start_arrived(&self, worker_id: &str, attempt_id: &str)
pub fn start_arrived(&self, worker_id: &str, attempt_id: &str)
A Started or Finished for attempt_id arrived from worker_id: the attempt started.
Sourcepub fn start_known(&self, worker_id: &str, attempt_id: &str) -> bool
pub fn start_known(&self, worker_id: &str, attempt_id: &str) -> bool
As Self::start_arrived; returns whether the start wasn’t known already.
Sourcepub fn start_waiting(&self, attempt_id: &str) -> bool
pub fn start_waiting(&self, attempt_id: &str) -> bool
Whether a Started or Finished for attempt_id arrived and isn’t handled yet.
Sourcepub fn starts_waiting(&self) -> usize
pub fn starts_waiting(&self) -> usize
How many Started or Finished messages arrived and aren’t handled yet.
Sourcepub fn forget_starts(&self, worker_id: &str)
pub fn forget_starts(&self, worker_id: &str)
Forgets the starts of worker_id’s that wait: it registered, and its journal is what
stands now.
Sourcepub fn start_handled(&self, attempt_id: &str)
pub fn start_handled(&self, attempt_id: &str)
The message about attempt_id’s start was handled (or failed to be).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arrivals
impl RefUnwindSafe for Arrivals
impl Send for Arrivals
impl Sync for Arrivals
impl Unpin for Arrivals
impl UnsafeUnpin for Arrivals
impl UnwindSafe for Arrivals
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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);