pub trait Facade<Body>where
Body: Debug + 'static,{
// Required methods
fn register_command(
&self,
interest: Interest,
command: Rc<dyn Command<Body>>
);
fn remove_command(&self, interest: &Interest);
fn has_command(&self, interest: &Interest) -> bool;
fn send(&self, interest: Interest, body: Option<Body>);
}
Expand description
The definition for a PureMVC Facade.
The Facade Pattern suggests providing a single class to act as a central point of communication for a subsystem.
In PureMVC, the Facade acts as an interface between the core MVC actors Model, View, Controller and the rest of your application.
Also Facade should implement IModel trait with Model for different data types and IView
Required Methods§
sourcefn register_command(&self, interest: Interest, command: Rc<dyn Command<Body>>)
fn register_command(&self, interest: Interest, command: Rc<dyn Command<Body>>)
Register an Command with the Controller.
sourcefn remove_command(&self, interest: &Interest)
fn remove_command(&self, interest: &Interest)
Remove a previously registered Command to Notification mapping from the Controller.
sourcefn has_command(&self, interest: &Interest) -> bool
fn has_command(&self, interest: &Interest) -> bool
Check if a Command is registered for a given Notification
sourcefn send(&self, interest: Interest, body: Option<Body>)
fn send(&self, interest: Interest, body: Option<Body>)
Create and send an Notification.