pub struct OwnedSession { /* private fields */ }Expand description
Capability-bearing handle returned by the preferred owned open path.
Implementations§
Source§impl OwnedSession
impl OwnedSession
Sourcepub fn session_id(&self) -> SessionId
pub fn session_id(&self) -> SessionId
Session identifier for this owned handle.
Sourcepub fn capability(&self) -> &OwnershipCapability
pub fn capability(&self) -> &OwnershipCapability
Live ownership capability carried by this handle.
Sourcepub fn apply_host_mutation(
&self,
machine: &mut ProtocolMachine,
mutation: SessionHostMutation,
) -> Result<(), OwnershipError>
pub fn apply_host_mutation( &self, machine: &mut ProtocolMachine, mutation: SessionHostMutation, ) -> Result<(), OwnershipError>
Apply one session-local host mutation through the ownership gate.
§Errors
Returns an OwnershipError if the capability is stale or lacks scope.
Sourcepub fn issue_readiness_witness(
&self,
machine: &mut ProtocolMachine,
predicate_ref: impl Into<String>,
) -> Result<ReadinessWitness, OwnershipError>
pub fn issue_readiness_witness( &self, machine: &mut ProtocolMachine, predicate_ref: impl Into<String>, ) -> Result<ReadinessWitness, OwnershipError>
Issue a single-use readiness witness for a protocol-critical check.
§Errors
Returns an OwnershipError if the capability is stale or lacks session scope.
Sourcepub fn consume_readiness_witness(
&self,
machine: &mut ProtocolMachine,
witness: &ReadinessWitness,
) -> Result<(), OwnershipError>
pub fn consume_readiness_witness( &self, machine: &mut ProtocolMachine, witness: &ReadinessWitness, ) -> Result<(), OwnershipError>
Consume a previously issued readiness witness exactly once.
§Errors
Returns an OwnershipError if the witness is stale, forged, mismatched, or reused.
Sourcepub fn begin_transfer(
&self,
machine: &mut ProtocolMachine,
new_owner_id: impl Into<String>,
new_scope: OwnershipScope,
) -> Result<OwnershipReceipt, OwnershipError>
pub fn begin_transfer( &self, machine: &mut ProtocolMachine, new_owner_id: impl Into<String>, new_scope: OwnershipScope, ) -> Result<OwnershipReceipt, OwnershipError>
Begin an explicit ownership transfer from this handle.
§Errors
Returns an OwnershipError if the capability is stale.
Sourcepub fn commit_transfer(
&self,
machine: &mut ProtocolMachine,
receipt: &OwnershipReceipt,
) -> Result<Self, OwnershipError>
pub fn commit_transfer( &self, machine: &mut ProtocolMachine, receipt: &OwnershipReceipt, ) -> Result<Self, OwnershipError>
Commit an explicit ownership transfer and return the refreshed handle.
§Errors
Returns an OwnershipError if the receipt is stale or mismatched.
Sourcepub fn attenuate_scope(
&self,
machine: &mut ProtocolMachine,
new_scope: OwnershipScope,
) -> Result<Self, OwnershipError>
pub fn attenuate_scope( &self, machine: &mut ProtocolMachine, new_scope: OwnershipScope, ) -> Result<Self, OwnershipError>
Attenuate the handle scope and return the refreshed capability.
§Errors
Returns an OwnershipError if the capability is stale or transfer-pending.
Sourcepub fn release(
&self,
machine: &mut ProtocolMachine,
) -> Result<(), OwnershipError>
pub fn release( &self, machine: &mut ProtocolMachine, ) -> Result<(), OwnershipError>
Release the live ownership claim for this handle.
§Errors
Returns an OwnershipError if the capability is stale.
Sourcepub fn mark_owner_died(
&self,
machine: &mut ProtocolMachine,
) -> Result<CancellationWitness, OwnershipError>
pub fn mark_owner_died( &self, machine: &mut ProtocolMachine, ) -> Result<CancellationWitness, OwnershipError>
Fault the session because the current owner died.
§Errors
Returns an OwnershipError if the live owner no longer matches this handle.
Sourcepub fn cancel_abandoned_transfer(
&self,
machine: &mut ProtocolMachine,
receipt: &OwnershipReceipt,
) -> Result<CancellationWitness, OwnershipError>
pub fn cancel_abandoned_transfer( &self, machine: &mut ProtocolMachine, receipt: &OwnershipReceipt, ) -> Result<CancellationWitness, OwnershipError>
Cancel the session because this transfer was abandoned.
§Errors
Returns an OwnershipError if the receipt no longer matches the live staged transfer.
Trait Implementations§
Source§impl Clone for OwnedSession
impl Clone for OwnedSession
Source§fn clone(&self) -> OwnedSession
fn clone(&self) -> OwnedSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more