[][src]Trait yewtil::PureEmissiveComponent

pub trait PureEmissiveComponent: Properties + PartialEq + Sized + 'static {
    type Message;
    fn render(&self) -> Html<Pure<Self>>;

    fn send_message(&self, _msg: Self::Message) { ... }
}

Allows immutable components to be declared using a single struct and two methods.

This trait defers to its own message handling function versus using the Emissive trait like PureComponent does.

If you pass more than one Callback as props, then the Emissive derive macro will only handle the first. While you could just implement Emissive manually, this trait facilitates keeping all your pure component functions under a single trait definition.

This trait is blanket implemented for any T: PureComponent + Emissive, and is used with the Pure wrapper component.

Associated Types

type Message

The message to handled.

Loading content...

Required methods

fn render(&self) -> Html<Pure<Self>>

Renders self to Html.

Loading content...

Provided methods

fn send_message(&self, _msg: Self::Message)

Sends a message.

Loading content...

Implementors

impl<T> PureEmissiveComponent for T where
    T: PureComponent + Emissive
[src]

type Message = <T as Emissive>::Message

Loading content...