Struct wayland_client::StateProxy
[−]
[src]
pub struct StateProxy<'store> { /* fields omitted */ }
A Proxy representing a Store
with ongoing borrows
This struct represents a handle to a store from which some values are already mutably borrowed, and as such cannot be touched.
See Store::with_value
for detailed explanation of its
use.
Methods
impl<'store> StoreProxy<'store>
[src]
fn insert<V>(&mut self, value: V) -> Token<V> where
V: 'static + Any,
[src]
V: 'static + Any,
Insert a new value in the proxified store
Returns a clonable token that you can later use to access this value.
fn get<V>(&self, token: &Token<V>) -> &V where
V: 'static + Any,
[src]
V: 'static + Any,
Access value previously inserted in the proxified store
Panics if the provided token corresponds to a value that was removed, or if this value is already borrowed.
fn get_mut<V>(&mut self, token: &Token<V>) -> &mut V where
V: 'static + Any,
[src]
V: 'static + Any,
Mutably access value previously inserted in the proxified store
Panics if the provided token corresponds to a value that was removed, or if this value is already borrowed.
fn remove<V>(&mut self, token: Token<V>) -> V where
V: 'static + Any,
[src]
V: 'static + Any,
Remove a value previously inserted in the proxified store
Panics if the provided token corresponds to a value that was already removed, or if this value is already borrowed.
fn with_value<V, T, F>(&mut self, token: &Token<V>, f: F) -> T where
F: FnOnce(&mut StoreProxy, &mut V) -> T,
V: 'static + Any,
[src]
F: FnOnce(&mut StoreProxy, &mut V) -> T,
V: 'static + Any,
Create a sub-scope with access to a value
Panics if the provided token corresponds to a value that was removed, or if this value is already borrowed.
See Store::with_value
for full documentation.
Trait Implementations
impl<'a> From<&'a mut Store> for StoreProxy<'a>
[src]
fn from(store: &'a mut Store) -> StoreProxy<'a>
[src]
impl<'a, 'b> From<&'a mut StoreProxy<'b>> for StoreProxy<'a> where
'b: 'a,
[src]
'b: 'a,