Struct dioxus_router::prelude::MemoryHistory
source · pub struct MemoryHistory<R: Routable> { /* private fields */ }Expand description
A HistoryProvider that stores all navigation information in memory.
Implementations§
source§impl<R: Routable> MemoryHistory<R>
impl<R: Routable> MemoryHistory<R>
sourcepub fn with_initial_path(path: R) -> Self
pub fn with_initial_path(path: R) -> Self
Create a MemoryHistory starting at path.
#[derive(Clone, Routable, Debug, PartialEq)]
enum Route {
#[route("/")]
Index {},
#[route("/some-other-page")]
OtherPage {},
}
let mut history = MemoryHistory::<Route>::with_initial_path(Route::Index {});
assert_eq!(history.current_route(), Route::Index {});
assert_eq!(history.can_go_back(), false);Trait Implementations§
source§impl<R: Routable> Default for MemoryHistory<R>
impl<R: Routable> Default for MemoryHistory<R>
source§impl<R: Routable> HistoryProvider<R> for MemoryHistory<R>
impl<R: Routable> HistoryProvider<R> for MemoryHistory<R>
source§fn current_route(&self) -> R
fn current_route(&self) -> R
Get the path of the current URL. Read more
source§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
source§fn go_forward(&mut self)
fn go_forward(&mut self)
Go forward to a future page. Read more
Auto Trait Implementations§
impl<R> Freeze for MemoryHistory<R>where
R: Freeze,
impl<R> RefUnwindSafe for MemoryHistory<R>where
R: RefUnwindSafe,
impl<R> Send for MemoryHistory<R>where
R: Send,
impl<R> Sync for MemoryHistory<R>where
R: Sync,
impl<R> Unpin for MemoryHistory<R>where
R: Unpin,
impl<R> UnwindSafe for MemoryHistory<R>where
R: UnwindSafe,
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.