pub trait GraphState:
Sized
+ Send
+ Sync
+ 'static {
type Update: Default + Send + 'static;
// Required method
fn apply(&mut self, update: Self::Update);
// Provided method
fn reset_ephemeral(&mut self) { ... }
}Expand description
Trait implemented by structs that hold graph state. The Update type
is generated by #[derive(GraphState)] and represents a partial delta;
apply merges a delta into self via per-field reducers.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn reset_ephemeral(&mut self)
fn reset_ephemeral(&mut self)
Reset any #[reducer(ephemeral)] fields to Default::default().
The engine calls this at the start of every superstep, before
running tasks — so ephemeral fields hold only writes from the
current step. Default impl is a no-op for state types with no
ephemeral fields.
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.