Struct sauron::Program [−][src]
pub struct Program<APP, MSG> where
MSG: 'static, { pub app: Rc<RefCell<APP>>, pub dom_updater: Rc<RefCell<DomUpdater<MSG>>>, }
Expand description
Holds the user App and the dom updater This is passed into the event listener and the dispatch program will be called after the event is triggered.
Fields
app: Rc<RefCell<APP>>
holds the user application
dom_updater: Rc<RefCell<DomUpdater<MSG>>>
The dom_updater responsible to updating the actual document in the browser
Implementations
Create an Rc wrapped instance of program, initializing DomUpdater with the initial view and root node, but doesn’t mount it yet.
Map this program such that Program<APP,MSG> becomes Program<APP2,MSG>
Creates an Rc wrapped instance of Program and replace the root_node with the app view
Instantiage an app and append the view to the root_node
Instantiate the app and then append it to the document body
Replace the body of the document with the app
Trait Implementations
This will be called when the actual event is triggered. Defined in the DomUpdater::create_closure_wrap function
Executes the implementing dispatch function. In this case the implementation is the Program which is responsible for executing the update functions using the msg supplied. A new view will then be created and it will be diff to the previous view which will produce patches. These patched will then be applied to the browser DOM. Read more
Auto Trait Implementations
impl<APP, MSG> !RefUnwindSafe for Program<APP, MSG>
impl<APP, MSG> !UnwindSafe for Program<APP, MSG>
Blanket Implementations
Mutably borrows from an owned value. Read more