pub struct DictionaryProxy { /* private fields */ }
Implementations§
source§impl DictionaryProxy
impl DictionaryProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.component.sandbox/Dictionary.
sourcepub fn take_event_stream(&self) -> DictionaryEventStream
pub fn take_event_stream(&self) -> DictionaryEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
sourcepub fn insert(
&self,
key: &str,
value: Capability
) -> QueryResponseFut<DictionaryInsertResult>
pub fn insert( &self, key: &str, value: Capability ) -> QueryResponseFut<DictionaryInsertResult>
Inserts a key-value pair into the dictionary.
- error
DictionaryError.ALREADY_EXISTS
if the dictionary already contains an item with the same key.
sourcepub fn get(&self, key: &str) -> QueryResponseFut<DictionaryGetResult>
pub fn get(&self, key: &str) -> QueryResponseFut<DictionaryGetResult>
Get a clone of a capability from this dictionary.
- error
DictionaryError.NOT_FOUND
if the dictionary does not contain the key.
sourcepub fn remove(&self, key: &str) -> QueryResponseFut<DictionaryRemoveResult>
pub fn remove(&self, key: &str) -> QueryResponseFut<DictionaryRemoveResult>
Removes a key from the dictionary, returning the Capability
value.
- error
DictionaryError.NOT_FOUND
if the dictionary does not contain the key.
sourcepub fn read(&self) -> QueryResponseFut<Vec<DictionaryItem>>
pub fn read(&self) -> QueryResponseFut<Vec<DictionaryItem>>
Returns all items in this dictionary, sorted by key in natural order.
This operation creates shallow clones of values.
sourcepub fn clone(&self) -> QueryResponseFut<ClientEnd<DictionaryMarker>>
pub fn clone(&self) -> QueryResponseFut<ClientEnd<DictionaryMarker>>
Creates a new connection to the same underlying dictionary.
Use Copy
to a new dictionary with clones of all the exiting entries.
sourcepub fn copy(&self) -> QueryResponseFut<ClientEnd<DictionaryMarker>>
pub fn copy(&self) -> QueryResponseFut<ClientEnd<DictionaryMarker>>
Create a new dictionary that contains a clone of all the entries in this dictionary.
For example, if this dictionary contains nested dictionaries, the newly created dictionary will contain references to those same nested dictionaries because the entries are cloned rather than copied.
sourcepub fn enumerate(
&self,
contents: ServerEnd<DictionaryIteratorMarker>
) -> Result<(), Error>
pub fn enumerate( &self, contents: ServerEnd<DictionaryIteratorMarker> ) -> Result<(), Error>
Enumerates the entries in this dictionary.
Creates a clone of each item during enumeration.
Trait Implementations§
source§impl Clone for DictionaryProxy
impl Clone for DictionaryProxy
source§fn clone(&self) -> DictionaryProxy
fn clone(&self) -> DictionaryProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DictionaryProxy
impl Debug for DictionaryProxy
source§impl DictionaryProxyInterface for DictionaryProxy
impl DictionaryProxyInterface for DictionaryProxy
type InsertResponseFut = QueryResponseFut<Result<(), DictionaryError>>
fn insert(&self, key: &str, value: Capability) -> Self::InsertResponseFut
type GetResponseFut = QueryResponseFut<Result<Capability, DictionaryError>>
fn get(&self, key: &str) -> Self::GetResponseFut
type RemoveResponseFut = QueryResponseFut<Result<Capability, DictionaryError>>
fn remove(&self, key: &str) -> Self::RemoveResponseFut
type ReadResponseFut = QueryResponseFut<Vec<DictionaryItem>>
fn read(&self) -> Self::ReadResponseFut
type CloneResponseFut = QueryResponseFut<ClientEnd<DictionaryMarker>>
fn clone(&self) -> Self::CloneResponseFut
type CopyResponseFut = QueryResponseFut<ClientEnd<DictionaryMarker>>
fn copy(&self) -> Self::CopyResponseFut
fn enumerate( &self, contents: ServerEnd<DictionaryIteratorMarker> ) -> Result<(), Error>
fn drain( &self, contents: Option<ServerEnd<DictionaryIteratorMarker>> ) -> Result<(), Error>
source§impl Proxy for DictionaryProxy
impl Proxy for DictionaryProxy
§type Protocol = DictionaryMarker
type Protocol = DictionaryMarker
Proxy
controls.