[][src]Trait yew::prelude::Dispatched

pub trait Dispatched: Agent + Sized + 'static {
    fn dispatcher() -> Dispatcher<Self>;
}

This trait allows the creation of a dispatcher to an existing agent that will not send replies when messages are sent.

Required methods

fn dispatcher() -> Dispatcher<Self>

Creates a dispatcher to the agent that will not send messages back.

Note

Dispatchers don't have HandlerIds and therefore Agent::handle will be supplied None for the id parameter, and connected and disconnected will not be called.

Important

Because the Agents using Context or Public reaches use the number of existing bridges to keep track of if the agent itself should exist, creating dispatchers will not guarantee that an Agent will exist to service requests sent from Dispatchers. You must keep at least one bridge around if you wish to use a dispatcher. If you are using agents in a write-only manner, then it is suggested that you create a bridge that handles no-op responses as high up in the component hierarchy as possible - oftentimes the root component for simplicity's sake.

Loading content...

Implementors

impl<T> Dispatched for T where
    T: Agent,
    <T as Agent>::Reach: Discoverer<Agent = T>,
    <T as Agent>::Reach: Dispatchable, 
[src]

Loading content...