pub trait State: Debug + Send + PartialEq + Copy {
// Required method
fn get_kind(&self) -> &dyn Kind<State = Self>;
// Provided methods
fn fail(&mut self)
where Self: Sized { ... }
fn complete(&mut self)
where Self: Sized { ... }
fn is_completed(&self) -> bool
where Self: Sized,
for<'a> &'a Self: PartialEq<&'a Self> { ... }
fn is_failed(&self) -> bool
where Self: Sized,
for<'a> &'a Self: PartialEq<&'a Self> { ... }
fn is_new(&self) -> bool
where Self: Sized,
for<'a> &'a Self: PartialEq<&'a Self> { ... }
fn is_terminal(&self) -> bool
where Self: Sized { ... }
fn kind_eq(&self, kind: &dyn Kind<State = Self>) -> bool
where Self: Sized { ... }
}Expand description
A trait for types representing state machine lifecycles. These types should be field-less
enumerations or enumerations whose variants only contain field-less enumerations; note that
Copy is a required supertrait.
Required Methods§
Provided Methods§
fn fail(&mut self)where
Self: Sized,
fn complete(&mut self)where
Self: Sized,
fn is_completed(&self) -> bool
fn is_failed(&self) -> bool
fn is_new(&self) -> bool
sourcefn is_terminal(&self) -> boolwhere
Self: Sized,
fn is_terminal(&self) -> boolwhere
Self: Sized,
represents a state that will no longer change
Object Safety§
This trait is not object safe.