use std::{fmt::Debug, rc::Rc};
use super::{Interest, Mediator, Notification, NotifyContext, Observer};
pub trait View<Body>
where
Body: Debug + 'static,
{
fn register_observer(&self, interest: Interest, observer: Rc<dyn Observer<Body>>);
fn remove_observer(&self, interest: &Interest, notify_context: &Rc<dyn NotifyContext>);
fn notify(&self, note: Rc<dyn Notification<Body>>);
}
pub trait MediatorRegistry<Body>
where
Body: Debug + 'static,
{
fn register_mediator<M: Mediator<Body>>(&self, mediator: Rc<M>);
fn retrieve_mediator<M: Mediator<Body>>(&self) -> Option<Rc<M>>;
fn remove_mediator<M: Mediator<Body>>(&self) -> Option<Rc<M>>;
fn has_mediator<M: Mediator<Body>>(&self) -> bool;
}