pub struct Layout<S> { /* private fields */ }Expand description
A layout wrapping every page of a Router,
including those of nested routers.
Its view gets the Children after the Ui, then extractors. Render the child
with Children::show, or animated with a ViewTransition.
Implementations§
Source§impl<S: 'static> Layout<S>
impl<S: 'static> Layout<S>
Sourcepub fn new<V, U>(view: V) -> Selfwhere
V: LayoutView<U, S, ()>,
pub fn new<V, U>(view: V) -> Selfwhere
V: LayoutView<U, S, ()>,
A layout without a load handler.
Sourcepub fn with_load<H, T, D, E, V, U>(load: H, view: V) -> Selfwhere
H: Handler<T, S, Output = Result<D, E>>,
D: 'static,
E: Into<Rejection>,
V: LayoutView<U, S, D>,
pub fn with_load<H, T, D, E, V, U>(load: H, view: V) -> Selfwhere
H: Handler<T, S, Output = Result<D, E>>,
D: 'static,
E: Into<Rejection>,
V: LayoutView<U, S, D>,
A layout whose view can extract the data produced by load (as &mut D or &D).
The loads below can read it with Parent, and the views below
with LayoutData unless this view takes it as &mut D.
Sourcepub fn depends(self, key: impl Into<String>) -> Self
pub fn depends(self, key: impl Into<String>) -> Self
See Page::depends.
Sourcepub fn reset_layouts(self) -> Self
pub fn reset_layouts(self) -> Self
Wraps this layout in the root layout only, skipping the layouts in between.
Sourcepub fn reset_layouts_to(self, name: impl Into<String>) -> Self
pub fn reset_layouts_to(self, name: impl Into<String>) -> Self
Wraps this layout in the layouts up to the router named name.
Auto Trait Implementations§
impl<S> !Freeze for Layout<S>
impl<S> !RefUnwindSafe for Layout<S>
impl<S> !Send for Layout<S>
impl<S> !Sync for Layout<S>
impl<S> !UnwindSafe for Layout<S>
impl<S> Unpin for Layout<S>
impl<S> UnsafeUnpin for Layout<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