pub struct Parent(/* private fields */);Expand description
Access to the data loaded by the layouts above, in a layout’s or page’s load.
#[derive(Clone)]
struct BlogLayout { posts: Vec<String> }
async fn load(parent: Parent) -> Result<usize, Rejection> {
let blog = parent.get::<BlogLayout>().await?;
Ok(blog.posts.len())
}Using it makes the load rerun whenever a parent layout reloads.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Parent
impl !Send for Parent
impl !Sync for Parent
impl !UnwindSafe for Parent
impl Forget for Parent
impl Freeze for Parent
impl Move for Parent
impl Unpin for Parent
impl UnsafeUnpin for Parent
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