Trait Component

Source
pub trait Component: 'static {
    type Builder;

    // Required methods
    fn render(&self, ctx: Context<'_>) -> View;
    fn updated(&self) -> bool;

    // Provided methods
    fn native_type(&self) -> Option<NativeType> { ... }
    fn location(&self) -> Option<(u32, u32)> { ... }
    fn key(&self) -> Option<&str> { ... }
}
Expand description

The trait representing a component.

Users should not implement this trait manually but instead use the component attribute. However, native component implementations may need to use manual component implementations.

Required Associated Types§

Required Methods§

Source

fn render(&self, ctx: Context<'_>) -> View

Source

fn updated(&self) -> bool

Provided Methods§

Source

fn native_type(&self) -> Option<NativeType>

Source

fn location(&self) -> Option<(u32, u32)>

Source

fn key(&self) -> Option<&str>

Implementations on Foreign Types§

Source§

impl Component for ()

Source§

type Builder = ()

Source§

fn render(&self, _: Context<'_>) -> View

Source§

fn updated(&self) -> bool

Implementors§