stack_replace

Macro stack_replace 

Source
macro_rules! stack_replace {
    ($stack:expr, $data:expr, $($state:expr),+) => { ... };
}
Expand description

Alternative to stack.replace(&mut data, Box::new(FooState {})). Use stack_replace!(stack, data, FooState {}, BarState {}, ...) OBS.: Don’t use &mut data as a parameter, but simply data.

  • Accepts multiple States. In which case it will pop once and push the provided states.