pub struct Stack { /* private fields */ }Expand description
Draws its children on top of each other in one cell, each stretched to the size of the largest. Later children are on top.
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn children_keyed<T, K, W>(
self,
items: impl FnMut() -> Vec<T> + 'static,
key: impl FnMut(&T) -> K + 'static,
view: impl FnMut(&Cx, Memo<T>) -> W + 'static,
) -> Self
pub fn children_keyed<T, K, W>( self, items: impl FnMut() -> Vec<T> + 'static, key: impl FnMut(&T) -> K + 'static, view: impl FnMut(&Cx, Memo<T>) -> W + 'static, ) -> Self
Adds one child per item, after the children added so far.
items runs in an effect, so the list updates when a signal it
read changes. key names each item. view builds the child for
a key the first time it appears, and that child is kept while
its key stays in the list, even if it moves. view receives the
item’s Cx and a Memo that updates when that item’s value
changes. When a key leaves the list, its child and everything
created in view are freed. If two items share a key, only the
first is shown and the duplicate is logged.
Trait Implementations§
Source§impl Widget for Stack
impl Widget for Stack
Source§fn into_element(self: Box<Self>) -> Element
fn into_element(self: Box<Self>) -> Element
Turns the description, and everything inside it, into the element
the window builds nodes from. It runs when the window is created or a
list item first appears, before the window’s tree is touched and
without recording what it reads, so it only describes.
Auto Trait Implementations§
impl !RefUnwindSafe for Stack
impl !Send for Stack
impl !Sync for Stack
impl !UnwindSafe for Stack
impl Forget for Stack
impl Freeze for Stack
impl Move for Stack
impl Unpin for Stack
impl UnsafeUnpin for Stack
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