pub struct Router<P> { /* private fields */ }Expand description
The pages an application has visited, most recent last.
Draw Router::current inside View::page with a key per page
so every page keeps its own focus and scroll position when the user comes back.
Implementations§
Source§impl<P: Clone + PartialEq> Router<P>
impl<P: Clone + PartialEq> Router<P>
Sourcepub fn push(&mut self, page: P)
pub fn push(&mut self, page: P)
Opens page on top. Opening the current page again does nothing.
Sourcepub fn can_go_back(&self) -> bool
pub fn can_go_back(&self) -> bool
Whether Router::back would go anywhere.
Sourcepub fn direction(&self) -> Navigation
pub fn direction(&self) -> Navigation
Which way the last successful navigation went; Forward before any.
Trait Implementations§
impl<P: Eq> Eq for Router<P>
impl<P: PartialEq> StructuralPartialEq for Router<P>
Auto Trait Implementations§
impl<P> Freeze for Router<P>
impl<P> RefUnwindSafe for Router<P>where
Vec<P>: RefUnwindSafe,
impl<P> Send for Router<P>
impl<P> Sync for Router<P>
impl<P> Unpin for Router<P>
impl<P> UnsafeUnpin for Router<P>where
Vec<P>: UnsafeUnpin,
impl<P> UnwindSafe for Router<P>where
Vec<P>: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more