pub struct WebSocketAuthorityBinding { /* private fields */ }Expand description
Socket-fact conduit into one ClientParticipantAggregate.
The binding retains at most one un-redeemed permit (minted by an established loss) and at most one in-progress attempt (minted by an open request); both are the client unit’s sealed one-use authorities, so “one real open per fresh authorization” holds by construction.
Implementations§
Source§impl WebSocketAuthorityBinding
impl WebSocketAuthorityBinding
Sourcepub const fn with_aggregate(aggregate: ClientParticipantAggregate) -> Self
pub const fn with_aggregate(aggregate: ClientParticipantAggregate) -> Self
Creates a binding over an existing client aggregate (for example one restored from a committed resume record or prepared by the caller).
Sourcepub const fn aggregate(&self) -> &ClientParticipantAggregate
pub const fn aggregate(&self) -> &ClientParticipantAggregate
Borrows the owned aggregate for inspection.
Sourcepub const fn reconnect_state(&self) -> ReconnectState
pub const fn reconnect_state(&self) -> ReconnectState
Reports the aggregate’s reconnect state.
Sourcepub const fn last_loss_diagnostic(&self) -> Option<&TransportTerminal>
pub const fn last_loss_diagnostic(&self) -> Option<&TransportTerminal>
The diagnostic terminal recorded with the most recent established loss.
Diagnostics only: the terminal variant never selected the transition.
Sourcepub fn request_open(&mut self) -> OpenRequestDecision
pub fn request_open(&mut self) -> OpenRequestDecision
Requests authority for exactly one real socket open.
A permit retained from an established loss is redeemed first; otherwise
the request is recorded as the explicit caller action fresh event. On
Authorized the caller must perform exactly one real open and then
report its completion through connection_established or
open_failed.
Sourcepub fn connection_established(&mut self) -> AttemptFateOutcome
pub fn connection_established(&mut self) -> AttemptFateOutcome
Passes the socket’s successful open as the typed Connected fate.
Sourcepub fn open_failed(&mut self) -> AttemptFateOutcome
pub fn open_failed(&mut self) -> AttemptFateOutcome
Passes the socket’s failed open as the typed Failed fate, which
parks the aggregate without minting any retry authority.
Sourcepub fn established_terminal(
&mut self,
terminal: &TransportTerminal,
) -> LossRecordOutcome
pub fn established_terminal( &mut self, terminal: &TransportTerminal, ) -> LossRecordOutcome
Passes an established-connection terminal as the typed Lost fate.
terminal is retained as diagnostics only; every variant reaches the
identical aggregate decision. On success the minted one-use permit is
retained for the next request_open — the binding never opens on its
own and never re-arms a timer.
Sourcepub fn detach_send_lost(
&mut self,
correlation: ClientResponseCorrelation,
) -> DetachLossOutcome
pub fn detach_send_lost( &mut self, correlation: ClientResponseCorrelation, ) -> DetachLossOutcome
Passes a detach-send transport loss to the typed detach replay fate, consuming the outstanding send authority and parking replay.