Enum macroquad::experimental::state_machine::StateMachine
source · [−]pub enum StateMachine<T: 'static> {
Ready(StateMachineOwned<T>),
InUse {
next_state: Option<usize>,
current_state: usize,
},
}
Variants
Ready(StateMachineOwned<T>)
InUse
Implementations
sourceimpl<T: Node + 'static> StateMachine<T>
impl<T: Node + 'static> StateMachine<T>
pub fn new() -> StateMachine<T>
pub fn add_state(&mut self, id: usize, state: State<T>)
pub fn take(&mut self) -> StateMachineOwned<T>
pub fn set_state(&mut self, state: usize)
pub fn state(&self) -> usize
sourcepub fn update_detached<'a, F>(t: RefMut<T>, f: F) where
F: FnMut(&mut RefMut<T>) -> &mut StateMachine<T>,
pub fn update_detached<'a, F>(t: RefMut<T>, f: F) where
F: FnMut(&mut RefMut<T>) -> &mut StateMachine<T>,
A hack to update a state machine being part of an updating struct
pub fn update<'a>(&mut self, t: &'a mut RefMut<T>)
Auto Trait Implementations
impl<T> !RefUnwindSafe for StateMachine<T>
impl<T> !Send for StateMachine<T>
impl<T> !Sync for StateMachine<T>
impl<T> Unpin for StateMachine<T>
impl<T> !UnwindSafe for StateMachine<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more