pub struct ItemSlot<T, K>where
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, K> ItemSlot<T, K>
impl<T, K> 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).
Sourcepub fn field<V>(self, f: impl FnOnce(&T) -> V) -> Vwhere
V: Clone,
pub fn field<V>(self, f: impl FnOnce(&T) -> V) -> Vwhere
V: Clone,
Tracked field projection (equality-gating happens in the binding layer). Read it inside a
reactive closure (see get) so recycled rows update on rebind.
pub fn key(self) -> K
Trait Implementations§
impl<T, K> Copy for ItemSlot<T, K>where
T: 'static,
K: 'static,
Auto Trait Implementations§
impl<T, K> Freeze for ItemSlot<T, K>
impl<T, K> RefUnwindSafe for ItemSlot<T, K>where
T: RefUnwindSafe,
K: RefUnwindSafe,
impl<T, K> !Send for ItemSlot<T, K>
impl<T, K> !Sync for ItemSlot<T, K>
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,
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