Skip to main content

App

Trait App 

Source
pub trait App {
    type Message: Send + 'static;

    // Required methods
    fn render(
        &mut self,
        cx: &mut ViewCtx<'_, Self::Message>,
    ) -> Element<Self::Message>;
    fn update(
        &mut self,
        message: Self::Message,
        handle: &RuntimeHandle<Self::Message>,
    );

    // Provided methods
    fn mount(&mut self, _handle: &RuntimeHandle<Self::Message>) { ... }
    fn on_unhandled_key(
        &mut self,
        _key: Key,
        _handle: &RuntimeHandle<Self::Message>,
    ) -> bool { ... }
}

Required Associated Types§

Source

type Message: Send + 'static

Required Methods§

Source

fn render( &mut self, cx: &mut ViewCtx<'_, Self::Message>, ) -> Element<Self::Message>

Source

fn update( &mut self, message: Self::Message, handle: &RuntimeHandle<Self::Message>, )

Provided Methods§

Source

fn mount(&mut self, _handle: &RuntimeHandle<Self::Message>)

Source

fn on_unhandled_key( &mut self, _key: Key, _handle: &RuntimeHandle<Self::Message>, ) -> bool

Implementors§