Trait ruex::prelude::Controller

source ·
pub trait Controller<Body>where
    Body: Debug + 'static,{
    // Required methods
    fn register_command(
        &self,
        interest: Interest,
        command: Rc<dyn Command<Body>>
    );
    fn execute_command(&self, notification: Rc<dyn Notification<Body>>);
    fn remove_command(&self, interest: &Interest);
    fn has_command(&self, interest: &Interest) -> bool;
}
Expand description

The definition for a PureMVC Controller.

In PureMVC, an Controller implementor follows the ‘Command and Controller’ strategy, and assumes these responsibilities:

Required Methods§

source

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

Register a particular Command class as the handler for a particular Notification.

source

fn execute_command(&self, notification: Rc<dyn Notification<Body>>)

Execute the Command previously registered as the handler for Notification’s with the given notification name.

source

fn remove_command(&self, interest: &Interest)

Remove a previously registered Command to Notification mapping.

source

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

Check if a Command is registered for a given Notification

Implementors§

source§

impl<Body> Controller<Body> for BaseController<Body>where Body: Debug + 'static,