pub trait StateSchema:
Clone
+ Send
+ Sync
+ 'static
+ Serialize
+ for<'de> Deserialize<'de>
+ Debug {
// Provided methods
fn from_input(input: Self) -> Self { ... }
fn to_json(&self) -> GraphResult<Value> { ... }
}Expand description
State Schema trait
Provided Methods§
Sourcefn from_input(input: Self) -> Self
fn from_input(input: Self) -> Self
Create initial state from input
Sourcefn to_json(&self) -> GraphResult<Value>
fn to_json(&self) -> GraphResult<Value>
Get state as JSON for debugging/checkpointing.
Returns a Result instead of silently producing Value::Null (Q2):
a serialization failure is data corruption in the state machine and
must surface at the call site, not be swallowed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".