Trait ruex::prelude::Facade

source ·
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§

source

fn register_command(&self, interest: Interest, command: Rc<dyn Command<Body>>)

Register an Command with the Controller.

source

fn remove_command(&self, interest: &Interest)

Remove a previously registered Command to Notification mapping from the Controller.

source

fn has_command(&self, interest: &Interest) -> bool

Check if a Command is registered for a given Notification

source

fn send(&self, interest: Interest, body: Option<Body>)

Create and send an Notification.

Implementors§

source§

impl<Body> Facade<Body> for BaseFacade<Body>where Body: Debug + 'static,