logo
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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

This will be called when the actual event is triggered. Defined in the DomUpdater::create_closure_wrap function

dispatch multiple msg

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.