Struct yew_router::agent::RouteAgent[][src]

pub struct RouteAgent<STATE = ()> where
    STATE: RouteState
{ /* fields omitted */ }
Expand description

The RouteAgent holds on to the RouteService singleton and mediates access to it.

It serves as a means to propagate messages to components interested in the state of the current route.

Warning

All routing-related components/agents/services should use the same type parameter across your application.

If you use multiple agents with different types, then the Agents won’t be able to communicate to each other and associated components may not work as intended.

Trait Implementations

impl<STATE> Agent for RouteAgent<STATE> where
    STATE: RouteState
[src]

type Input = RouteRequest<STATE>

Incoming message type.

type Message = Msg<STATE>

Type of an input message.

type Output = Route<STATE>

Outgoing message type.

type Reach = Context<Self>

Reach capability of the agent.

fn create(link: AgentLink<RouteAgent<STATE>>) -> Self[src]

Creates an instance of an agent.

fn update(&mut self, msg: Self::Message)[src]

This method called on every update message.

fn connected(&mut self, id: HandlerId)[src]

This method called on when a new bridge created.

fn handle_input(&mut self, msg: Self::Input, who: HandlerId)[src]

This method called on every incoming message.

fn disconnected(&mut self, id: HandlerId)[src]

This method called on when a new bridge destroyed.

fn destroy(&mut self)[src]

This method called when the agent is destroyed.

fn name_of_resource() -> &'static str[src]

Represents the name of loading resorce for remote workers which have to live in a separate files. Read more

fn is_module() -> bool[src]

Signifies if resource is a module. This has pending browser support. Read more

impl<STATE: RouteState> Debug for RouteAgent<STATE>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError>[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<STATE = ()> !RefUnwindSafe for RouteAgent<STATE>

impl<STATE = ()> !Send for RouteAgent<STATE>

impl<STATE = ()> !Sync for RouteAgent<STATE>

impl<STATE> Unpin for RouteAgent<STATE> where
    STATE: Unpin

impl<STATE = ()> !UnwindSafe for RouteAgent<STATE>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, V> IntoOptPropValue<V> for T where
    T: IntoPropValue<Option<V>>, 
[src]

pub fn into_opt_prop_value(self) -> Option<V>[src]

Convert self to an optional value of a Properties struct.

impl<T> IntoPropValue<Option<T>> for T[src]

pub fn into_prop_value(self) -> Option<T>[src]

Convert self to a value of a Properties struct.

impl<T> IntoPropValue<T> for T[src]

pub fn into_prop_value(self) -> T[src]

Convert self to a value of a Properties struct.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Any for T where
    T: Any