pub struct Arbiter { /* private fields */ }Expand description
One consumer’s arbitration of one role (§2.5 to §2.11): a pure state
machine over events that carry their instants, with no clock and no
I/O. It asks reads (Step::reread) and is told what they found
(Event::Read); it is told of a move (Event::Moved) and of the
round trip after it (Event::Stood). A restart is a new Arbiter.
Implementations§
Source§impl Arbiter
impl Arbiter
Sourcepub fn new(
declared: &Arbitrated,
binding: Binding,
params: BTreeMap<String, String>,
) -> Self
pub fn new( declared: &Arbitrated, binding: Binding, params: BTreeMap<String, String>, ) -> Self
The arbitration of a role declared declared, bound by binding,
its parameter bindings params resolved (a self.system or
self.service replaced by the consumer’s own; core R2). It holds
nothing until Arbiter::start.
Sourcepub fn ask(&self) -> Asked
pub fn ask(&self) -> Asked
A presence read is asked now: what it carries back in
Event::Read, so it applies to no token heard since (observer
§3.6).
Sourcepub fn due(&self) -> Option<Mono>
pub fn due(&self) -> Option<Mono>
The active provider’s due instant: its last arrival plus the
deadline, after which it has missed (timing.v1 §2.5). The runtime
arms its timer to fire after it, within the detection bound. None
in the dead-man, where only an arrival can make a provider eligible
(§2.9).
Sourcepub fn providers(&self) -> impl Iterator<Item = &Addr>
pub fn providers(&self) -> impl Iterator<Item = &Addr>
The providers known, in rank order (§2.4).
Sourcepub fn identify(&self, key: &str) -> Result<Addr, Outcome>
pub fn identify(&self, key: &str) -> Result<Addr, Outcome>
The provider a sample’s key names, or why it has none (§2.5’s outcomes 1 to 3): never from the payload.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Arbiter
impl Freeze for Arbiterwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Segment>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<Entry>: Freeze,
*const LeafNode<Rank, Provider> is !null: Freeze,
PhantomData<Box<(Rank, Provider)>>: Freeze,
PhantomData<Kept>: Freeze,
impl Move for Arbiter
impl RefUnwindSafe for Arbiter
impl Send for Arbiter
impl Sync for Arbiter
impl Unpin for Arbiter
impl UnsafeUnpin for Arbiterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Segment>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<Entry>: UnsafeUnpin,
*const LeafNode<Rank, Provider> is !null: UnsafeUnpin,
PhantomData<Box<(Rank, Provider)>>: UnsafeUnpin,
PhantomData<Kept>: UnsafeUnpin,
impl UnwindSafe for Arbiterwhere
RawVecInner: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<Rank, Provider>: UnwindSafe,
BTreeMap<InstanceId, SetValZST>: 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
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,
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