Trait virtual_view::Component [] [src]

pub trait Component: 'static + Any {
    fn render(
        &self,
        instance: &Instance,
        props: &Props,
        children: &Children
    ) -> View; fn name(&self) -> &'static str { ... }
fn initial_state(&self, _props: &Props) -> Props { ... }
fn context(&self, _props: &Props) -> Props { ... }
fn inherit_context(&self, context: Props, _parent_context: &Props) -> Props { ... }
fn will_mount(&self, _instance: &Instance) { ... }
fn will_unmount(&self, _instance: &Instance) { ... }
fn will_update(&self, _instance: &Instance) { ... }
fn receive_props(
        &self,
        _instance: &Instance,
        _next_state: &Props,
        _next_props: &Props,
        _next_children: &Children
    ) { ... }
fn should_update(
        &self,
        _prev_state: &Props,
        _prev_props: &Props,
        _prev_children: &Children,
        _next_state: &Props,
        _next_props: &Props,
        _next_children: &Children
    ) -> bool { ... } }

Required Methods

Provided Methods

return the inital state of the component

return the inital context of the component, gets passed to children via inherit_context

filter the passed context of the component

called before mount

called before unmount

called before update

called when component receives new state, props, or children

if component needs update return true, defaults to true

Trait Implementations

impl PartialEq for Component
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

Auto Trait Implementations

Implementors