pub trait StateKey:
'static
+ Send
+ Sync {
type Value: Clone + Default + Serialize + DeserializeOwned + Send + Sync + 'static;
type Update: Send + 'static;
const KEY: &'static str;
const MERGE: MergeStrategy = MergeStrategy::Exclusive;
const SCOPE: KeyScope = KeyScope::Run;
// Required method
fn apply(value: &mut Self::Value, update: Self::Update);
// Provided methods
fn encode(value: &Self::Value) -> Result<Value, StateError> { ... }
fn decode(value: Value) -> Result<Self::Value, StateError> { ... }
}Required Associated Constants§
Provided Associated Constants§
Sourceconst MERGE: MergeStrategy = MergeStrategy::Exclusive
const MERGE: MergeStrategy = MergeStrategy::Exclusive
Parallel merge strategy. Default: Exclusive (conflict on concurrent writes).
Required Associated Types§
type Value: Clone + Default + Serialize + DeserializeOwned + Send + Sync + 'static
type Update: Send + 'static
Required Methods§
Provided Methods§
fn encode(value: &Self::Value) -> Result<Value, StateError>
fn decode(value: Value) -> Result<Self::Value, StateError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.