pub trait CanTransitionMap<Next: StateMarker> {
type CurrentData;
type Output;
// Required method
fn transition_map<F>(self, f: F) -> Self::Output
where F: FnOnce(Self::CurrentData) -> Next::Data;
}Expand description
A machine that can transition by mapping its current state data into Next.
This is the stable trait-level view of self.transition_map(...).
Required Associated Types§
Sourcetype CurrentData
type CurrentData
The payload type stored in the current state.
Required Methods§
Sourcefn transition_map<F>(self, f: F) -> Self::Output
fn transition_map<F>(self, f: F) -> Self::Output
Perform the transition by consuming the current state data and producing the next payload.
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.