Struct yew::html::App
[−]
[src]
pub struct App<MSG> { /* fields omitted */ }
A context which contains a bridge to send a messages to a loop. Mostly services uses it.
Methods
impl<MSG: 'static> App<MSG>
[src]
fn new() -> Self
[src]
Creates a context with connected sender and receiver.
fn sender(&mut self) -> AppSender<MSG>
[src]
Returns a cloned sender.
fn mount<CTX, MOD, U, V>(
&mut self,
context: CTX,
model: MOD,
update: U,
view: V
) where
CTX: 'static,
MOD: 'static,
U: Fn(&mut CTX, &mut MOD, MSG) + 'static,
V: Fn(&MOD) -> Html<MSG> + 'static,
[src]
&mut self,
context: CTX,
model: MOD,
update: U,
view: V
) where
CTX: 'static,
MOD: 'static,
U: Fn(&mut CTX, &mut MOD, MSG) + 'static,
V: Fn(&MOD) -> Html<MSG> + 'static,
Alias to mount_to("body", ...)
.
fn mount_to<CTX, MOD, U, V>(
&mut self,
selector: &str,
context: CTX,
model: MOD,
update: U,
view: V
) where
CTX: 'static,
MOD: 'static,
U: Fn(&mut CTX, &mut MOD, MSG) + 'static,
V: Fn(&MOD) -> Html<MSG> + 'static,
[src]
&mut self,
selector: &str,
context: CTX,
model: MOD,
update: U,
view: V
) where
CTX: 'static,
MOD: 'static,
U: Fn(&mut CTX, &mut MOD, MSG) + 'static,
V: Fn(&MOD) -> Html<MSG> + 'static,
The main entrypoint of a yew program. It works similar as program
function in Elm. You should provide an initial model, update
function
which will update the state of the model and a view
function which
will render the model to a virtual DOM tree.