pub struct PendingCommandSet<I> { /* private fields */ }Expand description
Client-local commands that have no server-authored settlement yet.
Implementations§
Source§impl<I> PendingCommandSet<I>
impl<I> PendingCommandSet<I>
Sourcepub fn get(&self, command_id: &str) -> Option<&PendingCommand<I>>
pub fn get(&self, command_id: &str) -> Option<&PendingCommand<I>>
The pending command with this id, if any.
Sourcepub fn iter(&self) -> impl Iterator<Item = &PendingCommand<I>>
pub fn iter(&self) -> impl Iterator<Item = &PendingCommand<I>>
Pending entries in first-submission order.
Sourcepub fn acknowledge(
&mut self,
ack: &CommandAcceptedResult,
) -> Option<PendingSettlement<I>>
pub fn acknowledge( &mut self, ack: &CommandAcceptedResult, ) -> Option<PendingSettlement<I>>
An ACK is a server-authored settlement and retires the matching entry.
Sourcepub fn refuse(&mut self, error: &MspError) -> Option<PendingSettlement<I>>
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.
Sourcepub fn discard(&mut self, command_id: &str) -> Option<PendingSettlement<I>>
pub fn discard(&mut self, command_id: &str) -> Option<PendingSettlement<I>>
Local cancellation or drop settles and retires the matching command.
Sourcepub fn retire_server_terminal(&mut self, command_id: &str) -> bool
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.
Sourcepub fn transport_died(&mut self)
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>
impl<I: PartialEq> PendingCommandSet<I>
Sourcepub fn submit(&mut self, command_id: impl Into<String>, input: I) -> Submission
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.