Struct kubos_service::Context [−][src]
pub struct Context<T> { /* fields omitted */ }
Context struct used by a service to provide Juniper context, subsystem access and persistent storage.
Methods
impl<T> Context<T>
[src]
impl<T> Context<T>
ⓘImportant traits for &'a mut Rpub fn subsystem(&self) -> &T
[src]
ⓘImportant traits for &'a mut R
pub fn subsystem(&self) -> &T
Returns a reference to the context's subsystem instance
pub fn get(&self, name: &str) -> String
[src]
pub fn get(&self, name: &str) -> String
pub fn set(&self, key: &str, value: &str)
[src]
pub fn set(&self, key: &str, value: &str)
Sets a value in the context's storage
Arguments
key
- Key to store value under
value
- Value to store
pub fn clear(&self, name: &String)
[src]
pub fn clear(&self, name: &String)
Clears a single key/value from storage
Arguments
key
- Key to clear (along with corresponding value)
pub fn clear_all(&self)
[src]
pub fn clear_all(&self)
Clears all key/value pairs from storage