pub struct Children<Msg>(pub Vec<UITree<Msg>>);Expand description
The children slot passed to a component that accepts them. A component
declares a children: Children<Msg> parameter and renders the passed
subtrees somewhere in its own tree:
ⓘ
#[tpt_appfront_core::component]
fn card(props: CardProps, children: Children<Msg>) -> UITree<Msg> {
UITree::container(|c| {
c.heading(2, &props.title);
for child in children.0 {
c.with(child);
}
})
}Children is just a typed Vec<UITree<Msg>> so a component can iterate and
re-emit the slot content with full control over where it lands.
Tuple Fields§
§0: Vec<UITree<Msg>>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for Children<Msg>
impl<Msg> !UnwindSafe for Children<Msg>
impl<Msg> Freeze for Children<Msg>
impl<Msg> Send for Children<Msg>where
Msg: Send,
impl<Msg> Sync for Children<Msg>where
Msg: Sync,
impl<Msg> Unpin for Children<Msg>where
Msg: Unpin,
impl<Msg> UnsafeUnpin for Children<Msg>
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