Struct dioxus_router::prelude::WebHistory
source · pub struct WebHistory<R: Routable> { /* private fields */ }Expand description
A HistoryProvider that integrates with a browser via the History API.
Prefix
This HistoryProvider supports a prefix, which can be used for web apps that aren’t located
at the root of their domain.
Application developers are responsible for ensuring that right after the prefix comes a /. If
that is not the case, this HistoryProvider will replace the first character after the prefix
with one.
Application developers are responsible for not rendering the router if the prefix is not present in the URL. Otherwise, if a router navigation is triggered, the prefix will be added.
Implementations§
source§impl<R: Routable> WebHistory<R>
impl<R: Routable> WebHistory<R>
Trait Implementations§
source§impl<R: Routable> HistoryProvider<R> for WebHistory<R>where
<R as FromStr>::Err: Display,
impl<R: Routable> HistoryProvider<R> for WebHistory<R>where <R as FromStr>::Err: Display,
source§fn current_route(&self) -> R
fn current_route(&self) -> R
Get the path of the current URL. Read more
source§fn go_forward(&mut self)
fn go_forward(&mut self)
Go forward to a future page. Read more
source§fn updater(&mut self, callback: Arc<dyn Fn() + Send + Sync>)
fn updater(&mut self, callback: Arc<dyn Fn() + Send + Sync>)
Provide the
HistoryProvider with an update callback. Read moresource§fn can_go_back(&self) -> bool
fn can_go_back(&self) -> bool
Check whether there is a previous page to navigate back to. Read more
source§fn can_go_forward(&self) -> bool
fn can_go_forward(&self) -> bool
Check whether there is a future page to navigate forward to. Read more
Auto Trait Implementations§
impl<R> !RefUnwindSafe for WebHistory<R>
impl<R> !Send for WebHistory<R>
impl<R> !Sync for WebHistory<R>
impl<R> Unpin for WebHistory<R>where R: Unpin,
impl<R> !UnwindSafe for WebHistory<R>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more