pub trait Final {
type FinalValue;
// Required method
fn is_final(self) -> Option<Self::FinalValue>;
}Expand description
A trait for machines that have some final states and an associated value.
This is useful for cases where a machine can complete its execution and produce a final value outcome.
Required Associated Types§
Sourcetype FinalValue
type FinalValue
An associated type representing the value corresponding to a final state.
Required Methods§
Sourcefn is_final(self) -> Option<Self::FinalValue>
fn is_final(self) -> Option<Self::FinalValue>
Determines if the current state is a final state.
§Returns
Noneif not in a final state.Some(val)withvalof typeFinalValueif in a final state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Final for Option<CANFrame>
impl Final for Option<CANFrame>
Source§fn is_final(self) -> Option<Self::FinalValue>
fn is_final(self) -> Option<Self::FinalValue>
Determines if an Option<CANFrame> contains a final frame.
§Returns
Some(CANFrame)if the option contains a valid frame.Noneif the option is empty.