pub struct Page<S> { /* private fields */ }Expand description
A page: an optional load handler and a view.
The view extracts the data returned by load as &mut D, so it can also use it to keep
page-local UI state (text inputs, toggles, …) for as long as the page is shown.
Implementations§
Source§impl<S: 'static> Page<S>
impl<S: 'static> Page<S>
Sourcepub fn with_load<H, T, D, E, V, U>(load: H, view: V) -> Self
pub fn with_load<H, T, D, E, V, U>(load: H, view: V) -> Self
A page whose view can extract the data produced by load (as &mut D or &D).
Sourcepub fn depends(self, key: impl Into<String>) -> Self
pub fn depends(self, key: impl Into<String>) -> Self
Reruns load when key is invalidated.
Sourcepub fn reset_layouts(self) -> Self
pub fn reset_layouts(self) -> Self
Renders the page in the root layout only, skipping the layouts in between. Hooks and error pages still apply.
Sourcepub fn reset_layouts_to(self, name: impl Into<String>) -> Self
pub fn reset_layouts_to(self, name: impl Into<String>) -> Self
Renders the page in the layouts up to the router named name.
Auto Trait Implementations§
impl<S> !RefUnwindSafe for Page<S>
impl<S> !Send for Page<S>
impl<S> !Sync for Page<S>
impl<S> !UnwindSafe for Page<S>
impl<S> Freeze for Page<S>
impl<S> Unpin for Page<S>
impl<S> UnsafeUnpin for Page<S>
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