pub struct ItemSlot<T: 'static, K: 'static> { /* private fields */ }Expand description
A Copy handle to one keyed item’s state: the unified each/list contract (§5.4).
Implementations§
Source§impl<T: Clone + 'static, K: Clone + 'static> ItemSlot<T, K>
impl<T: Clone + 'static, K: Clone + 'static> ItemSlot<T, K>
Sourcepub fn get(self) -> T
pub fn get(self) -> T
Tracked whole-item read. Read it inside a reactive closure, e.g.
label(move || slot.get()), not eagerly. A recycling list() rebinds one physical row to
many items, and only bindings that read the slot reactively update on rebind; an eager
let name = slot.get() freezes the row at its first item.
Sourcepub fn with<R>(self, f: impl FnOnce(&T) -> R) -> R
pub fn with<R>(self, f: impl FnOnce(&T) -> R) -> R
Tracked read via a projection. Read it inside a reactive closure (see get).
Trait Implementations§
impl<T: 'static, K: 'static> Copy for ItemSlot<T, K>
Auto Trait Implementations§
impl<T, K> !Send for ItemSlot<T, K>
impl<T, K> !Sync for ItemSlot<T, K>
impl<T, K> Freeze for ItemSlot<T, K>
impl<T, K> RefUnwindSafe for ItemSlot<T, K>where
T: RefUnwindSafe,
K: RefUnwindSafe,
impl<T, K> Unpin for ItemSlot<T, K>
impl<T, K> UnsafeUnpin for ItemSlot<T, K>
impl<T, K> UnwindSafe for ItemSlot<T, K>where
T: RefUnwindSafe,
K: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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