logo
pub trait Model {
    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

Register an Proxy instance with the Model.

Retrieve an Proxy instance from the Model.

Remove an Proxy instance from the Model.

Check if a Proxy is registered

Implementors