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,
vm: &mut VM,
mutation: SessionHostMutation,
) -> Result<(), OwnershipError>
pub fn apply_host_mutation( &self, vm: &mut VM, 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,
vm: &mut VM,
predicate_ref: impl Into<String>,
) -> Result<ReadinessWitness, OwnershipError>
pub fn issue_readiness_witness( &self, vm: &mut VM, 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,
vm: &mut VM,
witness: &ReadinessWitness,
) -> Result<(), OwnershipError>
pub fn consume_readiness_witness( &self, vm: &mut VM, 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,
vm: &mut VM,
new_owner_id: impl Into<String>,
new_scope: OwnershipScope,
) -> Result<OwnershipReceipt, OwnershipError>
pub fn begin_transfer( &self, vm: &mut VM, 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,
vm: &mut VM,
receipt: &OwnershipReceipt,
) -> Result<Self, OwnershipError>
pub fn commit_transfer( &self, vm: &mut VM, 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,
vm: &mut VM,
new_scope: OwnershipScope,
) -> Result<Self, OwnershipError>
pub fn attenuate_scope( &self, vm: &mut VM, 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, vm: &mut VM) -> Result<(), OwnershipError>
pub fn release(&self, vm: &mut VM) -> 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,
vm: &mut VM,
) -> Result<CancellationWitness, OwnershipError>
pub fn mark_owner_died( &self, vm: &mut VM, ) -> 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,
vm: &mut VM,
receipt: &OwnershipReceipt,
) -> Result<CancellationWitness, OwnershipError>
pub fn cancel_abandoned_transfer( &self, vm: &mut VM, 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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OwnedSession
impl Debug for OwnedSession
impl Eq for OwnedSession
Source§impl PartialEq for OwnedSession
impl PartialEq for OwnedSession
Source§fn eq(&self, other: &OwnedSession) -> bool
fn eq(&self, other: &OwnedSession) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OwnedSession
Auto Trait Implementations§
impl Freeze for OwnedSession
impl RefUnwindSafe for OwnedSession
impl Send for OwnedSession
impl Sync for OwnedSession
impl Unpin for OwnedSession
impl UnsafeUnpin for OwnedSession
impl UnwindSafe for OwnedSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.