Skip to main content

AccountRound

Struct AccountRound 

Source
pub struct AccountRound { /* private fields */ }
Expand description

One round’s state. Every field is private: a round moves only through AccountRound::apply and AccountRound::repaired.

Implementations§

Source§

impl AccountRound

Source

pub fn start( roster: Roster, usable: BTreeSet<ServerLabel>, cap: Retries, held: Option<ServerLabel>, ) -> Result<AccountRound, RoundEnd>

Opens a round before its first send, and counts that send. The account held - the Session’s binding on the model path, absent for web_search - opens the round while it is listed and redeemable; otherwise the first redeemable account in roster order does.

§Errors

RoundEnd::Exhausted when no listed account is redeemable: the round sends nothing.

Source

pub fn current(&self) -> Option<&ServerLabel>

The account the next send goes out on; None for a single-account roster, which names none.

Source

pub fn next(&self, failure: &AxError) -> AccountStep

What to do after failure, read from its retry and its account disposition alone (D54).

Source

pub fn apply(self, step: &AccountStep) -> AccountRound

The round after the driver carried out step. Stop changes nothing. The counts saturate rather than wrap: a single-account round under UntilHalted resends until a Halt, and a count that wrapped would read as a fresh account’s spare sends.

Source

pub fn admits_repair(&self) -> bool

Whether the repair stage may send the request again through the blocking door. With several accounts that send is one more on the current account, so it needs the account’s spare sends and the person’s ceiling; a single-account roster is let through as before.

Source

pub fn repaired(self) -> AccountRound

The round after the repair stage sent again: one more send on the current account with several accounts, uncounted with one.

Trait Implementations§

Source§

impl Clone for AccountRound

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccountRound

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AccountRound

Source§

impl PartialEq for AccountRound

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AccountRound

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.