#![allow(dead_code)]
#[derive(Debug, Clone)]
pub struct Transition<'t> {
pub from: State<'t>,
pub to: State<'t>,
pub at: Option<Event<'t>>,
pub kind: TransitionType<'t>, }
#[derive(Debug, Clone)]
#[allow(clippy::large_enum_variant)]
pub enum TransitionType<'t> {
Inside {
state: &'t State<'t>,
kind: &'t TransitionType<'t>,
},
Normal, Toggle,
Loop {
transient: bool,
},
}
#[derive(Debug, Clone)]
pub struct State<'s> {
pub name: &'s str,
pub kind: &'s StateType, }
#[derive(Debug)]
pub enum StateType {
Atomic,
}
impl Into<String> for &State<'_> {
fn into(self) -> String {
self.name.to_string()
}
}
#[derive(Debug, Clone)]
pub struct Event<'s> {
pub name: &'s str, }
impl Into<String> for &Event<'_> {
fn into(self) -> String {
self.name.to_string()
}
}