Skip to main content

Session

Struct Session 

Source
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>

Source

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.

Source

pub fn peer_application_payload(&self) -> &[u8]

Peer HELLO application payload, available before the coordinator decides.

Source

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>

Source

pub fn from_bootstrap( bootstrap: ReceiverBootstrap, options: SessionOptions, ) -> Result<Self, SessionFailure>

Consumes the unique process-entry bootstrap and exchanges HELLOs.

Source

pub fn peer_application_payload(&self) -> &[u8]

Peer HELLO application payload, available before awaiting the decision.

Source

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>

Source

pub fn negotiated_limits(&self) -> SessionLimits

Effective finite limits bound into the accepted transcript.

Source

pub fn atomic_capabilities(&self) -> AtomicCapabilities

Effective lock-free atomic and layout alignment facts bound into ACCEPT.

Source

pub fn protocol_version(&self) -> ProtocolVersion

Accepted protocol version from the exact challenged transcript.

Source

pub fn state(&self) -> SessionState

Current local reducer/liveness state.

Source

pub fn active_leases(&self) -> ActiveLeaseFacts

Bounded current active-mapping lease counters.

Source

pub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>

Performs one nonblocking authenticated peer observation.

Source

pub fn wait_for_exit(&mut self, deadline: AbsoluteDeadline) -> ChildCleanupFacts

Boundedly waits for and reaps the exact direct child without consuming the session.

Source

pub fn try_close(self, deadline: AbsoluteDeadline) -> CoordinatorCloseOutcome

Gracefully closes only after active leases are gone and the exact child is reaped.

Source

pub fn abort(self, deadline: AbsoluteDeadline) -> CoordinatorAbortOutcome

Terminally poisons live mappings, terminates the exact child, and returns cleanup facts.

Source

pub fn new_transfer_batch(&self) -> Result<TransferBatch, BatchError>

Starts a local batch builder bounded by this accepted session.

Source

pub fn transfer_batch( &mut self, batch: TransferBatch, deadline: AbsoluteDeadline, ) -> Result<ActiveRegionSet, SessionFailure>

Completes one atomic capability transaction and activates its full set.

Source

pub fn send_control( &mut self, kind: u32, payload: &[u8], deadline: AbsoluteDeadline, ) -> Result<(), SessionFailure>

Sends one bounded opaque application record under the supplied deadline.

Source

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>

Source

pub fn negotiated_limits(&self) -> SessionLimits

Effective finite limits bound into the accepted transcript.

Source

pub fn atomic_capabilities(&self) -> AtomicCapabilities

Effective lock-free atomic and layout alignment facts bound into ACCEPT.

Source

pub fn protocol_version(&self) -> ProtocolVersion

Accepted protocol version from the exact challenged transcript.

Source

pub fn state(&self) -> SessionState

Current local reducer/liveness state.

Source

pub fn active_leases(&self) -> ActiveLeaseFacts

Bounded current active-mapping lease counters.

Source

pub fn poll_peer(&mut self) -> Result<PeerStatus, SessionFailure>

Performs one nonblocking authenticated peer observation.

Source

pub fn wait_for_exit( &mut self, deadline: AbsoluteDeadline, ) -> Result<PeerStatus, SessionFailure>

Boundedly waits for authenticated peer endpoint closure under one deadline.

Source

pub fn try_close(self) -> ReceiverCloseOutcome

Closes the inherited endpoint only after every active mapping lease is gone.

Source

pub fn abort(self)

Terminally poisons every live mapping and closes the inherited endpoint.

Source

pub fn receive_batch( &mut self, expected: ExpectedBatch, deadline: AbsoluteDeadline, ) -> Result<ActiveRegionSet, SessionFailure>

Receives, validates, commits, and activates one exact expected batch.

Source

pub fn send_control( &mut self, kind: u32, payload: &[u8], deadline: AbsoluteDeadline, ) -> Result<(), SessionFailure>

Sends one bounded opaque application record under the supplied deadline.

Source

pub fn receive_control( &mut self, deadline: AbsoluteDeadline, ) -> Result<ControlFrame, SessionFailure>

Receives one bounded opaque peer record under the supplied deadline.

Auto Trait Implementations§

§

impl<Role, State> !RefUnwindSafe for Session<Role, State>

§

impl<Role, State> !Sync for Session<Role, State>

§

impl<Role, State> Freeze for Session<Role, State>

§

impl<Role, State> Send for Session<Role, State>
where Role: Send, State: Send,

§

impl<Role, State> Unpin for Session<Role, State>
where Role: Unpin, State: Unpin,

§

impl<Role, State> UnsafeUnpin for Session<Role, State>

§

impl<Role, State> UnwindSafe for Session<Role, State>
where Role: UnwindSafe, State: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.