pub trait Machine<E> {
type State;
// Required method
fn process_event(&mut self, event: E) -> bool;
// Provided method
fn process_event_async(&mut self, event: E) -> impl Future<Output = bool> { ... }
}Expand description
Common synchronous interface implemented by generated state machines that do not require a temporary context.
Required Associated Types§
Required Methods§
Sourcefn process_event(&mut self, event: E) -> bool
fn process_event(&mut self, event: E) -> bool
Processes one event to run-to-completion and reports whether it was accepted.
Provided Methods§
Sourcefn process_event_async(&mut self, event: E) -> impl Future<Output = bool>
fn process_event_async(&mut self, event: E) -> impl Future<Output = bool>
Processes one event to run-to-completion and returns its acceptance as a future. The default inline path does not allocate.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".