pub trait ProcessManager: Send + 'static {
type Event: Send + Clone + 'static;
type Command: Send + 'static;
type State: Clone + Send + Default + 'static;
type Error: Error + Send + 'static;
// Required methods
fn correlation_id(event: &Self::Event) -> Option<String>;
fn transition(
state: &Self::State,
event: Self::Event,
) -> Result<Transition<Self::State, Self::Command>, Self::Error>;
}Expand description
Typed state-machine process manager.
Required Associated Types§
type Event: Send + Clone + 'static
type Command: Send + 'static
type State: Clone + Send + Default + 'static
type Error: Error + Send + 'static
Required Methods§
fn correlation_id(event: &Self::Event) -> Option<String>
fn transition( state: &Self::State, event: Self::Event, ) -> Result<Transition<Self::State, Self::Command>, Self::Error>
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.