CapabilitiesProxy

Struct CapabilitiesProxy 

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

Implementations§

Source§

impl CapabilitiesProxy

Source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.component.runtime/Capabilities.

Source

pub fn take_event_stream(&self) -> CapabilitiesEventStream

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

§Panics

Panics if the event stream was already taken.

Source

pub fn connector_create( &self, connector: EventPair, receiver_client_end: ClientEnd<ReceiverMarker>, ) -> QueryResponseFut<CapabilitiesConnectorCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new connector capability. When the connector is opened, the channel given to the open call will be sent over receiver_client_end.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn dir_connector_create( &self, dir_connector: EventPair, receiver_client_end: ClientEnd<DirReceiverMarker>, ) -> QueryResponseFut<CapabilitiesDirConnectorCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new directory connector capability. When the directory connector is opened, the channel given to the open call will be sent over receiver_client_end.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn dictionary_create( &self, dictionary: EventPair, ) -> QueryResponseFut<CapabilitiesDictionaryCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new dictionary capability.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn data_create( &self, data_handle: EventPair, data: &Data, ) -> QueryResponseFut<CapabilitiesDataCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new data capability with the given value.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn connector_router_create( &self, router: EventPair, router_client_end: ClientEnd<ConnectorRouterMarker>, ) -> QueryResponseFut<CapabilitiesConnectorRouterCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new router capability that will return a connector capability when used.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn dir_connector_router_create( &self, router: EventPair, router_client_end: ClientEnd<DirConnectorRouterMarker>, ) -> QueryResponseFut<CapabilitiesDirConnectorRouterCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new router capability that will return a directory connector capability when used.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn dictionary_router_create( &self, router: EventPair, router_client_end: ClientEnd<DictionaryRouterMarker>, ) -> QueryResponseFut<CapabilitiesDictionaryRouterCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new router capability that will return a dictionary capability when used.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn data_router_create( &self, router: EventPair, router_client_end: ClientEnd<DataRouterMarker>, ) -> QueryResponseFut<CapabilitiesDataRouterCreateResult, DefaultFuchsiaResourceDialect>

Creates a reference to a new router capability that will return a data value when used.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn connector_open( &self, connector: EventPair, channel: Channel, ) -> QueryResponseFut<CapabilitiesConnectorOpenResult, DefaultFuchsiaResourceDialect>

Uses the provided connector to open a new connection by delivering this channel to whoever created the connector.

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

If the connector event pair handle is not correlated with a handle given to ConnectorCreate, this connection will be closed.

Source

pub fn dir_connector_open( &self, payload: CapabilitiesDirConnectorOpenRequest, ) -> QueryResponseFut<CapabilitiesDirConnectorOpenResult, DefaultFuchsiaResourceDialect>

Uses the provided dir_connector to open a new directory connection by delivering this channel to whoever created the directory connector.

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

If the dir_connector event pair handle is not correlated with a handle given to DirConnectorCreate, this connection will be closed.

dir_connector and channel are both required. rights and subdir may be omitted.

Source

pub fn dictionary_insert( &self, dictionary: EventPair, key: &str, value: EventPair, ) -> QueryResponseFut<CapabilitiesDictionaryInsertResult, DefaultFuchsiaResourceDialect>

Inserts a new capability into this Dictionary under the name key. Overwrites any existing entry.

Source

pub fn dictionary_get( &self, dictionary: EventPair, key: &str, value: EventPair, ) -> QueryResponseFut<CapabilitiesDictionaryGetResult, DefaultFuchsiaResourceDialect>

Creates a new reference to the capability named key in this dictionary, if that capability exists. That capability will remain in the dictionary. To take a capability out of the dictionary, use DictionaryRemove.

If key does not exist, value will not reference any capability and the NO_SUCH_CAPABILITY error value will be returned.

Make sure this method returns before passing the handle’s peer to other methods in this API. The creation may not be complete before then.

Source

pub fn dictionary_remove( &self, payload: CapabilitiesDictionaryRemoveRequest, ) -> QueryResponseFut<CapabilitiesDictionaryRemoveResult, DefaultFuchsiaResourceDialect>

Removes the capability named key from this dictionary and returns a reference to it, if that capability exists.

dictionary and key are required. capability is optional, and when set will become associated with the capability that was removed from the dictionary.

If key does not exist, value will not reference any capability and the NO_SUCH_CAPABILITY error value will be returned.

Make sure this method returns before passing the peer of capability to other methods in this API. The creation may not be complete before then.

Source

pub fn dictionary_iterate_keys( &self, dictionary: EventPair, key_iterator: ServerEnd<DictionaryKeyIteratorMarker>, ) -> QueryResponseFut<CapabilitiesDictionaryIterateKeysResult, DefaultFuchsiaResourceDialect>

Opens an iterator which can be used to iterate over the keys of this dictionary.

Source

pub fn data_get( &self, data_handle: EventPair, ) -> QueryResponseFut<CapabilitiesDataGetResult, DefaultFuchsiaResourceDialect>

Returns the Data value that was provided to the DataCreate call used with data_handle.

Source

pub fn connector_router_route( &self, router: EventPair, request: RouteRequest, connector: EventPair, ) -> QueryResponseFut<CapabilitiesConnectorRouterRouteResult, DefaultFuchsiaResourceDialect>

Attempts to produce a Connector capability from this ConnectorRouter.

Make sure this method returns before passing the peer of capability to other methods in this API. The creation may not be complete before then.

Source

pub fn dir_connector_router_route( &self, router: EventPair, request: RouteRequest, dir_connector: EventPair, ) -> QueryResponseFut<CapabilitiesDirConnectorRouterRouteResult, DefaultFuchsiaResourceDialect>

Attempts to produce a DirConnector capability from this DirConnectorRouter. This will return:

  • A DirConnector if the operation is successful.
  • An empty value if there is no issue found but the capability is not being provided (for example, an optional route ended in an offer from void).
  • An error, if the operation failed.
Source

pub fn dictionary_router_route( &self, router: EventPair, request: RouteRequest, dictionary: EventPair, ) -> QueryResponseFut<CapabilitiesDictionaryRouterRouteResult, DefaultFuchsiaResourceDialect>

Attempts to produce a Dictionary capability from this DictionaryRouter. This will return:

  • A Dictionary if the operation is successful.
  • An empty value if there is no issue found but the capability is not being provided (for example, an optional route ended in an offer from void).
  • An error, if the operation failed.
Source

pub fn data_router_route( &self, router: EventPair, request: RouteRequest, data_handle: i32, ) -> QueryResponseFut<CapabilitiesDataRouterRouteResult, DefaultFuchsiaResourceDialect>

Attempts to produce a Data value from this DataRouter. This will return:

  • A Data value if the operation is successful.
  • An empty value if there is no issue found but the capability is not being provided (for example, an optional route ended in an offer from void).
  • An error, if the operation failed.

Trait Implementations§

Source§

impl CapabilitiesProxyInterface for CapabilitiesProxy

Source§

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

Source§

type DirConnectorCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

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

Source§

type DataCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

type ConnectorRouterCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

type DirConnectorRouterCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

type DictionaryRouterCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

type DataRouterCreateResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

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

Source§

type DirConnectorOpenResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

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

Source§

type DictionaryGetResponseFut = QueryResponseFut<Result<CapabilityType, CapabilitiesError>>

Source§

type DictionaryRemoveResponseFut = QueryResponseFut<Result<CapabilityType, CapabilitiesError>>

Source§

type DictionaryIterateKeysResponseFut = QueryResponseFut<Result<(), CapabilitiesError>>

Source§

type DataGetResponseFut = QueryResponseFut<Result<Data, CapabilitiesError>>

Source§

type ConnectorRouterRouteResponseFut = QueryResponseFut<Result<(), i32>>

Source§

type DirConnectorRouterRouteResponseFut = QueryResponseFut<Result<(), i32>>

Source§

type DictionaryRouterRouteResponseFut = QueryResponseFut<Result<(), i32>>

Source§

type DataRouterRouteResponseFut = QueryResponseFut<Result<(), i32>>

Source§

fn connector_create( &self, connector: EventPair, receiver_client_end: ClientEnd<ReceiverMarker>, ) -> Self::ConnectorCreateResponseFut

Source§

fn dir_connector_create( &self, dir_connector: EventPair, receiver_client_end: ClientEnd<DirReceiverMarker>, ) -> Self::DirConnectorCreateResponseFut

Source§

fn dictionary_create( &self, dictionary: EventPair, ) -> Self::DictionaryCreateResponseFut

Source§

fn data_create( &self, data_handle: EventPair, data: &Data, ) -> Self::DataCreateResponseFut

Source§

fn connector_router_create( &self, router: EventPair, router_client_end: ClientEnd<ConnectorRouterMarker>, ) -> Self::ConnectorRouterCreateResponseFut

Source§

fn dir_connector_router_create( &self, router: EventPair, router_client_end: ClientEnd<DirConnectorRouterMarker>, ) -> Self::DirConnectorRouterCreateResponseFut

Source§

fn dictionary_router_create( &self, router: EventPair, router_client_end: ClientEnd<DictionaryRouterMarker>, ) -> Self::DictionaryRouterCreateResponseFut

Source§

fn data_router_create( &self, router: EventPair, router_client_end: ClientEnd<DataRouterMarker>, ) -> Self::DataRouterCreateResponseFut

Source§

fn connector_open( &self, connector: EventPair, channel: Channel, ) -> Self::ConnectorOpenResponseFut

Source§

fn dir_connector_open( &self, payload: CapabilitiesDirConnectorOpenRequest, ) -> Self::DirConnectorOpenResponseFut

Source§

fn dictionary_insert( &self, dictionary: EventPair, key: &str, value: EventPair, ) -> Self::DictionaryInsertResponseFut

Source§

fn dictionary_get( &self, dictionary: EventPair, key: &str, value: EventPair, ) -> Self::DictionaryGetResponseFut

Source§

fn dictionary_remove( &self, payload: CapabilitiesDictionaryRemoveRequest, ) -> Self::DictionaryRemoveResponseFut

Source§

fn dictionary_iterate_keys( &self, dictionary: EventPair, key_iterator: ServerEnd<DictionaryKeyIteratorMarker>, ) -> Self::DictionaryIterateKeysResponseFut

Source§

fn data_get(&self, data_handle: EventPair) -> Self::DataGetResponseFut

Source§

fn connector_router_route( &self, router: EventPair, request: RouteRequest, connector: EventPair, ) -> Self::ConnectorRouterRouteResponseFut

Source§

fn dir_connector_router_route( &self, router: EventPair, request: RouteRequest, dir_connector: EventPair, ) -> Self::DirConnectorRouterRouteResponseFut

Source§

fn dictionary_router_route( &self, router: EventPair, request: RouteRequest, dictionary: EventPair, ) -> Self::DictionaryRouterRouteResponseFut

Source§

fn data_router_route( &self, router: EventPair, request: RouteRequest, data_handle: i32, ) -> Self::DataRouterRouteResponseFut

Source§

impl Clone for CapabilitiesProxy

Source§

fn clone(&self) -> CapabilitiesProxy

Returns a duplicate 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 CapabilitiesProxy

Source§

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

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

impl Proxy for CapabilitiesProxy

Source§

type Protocol = CapabilitiesMarker

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

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

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

fn is_closed(&self) -> bool

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

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

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

Source§

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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

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.

Source§

impl<T> FromClient for T
where T: Proxy,

Source§

type Protocol = <T as Proxy>::Protocol

The protocol.
Source§

fn from_client(value: ClientEnd<<T as FromClient>::Protocol>) -> T

Converts from a client.
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> ProxyHasDomain for T
where T: Proxy,

Source§

fn domain(&self) -> ZirconClient

Get a “client” for this proxy. This is just an object which has methods for a few common handle creation operations.
Source§

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

Source§

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

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.