fidl_fuchsia_component_sandbox

Struct CapabilityStoreSynchronousProxy

Source
pub struct CapabilityStoreSynchronousProxy { /* private fields */ }

Implementations§

Source§

impl CapabilityStoreSynchronousProxy

Source

pub fn new(channel: Channel) -> Self

Source

pub fn into_channel(self) -> Channel

Source

pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<CapabilityStoreEvent, Error>

Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.

Source

pub fn duplicate( &self, id: u64, dest_id: u64, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDuplicateResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDropResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreExportResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreImportResult, Error>

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>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreConnectorCreateResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreConnectorOpenResult, Error>

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 dir_connector_create( &self, id: u64, receiver: ClientEnd<DirReceiverMarker>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDirConnectorCreateResult, Error>

Creates a DirConnector from a [DirReceiver]. Incoming connections to the DirConnector will be dispatched to this [DirReceiver].

Errors:

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

pub fn dir_connector_open( &self, id: u64, server_end: ServerEnd<DirectoryMarker>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDirConnectorOpenResult, Error>

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 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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryCreateResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryLegacyImportResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryLegacyExportResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryInsertResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryGetResult, Error>

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>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryRemoveResult, Error>

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, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryCopyResult, Error>

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>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryKeysResult, Error>

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>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryEnumerateResult, Error>

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>>, ___deadline: MonotonicInstant, ) -> Result<CapabilityStoreDictionaryDrainResult, Error>

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 Debug for CapabilityStoreSynchronousProxy

Source§

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

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

impl SynchronousProxy for CapabilityStoreSynchronousProxy

Source§

type Proxy = CapabilityStoreProxy

The async proxy for the same protocol.
Source§

type Protocol = CapabilityStoreMarker

The protocol which this Proxy controls.
Source§

fn from_channel(inner: Channel) -> Self

Create a proxy over the given channel.
Source§

fn into_channel(self) -> Channel

Convert the proxy back into a channel.
Source§

fn as_channel(&self) -> &Channel

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

fn is_closed(&self) -> Result<bool, Status>

Returns true if the proxy has received the PEER_CLOSED signal. Read more

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
§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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