pub struct RouterApp<S> { /* private fields */ }Expand description
A built router: owns the app state, the history and the page on screen.
Call RouterApp::ui every frame, e.g. from eframe::App::ui.
Implementations§
Source§impl<S: Clone + 'static> RouterApp<S>
impl<S: Clone + 'static> RouterApp<S>
Sourcepub fn preload_on_hover(self, enabled: bool) -> Self
pub fn preload_on_hover(self, enabled: bool) -> Self
Whether Nav::link preloads its target while hovered. On by default.
Calls callback after every navigation, once the new page is mounted, e.g. for
analytics or focus management. Not called for invalidations.
pub fn state(&self) -> &S
pub fn is_loading(&self) -> bool
Sourcepub fn goto_with(&mut self, url: &str, options: GotoOptions)
pub fn goto_with(&mut self, url: &str, options: GotoOptions)
See Nav::goto_with.
pub fn back(&mut self)
pub fn forward(&mut self)
Sourcepub fn invalidate(&mut self, key: impl Into<String>)
pub fn invalidate(&mut self, key: impl Into<String>)
See Nav::invalidate; e.g. after data changed in the background.
Sourcepub fn invalidate_all(&mut self)
pub fn invalidate_all(&mut self)
See Nav::invalidate_all.
Sourcepub fn preload(&mut self, url: &str)
pub fn preload(&mut self, url: &str)
See Nav::preload.
Auto Trait Implementations§
impl<S> !Freeze for RouterApp<S>
impl<S> !RefUnwindSafe for RouterApp<S>
impl<S> !Send for RouterApp<S>
impl<S> !Sync for RouterApp<S>
impl<S> !UnwindSafe for RouterApp<S>
impl<S> Unpin for RouterApp<S>
impl<S> UnsafeUnpin for RouterApp<S>where
RouteTable<S>: UnsafeUnpin,
S: UnsafeUnpin,
Option<Mounted<S>>: UnsafeUnpin,
Option<Transition<S>>: UnsafeUnpin,
Option<Pending<S>>: UnsafeUnpin,
Vec<Job<S>>: UnsafeUnpin,
Vec<Box<dyn Fn(&Navigation, &S)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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