Skip to main content

PendingCommandSet

Struct PendingCommandSet 

Source
pub struct PendingCommandSet<I> { /* private fields */ }
Expand description

Client-local commands that have no server-authored settlement yet.

Implementations§

Source§

impl<I> PendingCommandSet<I>

Source

pub fn new() -> Self

An empty set.

Source

pub fn get(&self, command_id: &str) -> Option<&PendingCommand<I>>

The pending command with this id, if any.

Source

pub fn len(&self) -> usize

How many commands are pending.

Source

pub fn is_empty(&self) -> bool

Whether no command is pending.

Source

pub fn iter(&self) -> impl Iterator<Item = &PendingCommand<I>>

Pending entries in first-submission order.

Source

pub fn acknowledge( &mut self, ack: &CommandAcceptedResult, ) -> Option<PendingSettlement<I>>

An ACK is a server-authored settlement and retires the matching entry.

Source

pub fn refuse(&mut self, error: &MspError) -> Option<PendingSettlement<I>>

A durable commandRejected retires the exact command named in data. Takes the MspError callers hold: the copy’s ErrorObject is #[non_exhaustive] and never reaches them.

Source

pub fn discard(&mut self, command_id: &str) -> Option<PendingSettlement<I>>

Local cancellation or drop settles and retires the matching command.

Source

pub fn retire_server_terminal(&mut self, command_id: &str) -> bool

A server turn terminal retires pending intent without inventing a second pending-layer outcome.

Source

pub fn transport_died(&mut self)

Transport death is not a durable outcome: retain every entry and make exactly one same-id retry eligible on the next connection.

Source§

impl<I: PartialEq> PendingCommandSet<I>

Source

pub fn submit(&mut self, command_id: impl Into<String>, input: I) -> Submission

Register a transport submission.

An existing id never inserts a second entry. After transport death the first identical call returns Submission::Retry; another call is a duplicate until a later death makes one new retry eligible.

Trait Implementations§

Source§

impl<I: Debug> Debug for PendingCommandSet<I>

Source§

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

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

impl<I> Default for PendingCommandSet<I>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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, 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.