NestedMachine

Struct NestedMachine 

Source
pub struct NestedMachine { /* private fields */ }
Expand description

The managed state of a Hierarchical Finite State Machine (HFSM)

This contains the state pointers of innactive state machines that entered a nested machine, and the state Data of those machines.

Implementations§

Source§

impl NestedMachine

Source

pub fn new() -> Self

Initialize a NestedMachine without any active state

Source

pub fn new_active() -> Self

Initialize a NestedMachine with the first State of the first Machine activated.

Source

pub fn enter(&mut self, machine: &SmHandle)

Enter the nested state described by SmHandle

Source

pub fn stack_len(&self) -> usize

Source

pub fn current_state_name<'a, B, T>( &self, machines: &'a StateMachines<B, T>, ) -> Option<&'a str>

Source

pub fn current_machine_name<'a, B, T>( &self, machines: &'a StateMachines<B, T>, ) -> Option<&'a str>

Source

pub fn update<'w, 's, 'ww, 'ss, B, Trs, Wrd, Updt>( &mut self, machines: &StateMachines<B, Trs>, commands: &mut Updt, world: &Wrd, ) -> Result<Complete, Error>
where B: Behavior<Update<'w, 's> = Updt, World<'ww, 'ss> = Wrd> + 'static, Trs: Transition<World<'ww, 'ss> = Wrd> + 'static,

Trait Implementations§

Source§

impl Default for NestedMachine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.