Skip to main content

Final

Trait Final 

Source
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§

Source

type FinalValue

An associated type representing the value corresponding to a final state.

Required Methods§

Source

fn is_final(self) -> Option<Self::FinalValue>

Determines if the current state is a final state.

§Returns
  • None if not in a final state.
  • Some(val) with val of type FinalValue if 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>

Source§

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.
  • None if the option is empty.
Source§

type FinalValue = CANFrame

Implementors§