yew_router_nested::agent

Struct RouteAgent

Source
pub struct RouteAgent<STATE = ()>
where STATE: RouteState,
{ /* private fields */ }
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§

Source§

impl<STATE> Agent for RouteAgent<STATE>
where STATE: RouteState,

Source§

type Input = RouteRequest<STATE>

Incoming message type.
Source§

type Message = Msg<STATE>

Type of an input message.
Source§

type Output = Route<STATE>

Outgoing message type.
Source§

type Reach = Context<RouteAgent<STATE>>

Reach capability of the agent.
Source§

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

Creates an instance of an agent.
Source§

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

This method called on every update message.
Source§

fn connected(&mut self, id: HandlerId)

This method called on when a new bridge created.
Source§

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

This method called on every incoming message.
Source§

fn disconnected(&mut self, id: HandlerId)

This method called on when a new bridge destroyed.
Source§

fn destroy(&mut self)

This method called when the agent is destroyed.
Source§

fn name_of_resource() -> &'static str

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

fn resource_path_is_relative() -> bool

Indicates whether the name of the resource is relative. Read more
Source§

fn is_module() -> bool

Signifies if resource is a module. This has pending browser support.
Source§

impl<STATE: RouteState> Debug for RouteAgent<STATE>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<STATE> Freeze for RouteAgent<STATE>

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> Any for T
where T: Any,