Skip to main content

State

Trait State 

Source
pub trait State:
    Clone
    + Send
    + Sync
    + Serialize
    + DeserializeOwned
    + 'static {
    type Update: StateUpdate;

    // Required method
    fn apply(&mut self, update: Self::Update);
}
Expand description

Every agent state must implement this trait. Generated by #[derive(State)] proc macro.

Required Associated Types§

Source

type Update: StateUpdate

The companion partial-update struct (all fields Optional)

Required Methods§

Source

fn apply(&mut self, update: Self::Update)

Apply a partial update — each field uses its channel’s merge strategy

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§