Struct ruex::foundation::patterns::command::MacroCommand
source · [−]pub struct MacroCommand<Body> where
Body: Debug + 'static, { /* private fields */ }
Expand description
A base Command implementation that executes other Commands.
A MacroCommand maintains an list of Command Class references called SubCommands.
When execute is called, the MacroCommand instantiates and calls execute on each of its SubCommands turn. Each SubCommand will be passed a reference to the original Notification that was passed to the MacroCommand’s execute method.
Implementations
sourceimpl<Body> MacroCommand<Body> where
Body: Debug + 'static,
impl<Body> MacroCommand<Body> where
Body: Debug + 'static,
sourcepub fn add_sub_command(&mut self, command: Box<dyn Command<Body>>)
pub fn add_sub_command(&mut self, command: Box<dyn Command<Body>>)
Add a SubCommand
.
The SubCommands
will be called in First In/First Out (FIFO)
order.
Note that SubCommand
s may be any Command implementor,
MacroCommand’s or SimpleCommand’s are both acceptable.
Trait Implementations
sourceimpl<Body> Command<Body> for MacroCommand<Body> where
Body: Debug + 'static,
impl<Body> Command<Body> for MacroCommand<Body> where
Body: Debug + 'static,
sourcefn execute(&self, notification: Rc<dyn Notification<Body>>)
fn execute(&self, notification: Rc<dyn Notification<Body>>)
Execute this MacroCommand’s SubCommands
.
The SubCommands
will be called in First In/First Out (FIFO)
order.
sourceimpl<Body> Debug for MacroCommand<Body> where
Body: Debug + 'static,
impl<Body> Debug for MacroCommand<Body> where
Body: Debug + 'static,
sourceimpl<Body> Notifier<Body> for MacroCommand<Body> where
Body: Debug + 'static,
impl<Body> Notifier<Body> for MacroCommand<Body> where
Body: Debug + 'static,
Auto Trait Implementations
impl<Body> !RefUnwindSafe for MacroCommand<Body>
impl<Body> !Send for MacroCommand<Body>
impl<Body> !Sync for MacroCommand<Body>
impl<Body> Unpin for MacroCommand<Body>
impl<Body> !UnwindSafe for MacroCommand<Body>
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