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§
Sourcefn duplicate(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, Duplicate>,
responder: Responder<Duplicate>,
)
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
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.
Sourcefn drop(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, Drop>,
responder: Responder<Drop>,
)
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
ifid
was not a valid capability id in this store.
Sourcefn export(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, Export>,
responder: Responder<Export>,
)
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
ifid
was not a valid capability id in this store.
Sourcefn import(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, Import>,
responder: Responder<Import>,
)
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 withid
already exists in this store.BAD_CAPABILITY
ifcapability
was not a valid Capability.
Sourcefn connector_create(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, ConnectorCreate>,
responder: Responder<ConnectorCreate>,
)
fn connector_create( &mut self, sender: &ServerSender<___T, CapabilityStore>, request: RequestBuffer<___T, ConnectorCreate>, responder: Responder<ConnectorCreate>, )
Sourcefn connector_open(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, ConnectorOpen>,
responder: Responder<ConnectorOpen>,
)
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a connector capability.
Sourcefn dir_connector_create(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DirConnectorCreate>,
responder: Responder<DirConnectorCreate>,
)
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 withid
already exists in this store.
Sourcefn dir_connector_open(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DirConnectorOpen>,
responder: Responder<DirConnectorOpen>,
)
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a connector capability.
Sourcefn dictionary_create(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryCreate>,
responder: Responder<DictionaryCreate>,
)
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 withid
already exists in this store.
Sourcefn dictionary_legacy_import(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryLegacyImport>,
responder: Responder<DictionaryLegacyImport>,
)
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 withid
already exists in this store.BAD_CAPABILITY
ifclient_end
was not a valid dictionary channel.
Sourcefn dictionary_legacy_export(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryLegacyExport>,
responder: Responder<DictionaryLegacyExport>,
)
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
ifid
was not a valid capability id in this store.
Sourcefn dictionary_insert(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryInsert>,
responder: Responder<DictionaryInsert>,
)
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
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
.
Sourcefn dictionary_get(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryGet>,
responder: Responder<DictionaryGet>,
)
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
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.
Sourcefn dictionary_remove(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryRemove>,
responder: Responder<DictionaryRemove>,
)
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
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.
Sourcefn dictionary_copy(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryCopy>,
responder: Responder<DictionaryCopy>,
)
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
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.
Sourcefn dictionary_keys(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryKeys>,
responder: Responder<DictionaryKeys>,
)
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.
Sourcefn dictionary_enumerate(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryEnumerate>,
responder: Responder<DictionaryEnumerate>,
)
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.
Sourcefn dictionary_drain(
&mut self,
sender: &ServerSender<___T, CapabilityStore>,
request: RequestBuffer<___T, DictionaryDrain>,
responder: Responder<DictionaryDrain>,
)
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
ifid
was not a valid capability id in this store.WRONG_TYPE
ifid
was not a dictionary.