pub struct CapabilityStoreProxy { /* private fields */ }

Implementations§

source§

impl CapabilityStoreProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.

source

pub fn take_event_stream(&self) -> CapabilityStoreEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn duplicate( &self, id: u64, dest_id: u64, ) -> QueryResponseFut<CapabilityStoreDuplicateResult, DefaultFuchsiaResourceDialect>

Duplicates the capability with id to dest_id.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • ID_ALREADY_EXISTS if a capability with dest_id already exists in this store.
  • NOT_DUPLICATABLE if id could not be duplicated.
source

pub fn drop( &self, id: u64, ) -> QueryResponseFut<CapabilityStoreDropResult, DefaultFuchsiaResourceDialect>

Drops the capability with id from this [CapabilityStore].

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
source

pub fn export( &self, id: u64, ) -> QueryResponseFut<CapabilityStoreExportResult, DefaultFuchsiaResourceDialect>

Exports the capability with the client-assigned identifier id to capability. This operation removes the capability from the store. If this is not desired, [Duplicate] the capability first.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
source

pub fn import( &self, id: u64, capability: Capability, ) -> QueryResponseFut<CapabilityStoreImportResult, DefaultFuchsiaResourceDialect>

Imports capability into this store with the client-assigned id.

Errors:

  • ID_ALREADY_EXISTS if a capability with id already exists in this store.
  • BAD_CAPABILITY if capability was not a valid Capability.
source

pub fn connector_create( &self, id: u64, receiver: ClientEnd<ReceiverMarker>, ) -> QueryResponseFut<CapabilityStoreConnectorCreateResult, DefaultFuchsiaResourceDialect>

Creates a Connector from a [Receiver]. Incoming connections to the Connector will be dispatched to this [Receiver].

Errors:

  • ID_ALREADY_EXISTS if a capability with id already exists in this store.
source

pub fn connector_open( &self, id: u64, server_end: Channel, ) -> QueryResponseFut<CapabilityStoreConnectorOpenResult, DefaultFuchsiaResourceDialect>

Open a connection from the provided Connector capability that will be dispatched to the [Receiver] on the other end.

If there is an error, it will be reported as a zx.Status epitaph on server_end.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • WRONG_TYPE if id was not a connector capability.
source

pub fn dictionary_create( &self, id: u64, ) -> QueryResponseFut<CapabilityStoreDictionaryCreateResult, DefaultFuchsiaResourceDialect>

Creates a new empty dictionary in this [CapabilityStore] with client-assigned id.

Errors:

  • ID_ALREADY_EXISTS if a capability with id already exists in this store.
source

pub fn dictionary_legacy_import( &self, id: u64, client_end: Channel, ) -> QueryResponseFut<CapabilityStoreDictionaryLegacyImportResult, DefaultFuchsiaResourceDialect>

Imports a dictionary in the form of a channel.

This is a legacy API to support backward compatibility with APIs that take a [Dictionary] channel.

Errors:

  • ID_ALREADY_EXISTS if a capability with id already exists in this store.
  • BAD_CAPABILITY if client_end was not a valid dictionary channel.
source

pub fn dictionary_legacy_export( &self, id: u64, server_end: Channel, ) -> QueryResponseFut<CapabilityStoreDictionaryLegacyExportResult, DefaultFuchsiaResourceDialect>

Binds a channel to the dictionary with id. The channel can be re-imported into a [CapabilityStore] with [DictionaryImportLegacy].

This is a legacy API to support backward compatibility with APIs that take a [Dictionary] channel.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
source

pub fn dictionary_insert( &self, id: u64, item: &DictionaryItem, ) -> QueryResponseFut<CapabilityStoreDictionaryInsertResult, DefaultFuchsiaResourceDialect>

Inserts item into the dictionary with id. item.value is moved into the dictionary and its id is released if this call succeeds.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • WRONG_TYPE if id was not a dictionary.
  • INVALID_KEY if item.key was invalid.
  • ITEM_ALREADY_EXISTS if the dictionary already contains an item with item.key.
source

pub fn dictionary_get( &self, id: u64, key: &str, dest_id: u64, ) -> QueryResponseFut<CapabilityStoreDictionaryGetResult, DefaultFuchsiaResourceDialect>

Get a duplicate of a capability from the dictionary with id, which is loaded into dest_id.

Errors:

  • ID_NOT_FOUND if id was not a recognized capability id in this store.
  • ID_ALREADY_EXISTS if a capability with dest_id already exists in this store.
  • WRONG_TYPE if id was not a dictionary.
  • INVALID_KEY if item.key was invalid.
  • ITEM_NOT_FOUND if the dictionary does not contain key.
  • NOT_DUPLICATABLE if the capability could not be duplicated.
source

pub fn dictionary_remove( &self, id: u64, key: &str, dest_id: Option<&WrappedCapabilityId>, ) -> QueryResponseFut<CapabilityStoreDictionaryRemoveResult, DefaultFuchsiaResourceDialect>

Removes a key from the dictionary with id. If dest_id is present, loads the value into it, otherwise discards the value.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • ID_ALREADY_EXISTS if a capability with dest_id already exists in this store.
  • WRONG_TYPE if id was not a dictionary.
  • INVALID_KEY if key was invalid.
  • ITEM_NOT_FOUND if the dictionary does not contain the key.
source

pub fn dictionary_copy( &self, id: u64, dest_id: u64, ) -> QueryResponseFut<CapabilityStoreDictionaryCopyResult, DefaultFuchsiaResourceDialect>

Create a new dictionary that contains a duplicate of all the entries in the dictionary with id, assigning dest_id to the new dictionary. The runtime of this method is linear in the number of top-level entries in the dictionary.

For example, if the dictionary contains nested dictionaries, the newly created dictionary will contain references to those same nested dictionaries because the entries are duplicated rather than deep-copied.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • ID_ALREADY_EXISTS if a capability with dest_id already exists in this store.
  • WRONG_TYPE if id was not a dictionary.
  • NOT_DUPLICATABLE if one of the capabilities in id could not be duplicated.
source

pub fn dictionary_keys( &self, id: u64, iterator: ServerEnd<DictionaryKeysIteratorMarker>, ) -> QueryResponseFut<CapabilityStoreDictionaryKeysResult, DefaultFuchsiaResourceDialect>

Enumerates the keys in the dictionary with id.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • WRONG_TYPE if id was not a dictionary.
source

pub fn dictionary_enumerate( &self, id: u64, iterator: ServerEnd<DictionaryEnumerateIteratorMarker>, ) -> QueryResponseFut<CapabilityStoreDictionaryEnumerateResult, DefaultFuchsiaResourceDialect>

Enumerates the items (keys and values) in the dictionary with id.

Creates a duplicate of each value (capability). If a value could not be duplicated, the value will be null.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • WRONG_TYPE if id was not a dictionary.
source

pub fn dictionary_drain( &self, id: u64, iterator: Option<ServerEnd<DictionaryDrainIteratorMarker>>, ) -> QueryResponseFut<CapabilityStoreDictionaryDrainResult, DefaultFuchsiaResourceDialect>

Removes all the entries in this dictionary, returning them in contents if provided. If contents is not provided, all the items are discarded without enumerating them.

Errors:

  • ID_NOT_FOUND if id was not a valid capability id in this store.
  • WRONG_TYPE if id was not a dictionary.

Trait Implementations§

source§

impl CapabilityStoreProxyInterface for CapabilityStoreProxy

§

type DuplicateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut

§

type DropResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn drop(&self, id: u64) -> Self::DropResponseFut

§

type ExportResponseFut = QueryResponseFut<Result<Capability, CapabilityStoreError>>

source§

fn export(&self, id: u64) -> Self::ExportResponseFut

§

type ImportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut

§

type ConnectorCreateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn connector_create( &self, id: u64, receiver: ClientEnd<ReceiverMarker>, ) -> Self::ConnectorCreateResponseFut

§

type ConnectorOpenResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn connector_open( &self, id: u64, server_end: Channel, ) -> Self::ConnectorOpenResponseFut

§

type DictionaryCreateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut

§

type DictionaryLegacyImportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_legacy_import( &self, id: u64, client_end: Channel, ) -> Self::DictionaryLegacyImportResponseFut

§

type DictionaryLegacyExportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_legacy_export( &self, id: u64, server_end: Channel, ) -> Self::DictionaryLegacyExportResponseFut

§

type DictionaryInsertResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_insert( &self, id: u64, item: &DictionaryItem, ) -> Self::DictionaryInsertResponseFut

§

type DictionaryGetResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_get( &self, id: u64, key: &str, dest_id: u64, ) -> Self::DictionaryGetResponseFut

§

type DictionaryRemoveResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_remove( &self, id: u64, key: &str, dest_id: Option<&WrappedCapabilityId>, ) -> Self::DictionaryRemoveResponseFut

§

type DictionaryCopyResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_copy( &self, id: u64, dest_id: u64, ) -> Self::DictionaryCopyResponseFut

§

type DictionaryKeysResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_keys( &self, id: u64, iterator: ServerEnd<DictionaryKeysIteratorMarker>, ) -> Self::DictionaryKeysResponseFut

§

type DictionaryEnumerateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_enumerate( &self, id: u64, iterator: ServerEnd<DictionaryEnumerateIteratorMarker>, ) -> Self::DictionaryEnumerateResponseFut

§

type DictionaryDrainResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>

source§

fn dictionary_drain( &self, id: u64, iterator: Option<ServerEnd<DictionaryDrainIteratorMarker>>, ) -> Self::DictionaryDrainResponseFut

source§

impl Clone for CapabilityStoreProxy

source§

fn clone(&self) -> CapabilityStoreProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CapabilityStoreProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Proxy for CapabilityStoreProxy

§

type Protocol = CapabilityStoreMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more