pub type State = HashMap<String, Value>;Expand description
Graph 共享状态。
Aliased Type§
pub struct State { /* private fields */ }Trait Implementations§
Source§impl StateExt for State
impl StateExt for State
Source§fn get_json<T>(&self, key: &str) -> Result<T, StateError>where
T: DeserializeOwned,
fn get_json<T>(&self, key: &str) -> Result<T, StateError>where
T: DeserializeOwned,
反序列化为强类型。
Source§fn require<T>(&self, key: &str) -> Result<T, StateError>where
T: DeserializeOwned,
fn require<T>(&self, key: &str) -> Result<T, StateError>where
T: DeserializeOwned,
获取并反序列化为强类型。key 不存在时返回错误。