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
impl AccountRound
Sourcepub fn start(
roster: Roster,
usable: BTreeSet<ServerLabel>,
cap: Retries,
held: Option<ServerLabel>,
) -> Result<AccountRound, RoundEnd>
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.
Sourcepub fn current(&self) -> Option<&ServerLabel>
pub fn current(&self) -> Option<&ServerLabel>
The account the next send goes out on; None for a single-account
roster, which names none.
Sourcepub fn next(&self, failure: &AxError) -> AccountStep
pub fn next(&self, failure: &AxError) -> AccountStep
What to do after failure, read from its retry and its
account disposition alone (D54).
Sourcepub fn apply(self, step: &AccountStep) -> AccountRound
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.
Sourcepub fn admits_repair(&self) -> bool
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.
Sourcepub fn repaired(self) -> AccountRound
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.