[−][src]Struct yew_router::service::RouteService
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]
STATE: RouteState,
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]
STATE: RouteState,
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,
STATE: Unpin,
impl<STATE = ()> !UnwindSafe for RouteService<STATE>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,