pub struct StateStore { /* private fields */ }Expand description
State store for multiple params
Implementations§
Source§impl StateStore
impl StateStore
pub fn new() -> Self
Sourcepub fn get(&self, address: &str) -> Option<&ParamState>
pub fn get(&self, address: &str) -> Option<&ParamState>
Get a param’s current state
Sourcepub fn set(
&mut self,
address: &str,
value: Value,
writer: &str,
revision: Option<u64>,
lock: bool,
unlock: bool,
) -> Result<u64, UpdateError>
pub fn set( &mut self, address: &str, value: Value, writer: &str, revision: Option<u64>, lock: bool, unlock: bool, ) -> Result<u64, UpdateError>
Set a param value, creating if necessary
Sourcepub fn get_matching(&self, pattern: &str) -> Vec<(&str, &ParamState)>
pub fn get_matching(&self, pattern: &str) -> Vec<(&str, &ParamState)>
Get all params matching a pattern
Sourcepub fn snapshot(&self) -> Vec<(&str, &ParamState)>
pub fn snapshot(&self) -> Vec<(&str, &ParamState)>
Get all params as a snapshot
Sourcepub fn remove(&mut self, address: &str) -> Option<ParamState>
pub fn remove(&mut self, address: &str) -> Option<ParamState>
Remove a param
Trait Implementations§
Source§impl Debug for StateStore
impl Debug for StateStore
Source§impl Default for StateStore
impl Default for StateStore
Source§fn default() -> StateStore
fn default() -> StateStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StateStore
impl RefUnwindSafe for StateStore
impl Send for StateStore
impl Sync for StateStore
impl Unpin for StateStore
impl UnwindSafe for StateStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more