Skip to main content

StateKeyExt

Trait StateKeyExt 

Source
pub trait StateKeyExt {
    // Required methods
    fn set_sk<T>(&mut self, key: &StateKey<T>, value: T)
       where T: Serialize;
    fn get_sk<T>(&self, key: &StateKey<T>) -> Option<T>
       where T: DeserializeOwned;
    fn require_sk<T>(&self, key: &StateKey<T>) -> Result<T, StateError>
       where T: DeserializeOwned;
    fn contains_sk<T>(&self, key: &StateKey<T>) -> bool;
    fn remove_sk<T>(&mut self, key: &StateKey<T>) -> Option<Value>;
}
Expand description

StateKey 专用的 State 扩展方法。

Required Methods§

Source

fn set_sk<T>(&mut self, key: &StateKey<T>, value: T)
where T: Serialize,

Source

fn get_sk<T>(&self, key: &StateKey<T>) -> Option<T>

Source

fn require_sk<T>(&self, key: &StateKey<T>) -> Result<T, StateError>

Source

fn contains_sk<T>(&self, key: &StateKey<T>) -> bool

Source

fn remove_sk<T>(&mut self, key: &StateKey<T>) -> Option<Value>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§