Trait CapabilityStoreServerHandler

Source
pub trait CapabilityStoreServerHandler<___T: Transport> {
Show 19 methods // Required methods fn duplicate( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Duplicate>, responder: Responder<Duplicate>, ); fn drop( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Drop>, responder: Responder<Drop>, ); fn export( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Export>, responder: Responder<Export>, ); fn import( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Import>, responder: Responder<Import>, ); fn connector_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, ConnectorCreate>, responder: Responder<ConnectorCreate>, ); fn connector_open( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, ConnectorOpen>, responder: Responder<ConnectorOpen>, ); fn dir_connector_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DirConnectorCreate>, responder: Responder<DirConnectorCreate>, ); fn dir_connector_open( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DirConnectorOpen>, responder: Responder<DirConnectorOpen>, ); fn dictionary_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryCreate>, responder: Responder<DictionaryCreate>, ); fn dictionary_legacy_import( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryLegacyImport>, responder: Responder<DictionaryLegacyImport>, ); fn dictionary_legacy_export( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryLegacyExport>, responder: Responder<DictionaryLegacyExport>, ); fn dictionary_insert( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryInsert>, responder: Responder<DictionaryInsert>, ); fn dictionary_get( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryGet>, responder: Responder<DictionaryGet>, ); fn dictionary_remove( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryRemove>, responder: Responder<DictionaryRemove>, ); fn dictionary_copy( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryCopy>, responder: Responder<DictionaryCopy>, ); fn dictionary_keys( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryKeys>, responder: Responder<DictionaryKeys>, ); fn dictionary_enumerate( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryEnumerate>, responder: Responder<DictionaryEnumerate>, ); fn dictionary_drain( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryDrain>, responder: Responder<DictionaryDrain>, ); // Provided method fn on_unknown_interaction( &mut self, sender: &ServerSender<___T, CapabilityStore>, ordinal: u64, ) { ... }
}
Expand description

A server handler for the CapabilityStore protocol.

See CapabilityStore for more details.

Required Methods§

Source

fn duplicate( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Duplicate>, responder: Responder<Duplicate>, )

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

fn drop( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Drop>, responder: Responder<Drop>, )

Drops the capability with id from this CapabilityStore.

Errors:

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

fn export( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Export>, responder: Responder<Export>, )

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

fn import( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, Import>, responder: Responder<Import>, )

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

fn connector_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, ConnectorCreate>, responder: Responder<ConnectorCreate>, )

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

fn connector_open( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, ConnectorOpen>, responder: Responder<ConnectorOpen>, )

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

fn dir_connector_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DirConnectorCreate>, responder: Responder<DirConnectorCreate>, )

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

fn dir_connector_open( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DirConnectorOpen>, responder: Responder<DirConnectorOpen>, )

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

fn dictionary_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryCreate>, responder: Responder<DictionaryCreate>, )

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

fn dictionary_legacy_import( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryLegacyImport>, responder: Responder<DictionaryLegacyImport>, )

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

fn dictionary_legacy_export( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryLegacyExport>, responder: Responder<DictionaryLegacyExport>, )

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

fn dictionary_insert( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryInsert>, responder: Responder<DictionaryInsert>, )

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

fn dictionary_get( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryGet>, responder: Responder<DictionaryGet>, )

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

fn dictionary_remove( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryRemove>, responder: Responder<DictionaryRemove>, )

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

fn dictionary_copy( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryCopy>, responder: Responder<DictionaryCopy>, )

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

fn dictionary_keys( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryKeys>, responder: Responder<DictionaryKeys>, )

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

fn dictionary_enumerate( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryEnumerate>, responder: Responder<DictionaryEnumerate>, )

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

fn dictionary_drain( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, DictionaryDrain>, responder: Responder<DictionaryDrain>, )

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.

Provided Methods§

Source

fn on_unknown_interaction( &mut self, sender: &ServerSender<___T, CapabilityStore>, ordinal: u64, )

Implementors§