pub trait TransitionMeta<S>: Copy + Display {
// Required methods
fn target_state(&self) -> S;
fn all() -> Vec<Self>;
fn allowed_roles(&self) -> &'static [&'static str];
}Expand description
Required trait for Transition enums — provides the metadata that
StateMachineBehavior default methods need.
Implement this on each {Name}Transition enum:
ⓘ
impl TransitionMeta<AgentState> for AgentTransition {
fn target_state(&self) -> AgentState { match self { ... } }
fn all() -> Vec<Self> { vec![...] }
fn allowed_roles(&self) -> &'static [&'static str] { match self { ... } }
}Required Methods§
Sourcefn target_state(&self) -> S
fn target_state(&self) -> S
The state this transition leads to.
Sourcefn allowed_roles(&self) -> &'static [&'static str]
fn allowed_roles(&self) -> &'static [&'static str]
Roles allowed to fire this transition. Empty slice means unrestricted.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".