pub trait Command<Body>: Debug where
Body: 'static + Debug, {
fn execute(&self, notification: Rc<dyn Notification<Body> + 'static>);
}
Expand description
The definition for a PureMVC Command.
Required Methods
fn execute(&self, notification: Rc<dyn Notification<Body> + 'static>)
fn execute(&self, notification: Rc<dyn Notification<Body> + 'static>)
Execute the Command’s logic to handle a given Notification.
Implementations on Foreign Types
sourceimpl<Body> Command<Body> for MacroCommand<Body> where
Body: 'static + Debug,
impl<Body> Command<Body> for MacroCommand<Body> where
Body: 'static + Debug,
sourcefn execute(&self, notification: Rc<dyn Notification<Body> + 'static>)
fn execute(&self, notification: Rc<dyn Notification<Body> + 'static>)
Execute this MacroCommand’s SubCommands
.
The SubCommands
will be called in First In/First Out (FIFO)
order.
sourceimpl<Body> Command<Body> for SimpleCommand where
Body: 'static + Debug,
impl<Body> Command<Body> for SimpleCommand where
Body: 'static + Debug,
sourcefn execute(&self, _notification: Rc<dyn Notification<Body> + 'static>)
fn execute(&self, _notification: Rc<dyn Notification<Body> + 'static>)
Fulfill the use-case initiated by the given Notification.
In the Command Pattern, an application use-case typically begins with some user action, which results in an Notification being broadcast, which is handled by business logic in the execute method of an Command.