Skip to main content

View

Trait View 

Source
pub trait View:
    Sized
    + Send
    + 'static {
    type Vm: ViewModel;

    const META: ScreenMeta;

    // Required methods
    fn build() -> (Self, Widget, Parts);
    fn update(&mut self, root: &mut Widget, vm: &Self::Vm, u: &mut Update);
    fn dispatch(
        &mut self,
        vm: &mut Self::Vm,
        cx: &mut Cx<'_, Self::Vm>,
        ev: ViewEvent,
    );
}
Expand description

A compiled screen — implemented by .yui codegen only.

The host owns the content tree; paths are child-index paths from its root (Widget::get_path).

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn build() -> (Self, Widget, Parts)

The view’s binding state, its content tree and its interactive parts.

Source

fn update(&mut self, root: &mut Widget, vm: &Self::Vm, u: &mut Update)

Re-evaluates the bindings against vm, patching root.

Source

fn dispatch( &mut self, vm: &mut Self::Vm, cx: &mut Cx<'_, Self::Vm>, ev: ViewEvent, )

Runs the command (or write-back) for ev.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§