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> Forget for Page<S>
impl<S> Freeze for Page<S>where
*const RcInner<dyn Fn(&Request, &S) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any>, Rejection>>>>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&Request, &S) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any>, Rejection>>>>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
*const RcInner<dyn Fn(&mut Ui, &ViewContext<'_, S>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut Ui, &ViewContext<'_, S>)>>: Freeze,
PhantomData<u8>: Freeze,
impl<S> Move for Page<S>
impl<S> Unpin for Page<S>
impl<S> UnsafeUnpin for Page<S>where
*const RcInner<dyn Fn(&Request, &S) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any>, Rejection>>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&Request, &S) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any>, Rejection>>>>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut Ui, &ViewContext<'_, S>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut Ui, &ViewContext<'_, S>)>>: UnsafeUnpin,
PhantomData<u8>: 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
impl<T> ErasedDestructor for Twhere
T: 'static,
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