pub fn put_state<T: Serialize>(state: &mut HashMap<String, Value>, key: &str, value: T) {
	state.insert(
		key.to_string(),
		serde_json::to_value(value).expect("Failed to serialize"),
	);
}
/// Puts a state struct into the state hashmap.
Puts a state struct into the state hashmap.
Puts a state struct into the state hashmap .
pub fn put_state<T: Serialize>(state: &mut HashMap<String, Value>, key: &str, value: T) {
	state.insert(
		key.to_string(),
		serde_json::to_value(value).expect("Failed to serialize"),
	);
}
pub fn put_state < T : Serialize > ( state : & mut HashMap < String , Value > , key : & str , value : T ) { state . insert ( key . to_string ( ) , serde_json :: to_value ( value ) . expect ( " " ) , ) ; }
Puts a state struct into the state hashmap.
Puts a state struct into the state hashmap .
state
&mut HashMap<String, Value>
key
&str
value
T
state
&mut HashMap<String, Value>
key
&str
value
T