derive_try_transition!() { /* proc-macro */ }
Expand description

Derives an empty transition of a transition from one state into another and allows to customise if it should always transit or never.

derive_try_transition!(Foo, Bar, TransitGuard::Transit);
// Generates
impl TryTransition<Bar> for Bar {
    fn guard(&self) -> TransitGuard {
        TransitGuard::Transit
    }
}

This macro is implemented as a proc macro instead of a derive macro because it needs additional info that is difficult to get into a derive macro in a semantic way.