pub trait CapabilityHandle<'a>: Sized {
// Required methods
fn from_store(store: &'a CapabilityStore, id: CapabilityId) -> Self;
fn store(&self) -> &'a CapabilityStore;
fn id(&self) -> CapabilityId;
// Provided methods
async fn duplicate(&'a self) -> Result<Self, Error> { ... }
async fn drop(self) -> Result<(), Error> { ... }
async fn export<T>(self) -> Result<T, Error>
where T: Importable<'a, Handle = Self> { ... }
}
Expand description
A handle to a fsandbox::Capability
stored in a repository held by the
component framework.
This handle represents a capability of an unconfirmed type. Specify type
parameters on export()
methods to derive the type.
Required Methods§
fn from_store(store: &'a CapabilityStore, id: CapabilityId) -> Self
fn store(&self) -> &'a CapabilityStore
fn id(&self) -> CapabilityId
Provided Methods§
Sourceasync fn duplicate(&'a self) -> Result<Self, Error>
async fn duplicate(&'a self) -> Result<Self, Error>
Duplicates the capability referenced by this handle, returning a new handle to the duplicated capability.
Sourceasync fn drop(self) -> Result<(), Error>
async fn drop(self) -> Result<(), Error>
Drop the referenced Capability held by the component framework runtime.
Sourceasync fn export<T>(self) -> Result<T, Error>where
T: Importable<'a, Handle = Self>,
async fn export<T>(self) -> Result<T, Error>where
T: Importable<'a, Handle = Self>,
Extract the value of the referenced Capability and remove it from the component framework runtime.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.