[−][src]Struct router_rs::prelude::Router
Holds all of the routes for an application.
A typical use case is that when we want to move to a new route (such as after clicking on an anchor tag) we'll query our router to see if the new route matches any of our route definitions.
Then if we find a matching route we'll return it.
Methods
impl Router
[src]
pub fn provide<T: 'static>(&mut self, provided: T)
[src]
Provide the application state data that different routes need.
impl Router
[src]
pub fn set_route_handlers(&mut self, route_handlers: Vec<Box<dyn RouteHandler>>)
[src]
Push a vector of Routes into the Router
pub fn view(&self, incoming_route: &str) -> Option<VirtualNode>
[src]
Get the first route in our routes vector view that handles this incoming_route
and return the view for that route.
You'll typically call this when trying to render the correct view based on the page URL or after clicking on an anchor tag.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,