Skip to main content

Component

Trait Component 

Source
pub trait Component: Send + 'static {
    // Required methods
    fn new(ctx: &Context<'_>) -> Self;
    fn view(&self, ctx: &Context<'_>) -> Node;

    // Provided methods
    fn events(&self) -> RVec<EventFilter> { ... }
    fn foreground_services(&self) -> RVec<RString> { ... }
    fn watch(&mut self, _ctx: &Context<'_>) { ... }
    fn update(&mut self, _ctx: &Context<'_>, _event: &Event) -> ItemEffect { ... }
    fn check_view(&self, _ctx: &Context<'_>) -> bool { ... }
    fn hoverable() -> bool { ... }
    fn stop(&mut self, _ctx: &Context<'_>) { ... }
}

Required Methods§

Source

fn new(ctx: &Context<'_>) -> Self

Source

fn view(&self, ctx: &Context<'_>) -> Node

Provided Methods§

Source

fn events(&self) -> RVec<EventFilter>

Source

fn foreground_services(&self) -> RVec<RString>

Source

fn watch(&mut self, _ctx: &Context<'_>)

Source

fn update(&mut self, _ctx: &Context<'_>, _event: &Event) -> ItemEffect

Source

fn check_view(&self, _ctx: &Context<'_>) -> bool

Source

fn hoverable() -> bool

Source

fn stop(&mut self, _ctx: &Context<'_>)

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§