Trait components::prelude::MediatorRegistry
[−]pub trait MediatorRegistry<Body> where
Body: 'static + Debug, {
fn register_mediator<M>(&self, mediator: Rc<M>)
where
M: Mediator<Body>;
fn retrieve_mediator<M>(&self) -> Option<Rc<M>>
where
M: Mediator<Body>;
fn remove_mediator<M>(&self) -> Option<Rc<M>>
where
M: Mediator<Body>;
fn has_mediator<M>(&self) -> bool
where
M: Mediator<Body>;
}
Expand description
Defines Mediator Registry functionality
Required Methods
fn register_mediator<M>(&self, mediator: Rc<M>) where
M: Mediator<Body>,
fn register_mediator<M>(&self, mediator: Rc<M>) where
M: Mediator<Body>,
Register an Mediator instance with the View.
Registers the Mediator so that it can be retrieved by name, and further interrogates the Mediator for its Notification interests.
If the Mediator returns any Notification names to be notified about, an Observer is created encapsulating the Mediator instance’s handle_notification method and registering it as an Observer for all Notification’s the Mediator is interested in.
fn retrieve_mediator<M>(&self) -> Option<Rc<M>> where
M: Mediator<Body>,
fn retrieve_mediator<M>(&self) -> Option<Rc<M>> where
M: Mediator<Body>,
fn remove_mediator<M>(&self) -> Option<Rc<M>> where
M: Mediator<Body>,
fn remove_mediator<M>(&self) -> Option<Rc<M>> where
M: Mediator<Body>,
fn has_mediator<M>(&self) -> bool where
M: Mediator<Body>,
fn has_mediator<M>(&self) -> bool where
M: Mediator<Body>,
Check if a Mediator is registered or not