pub struct CapabilityStoreProxy { /* private fields */ }
Implementations§
source§impl CapabilityStoreProxy
impl CapabilityStoreProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.component.sandbox/CapabilityStore.
sourcepub fn take_event_stream(&self) -> CapabilityStoreEventStream
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.
sourcepub fn duplicate(
&self,
id: u64,
dest_id: u64,
) -> QueryResponseFut<CapabilityStoreDuplicateResult, DefaultFuchsiaResourceDialect>
pub fn duplicate( &self, id: u64, dest_id: u64, ) -> QueryResponseFut<CapabilityStoreDuplicateResult, DefaultFuchsiaResourceDialect>
Duplicates the capability with id
to dest_id
.
Errors:
ID_NOT_FOUND
ifid
was not a valid capability id in this store.ID_ALREADY_EXISTS
if a capability withdest_id
already exists in this store.NOT_DUPLICATABLE
ifid
could not be duplicated.
sourcepub fn drop(
&self,
id: u64,
) -> QueryResponseFut<CapabilityStoreDropResult, DefaultFuchsiaResourceDialect>
pub fn drop( &self, id: u64, ) -> QueryResponseFut<CapabilityStoreDropResult, DefaultFuchsiaResourceDialect>
Drops the capability with id
from this [CapabilityStore
].
Errors:
ID_NOT_FOUND
ifid
was not a valid capability id in this store.
sourcepub fn export(
&self,
id: u64,
) -> QueryResponseFut<CapabilityStoreExportResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.
sourcepub fn import(
&self,
id: u64,
capability: Capability,
) -> QueryResponseFut<CapabilityStoreImportResult, DefaultFuchsiaResourceDialect>
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 withid
already exists in this store.BAD_CAPABILITY
ifcapability
was not a valid Capability.
sourcepub fn connector_create(
&self,
id: u64,
receiver: ClientEnd<ReceiverMarker>,
) -> QueryResponseFut<CapabilityStoreConnectorCreateResult, DefaultFuchsiaResourceDialect>
pub fn connector_create( &self, id: u64, receiver: ClientEnd<ReceiverMarker>, ) -> QueryResponseFut<CapabilityStoreConnectorCreateResult, DefaultFuchsiaResourceDialect>
sourcepub fn connector_open(
&self,
id: u64,
server_end: Channel,
) -> QueryResponseFut<CapabilityStoreConnectorOpenResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a connector capability.
sourcepub fn dir_connector_create(
&self,
id: u64,
receiver: ClientEnd<DirReceiverMarker>,
) -> QueryResponseFut<CapabilityStoreDirConnectorCreateResult, DefaultFuchsiaResourceDialect>
pub fn dir_connector_create( &self, id: u64, receiver: ClientEnd<DirReceiverMarker>, ) -> QueryResponseFut<CapabilityStoreDirConnectorCreateResult, DefaultFuchsiaResourceDialect>
Creates a DirConnector from a [DirReceiver]. Incoming connections to the DirConnector will be dispatched to this [DirReceiver].
Errors:
ID_ALREADY_EXISTS
if a capability withid
already exists in this store.
sourcepub fn dir_connector_open(
&self,
id: u64,
server_end: ServerEnd<DirectoryMarker>,
) -> QueryResponseFut<CapabilityStoreDirConnectorOpenResult, DefaultFuchsiaResourceDialect>
pub fn dir_connector_open( &self, id: u64, server_end: ServerEnd<DirectoryMarker>, ) -> QueryResponseFut<CapabilityStoreDirConnectorOpenResult, DefaultFuchsiaResourceDialect>
Open a connection from the provided DirConnector capability that will be dispatched to the [DirReceiver] on the other end.
This method does not take Open
/Open3
parameters such as flags
or path
.
Clients that wish to specify these can get an initial connection from this method
and call fuchsia.io/Directory.Open
on it. See the [DirReceiver] documentation for
more information about the expectations of the server side.
If there was an error making the connection, it will be reported as a zx.Status
epitaph on server_end
.
Errors:
ID_NOT_FOUND
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a connector capability.
sourcepub fn dictionary_create(
&self,
id: u64,
) -> QueryResponseFut<CapabilityStoreDictionaryCreateResult, DefaultFuchsiaResourceDialect>
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 withid
already exists in this store.
sourcepub fn dictionary_legacy_import(
&self,
id: u64,
client_end: Channel,
) -> QueryResponseFut<CapabilityStoreDictionaryLegacyImportResult, DefaultFuchsiaResourceDialect>
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 withid
already exists in this store.BAD_CAPABILITY
ifclient_end
was not a valid dictionary channel.
sourcepub fn dictionary_legacy_export(
&self,
id: u64,
server_end: Channel,
) -> QueryResponseFut<CapabilityStoreDictionaryLegacyExportResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.
sourcepub fn dictionary_insert(
&self,
id: u64,
item: &DictionaryItem,
) -> QueryResponseFut<CapabilityStoreDictionaryInsertResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.INVALID_KEY
ifitem.key
was invalid.ITEM_ALREADY_EXISTS
if the dictionary already contains an item withitem.key
.
sourcepub fn dictionary_get(
&self,
id: u64,
key: &str,
dest_id: u64,
) -> QueryResponseFut<CapabilityStoreDictionaryGetResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a recognized capability id in this store.ID_ALREADY_EXISTS
if a capability withdest_id
already exists in this store.WRONG_TYPE
ifid
was not a dictionary.INVALID_KEY
ifitem.key
was invalid.ITEM_NOT_FOUND
if the dictionary does not containkey
.NOT_DUPLICATABLE
if the capability could not be duplicated.
sourcepub fn dictionary_remove(
&self,
id: u64,
key: &str,
dest_id: Option<&WrappedCapabilityId>,
) -> QueryResponseFut<CapabilityStoreDictionaryRemoveResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.ID_ALREADY_EXISTS
if a capability withdest_id
already exists in this store.WRONG_TYPE
ifid
was not a dictionary.INVALID_KEY
ifkey
was invalid.ITEM_NOT_FOUND
if the dictionary does not contain the key.
sourcepub fn dictionary_copy(
&self,
id: u64,
dest_id: u64,
) -> QueryResponseFut<CapabilityStoreDictionaryCopyResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.ID_ALREADY_EXISTS
if a capability withdest_id
already exists in this store.WRONG_TYPE
ifid
was not a dictionary.NOT_DUPLICATABLE
if one of the capabilities inid
could not be duplicated.
sourcepub fn dictionary_keys(
&self,
id: u64,
iterator: ServerEnd<DictionaryKeysIteratorMarker>,
) -> QueryResponseFut<CapabilityStoreDictionaryKeysResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.
sourcepub fn dictionary_enumerate(
&self,
id: u64,
iterator: ServerEnd<DictionaryEnumerateIteratorMarker>,
) -> QueryResponseFut<CapabilityStoreDictionaryEnumerateResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.
sourcepub fn dictionary_drain(
&self,
id: u64,
iterator: Option<ServerEnd<DictionaryDrainIteratorMarker>>,
) -> QueryResponseFut<CapabilityStoreDictionaryDrainResult, DefaultFuchsiaResourceDialect>
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.
Trait Implementations§
source§impl CapabilityStoreProxyInterface for CapabilityStoreProxy
impl CapabilityStoreProxyInterface for CapabilityStoreProxy
type DuplicateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut
type DropResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn drop(&self, id: u64) -> Self::DropResponseFut
type ExportResponseFut = QueryResponseFut<Result<Capability, CapabilityStoreError>>
fn export(&self, id: u64) -> Self::ExportResponseFut
type ImportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut
type ConnectorCreateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn connector_create( &self, id: u64, receiver: ClientEnd<ReceiverMarker>, ) -> Self::ConnectorCreateResponseFut
type ConnectorOpenResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn connector_open( &self, id: u64, server_end: Channel, ) -> Self::ConnectorOpenResponseFut
type DirConnectorCreateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dir_connector_create( &self, id: u64, receiver: ClientEnd<DirReceiverMarker>, ) -> Self::DirConnectorCreateResponseFut
type DirConnectorOpenResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dir_connector_open( &self, id: u64, server_end: ServerEnd<DirectoryMarker>, ) -> Self::DirConnectorOpenResponseFut
type DictionaryCreateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut
type DictionaryLegacyImportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_legacy_import( &self, id: u64, client_end: Channel, ) -> Self::DictionaryLegacyImportResponseFut
type DictionaryLegacyExportResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_legacy_export( &self, id: u64, server_end: Channel, ) -> Self::DictionaryLegacyExportResponseFut
type DictionaryInsertResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_insert( &self, id: u64, item: &DictionaryItem, ) -> Self::DictionaryInsertResponseFut
type DictionaryGetResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_get( &self, id: u64, key: &str, dest_id: u64, ) -> Self::DictionaryGetResponseFut
type DictionaryRemoveResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_remove( &self, id: u64, key: &str, dest_id: Option<&WrappedCapabilityId>, ) -> Self::DictionaryRemoveResponseFut
type DictionaryCopyResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_copy( &self, id: u64, dest_id: u64, ) -> Self::DictionaryCopyResponseFut
type DictionaryKeysResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_keys( &self, id: u64, iterator: ServerEnd<DictionaryKeysIteratorMarker>, ) -> Self::DictionaryKeysResponseFut
type DictionaryEnumerateResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_enumerate( &self, id: u64, iterator: ServerEnd<DictionaryEnumerateIteratorMarker>, ) -> Self::DictionaryEnumerateResponseFut
type DictionaryDrainResponseFut = QueryResponseFut<Result<(), CapabilityStoreError>>
fn dictionary_drain( &self, id: u64, iterator: Option<ServerEnd<DictionaryDrainIteratorMarker>>, ) -> Self::DictionaryDrainResponseFut
source§impl Clone for CapabilityStoreProxy
impl Clone for CapabilityStoreProxy
source§fn clone(&self) -> CapabilityStoreProxy
fn clone(&self) -> CapabilityStoreProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CapabilityStoreProxy
impl Debug for CapabilityStoreProxy
source§impl Proxy for CapabilityStoreProxy
impl Proxy for CapabilityStoreProxy
§type Protocol = CapabilityStoreMarker
type Protocol = CapabilityStoreMarker
Proxy
controls.source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for CapabilityStoreProxy
impl !RefUnwindSafe for CapabilityStoreProxy
impl Send for CapabilityStoreProxy
impl Sync for CapabilityStoreProxy
impl Unpin for CapabilityStoreProxy
impl !UnwindSafe for CapabilityStoreProxy
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)