pub struct Session { /* private fields */ }sdk only.Expand description
One warrant bound to this runtime’s holder key.
Implementations§
Source§impl Session
impl Session
Warrant chain bound to the runtime holder key.
Sourcepub fn with_filesystem(self, workspace: Workspace) -> Self
Available on crate feature filesystem only.
pub fn with_filesystem(self, workspace: Workspace) -> Self
filesystem only.Pin the local jail for this session.
The runtime is process-wide. The workspace is one job: warrants speak
logical_root, and local_root is the directory on this machine.
Sourcepub fn guard<T, E>(
&self,
call: &Call<'_>,
op: impl FnOnce(&AuthorizedCall<'_>) -> Result<T, E>,
) -> Result<Guarded<T>, GuardError<E>>
pub fn guard<T, E>( &self, call: &Call<'_>, op: impl FnOnce(&AuthorizedCall<'_>) -> Result<T, E>, ) -> Result<Guarded<T>, GuardError<E>>
Authorize call with this session’s warrant, then run op.
Sourcepub fn check(&self, call: &Call<'_>) -> Result<Decision, Denial>
pub fn check(&self, call: &Call<'_>) -> Result<Decision, Denial>
Decide without running anything.
Sourcepub fn drain_receipts(&self) -> Vec<Receipt>
👎Deprecated since 0.3.0: use peek_receipts
Available on crate feature receipts only.
pub fn drain_receipts(&self) -> Vec<Receipt>
use peek_receipts
receipts only.Snapshot of pending receipts. They are removed only by
[acknowledge_receipts].
Sourcepub fn peek_receipts(&self) -> Vec<Receipt>
Available on crate feature receipts only.
pub fn peek_receipts(&self) -> Vec<Receipt>
receipts only.Snapshot of pending receipts. Removed only by [acknowledge_receipts].
Sourcepub fn acknowledge_receipts(&self, count: usize) -> usize
Available on crate feature receipts only.
pub fn acknowledge_receipts(&self, count: usize) -> usize
receipts only.Remove the first count pending receipts from the sink.
Sourcepub fn receipt_overflows(&self) -> usize
Available on crate feature receipts only.
pub fn receipt_overflows(&self) -> usize
receipts only.Receipts dropped because this session’s outbox was full.
Sourcepub fn diagnostics(&self) -> Diagnostics<'_>
pub fn diagnostics(&self) -> Diagnostics<'_>
Operator-side explanation for this session’s warrant.
Sourcepub fn delegate(
&self,
profile: &DelegationProfile,
) -> Result<PresentedAuthority, DelegationError>
pub fn delegate( &self, profile: &DelegationProfile, ) -> Result<PresentedAuthority, DelegationError>
Mint a local child after confirming this session’s parent is live.
Sourcepub fn delegate_to(
&self,
child_holder: &PublicKey,
profile: &DelegationProfile,
) -> Result<Vec<Warrant>, DelegationError>
pub fn delegate_to( &self, child_holder: &PublicKey, profile: &DelegationProfile, ) -> Result<Vec<Warrant>, DelegationError>
Mint a remote child after confirming this session’s parent is live.
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Freeze for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer