Trait Model

Source
pub trait Model {
    // Required methods
    fn register_proxy<P: Proxy>(&self, proxy: Rc<P>);
    fn retrieve_proxy<P: Proxy>(&self) -> Option<Rc<P>>;
    fn remove_proxy<P: Proxy>(&self) -> Option<Rc<P>>;
    fn has_proxy<P: Proxy>(&self) -> bool;
}
Expand description

The definition for a PureMVC Model.

In PureMVC, Model implementors provide access to Proxy objects by named lookup.

An Model assumes these responsibilities:

  • Maintain a cache of Proxy instances
  • Provide methods for registering, retrieving, and removing Proxy instances

Required Methods§

Source

fn register_proxy<P: Proxy>(&self, proxy: Rc<P>)

Register an Proxy instance with the Model.

Source

fn retrieve_proxy<P: Proxy>(&self) -> Option<Rc<P>>

Retrieve an Proxy instance from the Model.

Source

fn remove_proxy<P: Proxy>(&self) -> Option<Rc<P>>

Remove an Proxy instance from the Model.

Source

fn has_proxy<P: Proxy>(&self) -> bool

Check if a Proxy is registered

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Model for BaseModel

Source§

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