pub struct Session<Role, State> { /* private fields */ }Expand description
Role- and state-typed session owner.
The role aliases CoordinatorSession and ReceiverSession are the
ordinary spellings. Session values are movable but deliberately not
shareable between threads; every control transition requires &mut self.
Implementations§
Source§impl Session<Coordinator, Negotiating>
impl Session<Coordinator, Negotiating>
Sourcepub fn spawn(
command: SessionCommand,
options: SessionOptions,
) -> Result<Self, SessionFailure>
pub fn spawn( command: SessionCommand, options: SessionOptions, ) -> Result<Self, SessionFailure>
Spawns and authenticates the selected helper under the target’s documented executable-identity policy through both HELLOs.
Sourcepub fn peer_application_payload(&self) -> &[u8] ⓘ
pub fn peer_application_payload(&self) -> &[u8] ⓘ
Peer HELLO application payload, available before the coordinator decides.
Sourcepub fn decide(
self,
decision: NegotiationDecision,
) -> Result<NegotiationOutcome<Session<Coordinator, Ready>>, SessionFailure>
pub fn decide( self, decision: NegotiationDecision, ) -> Result<NegotiationOutcome<Session<Coordinator, Ready>>, SessionFailure>
Makes the explicit coordinator decision and awaits the receiver decision.
Source§impl Session<Receiver, Negotiating>
impl Session<Receiver, Negotiating>
Sourcepub fn from_bootstrap(
bootstrap: ReceiverBootstrap,
options: SessionOptions,
) -> Result<Self, SessionFailure>
pub fn from_bootstrap( bootstrap: ReceiverBootstrap, options: SessionOptions, ) -> Result<Self, SessionFailure>
Consumes the unique process-entry bootstrap and exchanges HELLOs.
Sourcepub fn peer_application_payload(&self) -> &[u8] ⓘ
pub fn peer_application_payload(&self) -> &[u8] ⓘ
Peer HELLO application payload, available before awaiting the decision.
Sourcepub fn decide_after_coordinator(
self,
decide: impl FnOnce(&[u8]) -> NegotiationDecision,
) -> Result<NegotiationOutcome<Session<Receiver, Ready>>, SessionFailure>
pub fn decide_after_coordinator( self, decide: impl FnOnce(&[u8]) -> NegotiationDecision, ) -> Result<NegotiationOutcome<Session<Receiver, Ready>>, SessionFailure>
Awaits exact coordinator ACCEPT before invoking the receiver decision.
Source§impl Session<Coordinator, Ready>
impl Session<Coordinator, Ready>
Sourcepub fn negotiated_limits(&self) -> SessionLimits
pub fn negotiated_limits(&self) -> SessionLimits
Effective finite limits bound into the accepted transcript.
Sourcepub fn atomic_capabilities(&self) -> AtomicCapabilities
pub fn atomic_capabilities(&self) -> AtomicCapabilities
Effective lock-free atomic and layout alignment facts bound into ACCEPT.
Sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Accepted protocol version from the exact challenged transcript.
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
Current local reducer/liveness state.
Sourcepub fn active_leases(&self) -> ActiveLeaseFacts
pub fn active_leases(&self) -> ActiveLeaseFacts
Bounded current active-mapping lease counters.
Sourcepub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>
pub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>
Performs one nonblocking authenticated peer observation.
Sourcepub fn wait_for_exit(&mut self, deadline: AbsoluteDeadline) -> ChildCleanupFacts
pub fn wait_for_exit(&mut self, deadline: AbsoluteDeadline) -> ChildCleanupFacts
Boundedly waits for and reaps the exact direct child without consuming the session.
Sourcepub fn try_close(self, deadline: AbsoluteDeadline) -> CoordinatorCloseOutcome
pub fn try_close(self, deadline: AbsoluteDeadline) -> CoordinatorCloseOutcome
Gracefully closes only after active leases are gone and the exact child is reaped.
Sourcepub fn abort(self, deadline: AbsoluteDeadline) -> CoordinatorAbortOutcome
pub fn abort(self, deadline: AbsoluteDeadline) -> CoordinatorAbortOutcome
Terminally poisons live mappings, terminates the exact child, and returns cleanup facts.
Sourcepub fn new_transfer_batch(&self) -> Result<TransferBatch, BatchError>
pub fn new_transfer_batch(&self) -> Result<TransferBatch, BatchError>
Starts a local batch builder bounded by this accepted session.
Sourcepub fn transfer_batch(
&mut self,
batch: TransferBatch,
deadline: AbsoluteDeadline,
) -> Result<ActiveRegionSet, SessionFailure>
pub fn transfer_batch( &mut self, batch: TransferBatch, deadline: AbsoluteDeadline, ) -> Result<ActiveRegionSet, SessionFailure>
Completes one atomic capability transaction and activates its full set.
Sourcepub fn send_control(
&mut self,
kind: u32,
payload: &[u8],
deadline: AbsoluteDeadline,
) -> Result<(), SessionFailure>
pub fn send_control( &mut self, kind: u32, payload: &[u8], deadline: AbsoluteDeadline, ) -> Result<(), SessionFailure>
Sends one bounded opaque application record under the supplied deadline.
Sourcepub fn receive_control(
&mut self,
deadline: AbsoluteDeadline,
) -> Result<ControlFrame, SessionFailure>
pub fn receive_control( &mut self, deadline: AbsoluteDeadline, ) -> Result<ControlFrame, SessionFailure>
Receives one bounded opaque peer record under the supplied deadline.
Source§impl Session<Receiver, Ready>
impl Session<Receiver, Ready>
Sourcepub fn negotiated_limits(&self) -> SessionLimits
pub fn negotiated_limits(&self) -> SessionLimits
Effective finite limits bound into the accepted transcript.
Sourcepub fn atomic_capabilities(&self) -> AtomicCapabilities
pub fn atomic_capabilities(&self) -> AtomicCapabilities
Effective lock-free atomic and layout alignment facts bound into ACCEPT.
Sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Accepted protocol version from the exact challenged transcript.
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
Current local reducer/liveness state.
Sourcepub fn active_leases(&self) -> ActiveLeaseFacts
pub fn active_leases(&self) -> ActiveLeaseFacts
Bounded current active-mapping lease counters.
Sourcepub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>
pub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>
Performs one nonblocking authenticated peer observation.
Sourcepub fn wait_for_exit(
&mut self,
deadline: AbsoluteDeadline,
) -> Result<PeerStatus, SessionFailure>
pub fn wait_for_exit( &mut self, deadline: AbsoluteDeadline, ) -> Result<PeerStatus, SessionFailure>
Boundedly waits for authenticated peer endpoint closure under one deadline.
Sourcepub fn try_close(self) -> ReceiverCloseOutcome
pub fn try_close(self) -> ReceiverCloseOutcome
Closes the inherited endpoint only after every active mapping lease is gone.
Sourcepub fn receive_batch(
&mut self,
expected: ExpectedBatch,
deadline: AbsoluteDeadline,
) -> Result<ActiveRegionSet, SessionFailure>
pub fn receive_batch( &mut self, expected: ExpectedBatch, deadline: AbsoluteDeadline, ) -> Result<ActiveRegionSet, SessionFailure>
Receives, validates, commits, and activates one exact expected batch.
Sourcepub fn send_control(
&mut self,
kind: u32,
payload: &[u8],
deadline: AbsoluteDeadline,
) -> Result<(), SessionFailure>
pub fn send_control( &mut self, kind: u32, payload: &[u8], deadline: AbsoluteDeadline, ) -> Result<(), SessionFailure>
Sends one bounded opaque application record under the supplied deadline.
Sourcepub fn receive_control(
&mut self,
deadline: AbsoluteDeadline,
) -> Result<ControlFrame, SessionFailure>
pub fn receive_control( &mut self, deadline: AbsoluteDeadline, ) -> Result<ControlFrame, SessionFailure>
Receives one bounded opaque peer record under the supplied deadline.