Trans

Enum Trans 

Source
pub enum Trans<D> {
    Push(BoxState<D>),
    Pop,
    Replace(BoxState<D>),
    Isolate(BoxState<D>),
    Quit,
    None,
}
Expand description

A transition between States.

See the crates docs or the book for more information.

§Generics

  • D: Data available to all States to perform actions to.

Variants§

§

Push(BoxState<D>)

Pushes a new state above the current one. Effectively pauses the current state until everything above it is popped.

§

Pop

Pops the current state from the stack.

§

Replace(BoxState<D>)

Pops and pushes a new state. Effectively replaces the current state with a new one.

§

Isolate(BoxState<D>)

Pops every state from the stack and pushes a new one. Effectively isolates it as the only state on the stack.

§

Quit

Pops everything from the stack. Effectively ends the state stack machine.

§

None

Does nothing to the stack. Effectively keeps the current state and the stack the way it is.

Auto Trait Implementations§

§

impl<D> Freeze for Trans<D>

§

impl<D> !RefUnwindSafe for Trans<D>

§

impl<D> !Send for Trans<D>

§

impl<D> !Sync for Trans<D>

§

impl<D> Unpin for Trans<D>

§

impl<D> !UnwindSafe for Trans<D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.