[][src]Struct yew_router::service::RouteService

pub struct RouteService<STATE = ()> { /* fields omitted */ }

A service that facilitates manipulation of the browser's URL bar and responding to browser events when users press 'forward' or 'back'.

The T determines what route state can be stored in the route service.

Implementations

impl<T> RouteService<T>[src]

pub fn new() -> RouteService<T>[src]

Creates the route service.

pub fn get_path(&self) -> String[src]

Gets the path name of the current url.

pub fn get_query(&self) -> String[src]

Gets the query string of the current url.

pub fn get_fragment(&self) -> String[src]

Gets the fragment of the current url.

impl<STATE> RouteService<STATE> where
    STATE: RouteState
[src]

pub fn register_callback(&mut self, callback: Callback<Route<STATE>>)[src]

Registers a callback to the route service. Callbacks will be called when the History API experiences a change such as popping a state off of its stack when the forward or back buttons are pressed.

pub fn set_route(&mut self, route: &str, state: STATE)[src]

Sets the browser's url bar to contain the provided route, and creates a history entry that can be navigated via the forward and back buttons.

The route should be a relative path that starts with a /.

pub fn replace_route(&mut self, route: &str, state: STATE)[src]

Replaces the route with another one removing the most recent history event and creating another history event in its place.

pub fn get_route(&self) -> Route<STATE>[src]

Gets the concatenated path, query, and fragment.

Trait Implementations

impl<STATE: Debug> Debug for RouteService<STATE>[src]

impl<STATE> Default for RouteService<STATE> where
    STATE: RouteState
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

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

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

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.

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.