Trait ruex::prelude::Notifier

source ·
pub trait Notifier<Body>where
    Body: Debug + 'static,{
    // Required method
    fn send(&self, interest: Interest, body: Option<Body>);
}
Expand description

The definition for a PureMVC Notifier.

[MacroCommand, Command, Mediator] and Proxy all have a need to send Notification’s.

The Notifier interface provides a common method called send that relieves implementation code of the necessity to actually construct Notification’s.

The Notifier class, which all of the above mentioned classes extend, also provides an initialized reference to the Facade Singleton, which is required for the convienience method for sending Notification’s, but also eases implementation as these classes have frequent Facade interactions and usually require access to the facade anyway.

Required Methods§

source

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

Send a Notification.

Convenience method to prevent having to construct new notification instances in our implementation code.

Implementors§

source§

impl<Body> Notifier<Body> for MacroCommand<Body>where Body: Debug + 'static,

source§

impl<Body> Notifier<Body> for SimpleCommandwhere Body: Debug + 'static,

source§

impl<Body> Notifier<Body> for BaseMediator<Body>where Body: Debug + 'static,

source§

impl<Body> Notifier<Body> for BaseNotifierwhere Body: Debug + 'static,

source§

impl<Body> Notifier<Body> for BaseProxy<Body>where Body: Debug + 'static,