Struct seed::App

source ·
pub struct App<Ms: Clone + 'static, Mdl: 'static> {
    pub data: Rc<Data<Ms, Mdl>>,
}

Fields

data: Rc<Data<Ms, Mdl>>

Implementations

We use a struct instead of series of functions, in order to avoid passing repetative sequences of parameters.

This runs whenever the state is changed, ie the user-written update function is called. It updates the state, and any DOM elements affected by this change. todo this is where we need to compare against differences and only update nodes affected by the state change.

We re-create the whole virtual dom each time (Is there a way around this? Probably not without knowing what vars the model holds ahead of time), but only edit the rendered, web_sys dom for things that have been changed. We re-render the virtual DOM on every change, but (attempt to) only change the actual DOM, via web_sys, when we need. The model storred in inner is the old model; updated_model is a newly-calculated one.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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
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.