pub struct BrowserRouter { /* private fields */ }Expand description
Browser router that uses the History API.
In WASM, this interfaces with the browser’s history.pushState/replaceState. In non-WASM (tests), this uses an in-memory implementation.
Implementations§
Source§impl BrowserRouter
impl BrowserRouter
Sourcepub fn go(&self, delta: i32)
pub fn go(&self, delta: i32)
Go to a specific point in history (positive = forward, negative = back).
Sourcepub fn history_len(&self) -> usize
pub fn history_len(&self) -> usize
Get the history length.
Sourcepub fn can_go_back(&self) -> bool
pub fn can_go_back(&self) -> bool
Check if we can go back.
Sourcepub fn can_go_forward(&self) -> bool
pub fn can_go_forward(&self) -> bool
Check if we can go forward.
Trait Implementations§
Source§impl Debug for BrowserRouter
impl Debug for BrowserRouter
Source§impl Default for BrowserRouter
impl Default for BrowserRouter
Source§impl Router for BrowserRouter
impl Router for BrowserRouter
Navigate to a route.
Source§fn current_route(&self) -> String
fn current_route(&self) -> String
Get the current route.
Auto Trait Implementations§
impl !Freeze for BrowserRouter
impl RefUnwindSafe for BrowserRouter
impl Send for BrowserRouter
impl Sync for BrowserRouter
impl Unpin for BrowserRouter
impl UnsafeUnpin for BrowserRouter
impl UnwindSafe for BrowserRouter
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