Skip to main content

Application

Trait Application 

Source
pub trait Application: 'static {
    // Required methods
    fn view(&self) -> Node;
    fn update(&mut self, action: Action);

    // Provided methods
    fn update_from(&mut self, action: Action, _source: Source) { ... }
    fn theme(&self) -> Theme { ... }
    fn debug_bounds(&self) -> bool { ... }
    fn inspect(&self) -> Value { ... }
}
Expand description

Implement this trait to build an app. UI construction is side-effect free.

Required Methods§

Source

fn view(&self) -> Node

Source

fn update(&mut self, action: Action)

Provided Methods§

Source

fn update_from(&mut self, action: Action, _source: Source)

Source

fn theme(&self) -> Theme

Source

fn debug_bounds(&self) -> bool

Source

fn inspect(&self) -> Value

Optional domain state in automation responses. Never put secrets here.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§