Trait CapabilityHandle

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

Source

fn from_store(store: &'a CapabilityStore, id: CapabilityId) -> Self

Source

fn store(&self) -> &'a CapabilityStore

Source

fn id(&self) -> CapabilityId

Provided Methods§

Source

async fn duplicate(&'a self) -> Result<Self, Error>

Duplicates the capability referenced by this handle, returning a new handle to the duplicated capability.

Source

async fn drop(self) -> Result<(), Error>

Drop the referenced Capability held by the component framework runtime.

Source

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.

Implementors§

Source§

impl<'a> CapabilityHandle<'a> for Connector<'a>

Source§

impl<'a> CapabilityHandle<'a> for Data<'a>

Source§

impl<'a> CapabilityHandle<'a> for Dictionary<'a>