Skip to main content

CapabilityRef

Trait CapabilityRef 

Source
pub trait CapabilityRef<'a>: Sized {
    // Required methods
    fn from_store(store: &'a CapabilityStore, id: CapabilityId) -> Self;
    fn store(&self) -> &'a CapabilityStore;
    fn id(&self) -> CapabilityId;

    // Provided methods
    fn duplicate(&'a self) -> impl Future<Output = Result<Self, Error>> { ... }
    fn drop(self) -> impl Future<Output = Result<(), Error>> { ... }
    fn export<T>(self) -> impl Future<Output = Result<T, Error>>
       where T: Importable<'a, Ref = Self> { ... }
}
Expand description

A reference to a fsandbox::Capability stored in a repository held by the component framework.

This reference 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

Create a CapabilityRef referencing the given store and id.

Warning: If the capability stored in the store at the given key is not of type T, the type mismatch will only become apparent when attempting to call CapabilityRef::export or call type-specific methods on it.

Source

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

Return a reference to the store containing this Capability.

Source

fn id(&self) -> CapabilityId

Return the identifier for this Capability.

Provided Methods§

Source

fn duplicate(&'a self) -> impl Future<Output = Result<Self, Error>>

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

Source

fn drop(self) -> impl Future<Output = Result<(), Error>>

Drop the referenced Capability held by the component framework runtime.

Source

fn export<T>(self) -> impl Future<Output = Result<T, Error>>
where T: Importable<'a, Ref = 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> CapabilityRef<'a> for Connector<'a>

Source§

impl<'a> CapabilityRef<'a> for ConnectorRouter<'a>

Source§

impl<'a> CapabilityRef<'a> for Data<'a>

Source§

impl<'a> CapabilityRef<'a> for DataRouter<'a>

Source§

impl<'a> CapabilityRef<'a> for Dictionary<'a>

Source§

impl<'a> CapabilityRef<'a> for DictionaryRouter<'a>

Source§

impl<'a> CapabilityRef<'a> for DirConnector<'a>

Source§

impl<'a> CapabilityRef<'a> for DirConnectorRouter<'a>

Source§

impl<'a> CapabilityRef<'a> for DirEntry<'a>

Source§

impl<'a> CapabilityRef<'a> for DirEntryRouter<'a>

Source§

impl<'a> CapabilityRef<'a> for Directory<'a>

Source§

impl<'a> CapabilityRef<'a> for Handle<'a>

Source§

impl<'a> CapabilityRef<'a> for Unit<'a>