pub struct ModelSlot<T>where
T: 'static,{ /* private fields */ }Expand description
One recycled row’s connection to its store: the slot a model list’s row builder
receives. Copy, and a day-model Source, so #[derive(Observable)] accessors hang
off it. text_field(slot.name()) binds two-way and follows the slot to its next row
when the cell recycles, because the slot resolves its row on every operation.
Implementations§
Source§impl<T> ModelSlot<T>where
T: Identified + Clone + 'static,
impl<T> ModelSlot<T>where
T: Identified + Clone + 'static,
Sourcepub fn for_key(store: Store<Keyed<T>>, key: u64) -> ModelSlot<T>
pub fn for_key(store: Store<Keyed<T>>, key: u64) -> ModelSlot<T>
A slot pointed at key, for row sources implemented outside this crate (a live
query). Application code receives slots from list/each instead.
Sourcepub fn rebind_key(&self, key: u64)
pub fn rebind_key(&self, key: u64)
The recycle write, for external row sources: point this slot at another key.
Trait Implementations§
impl<T> Copy for ModelSlot<T>
Source§impl<T> Source<T> for ModelSlot<T>where
T: Identified + 'static,
impl<T> Source<T> for ModelSlot<T>where
T: Identified + 'static,
Source§const DYNAMIC: bool = true
const DYNAMIC: bool = true
Whether this source’s location can change over the handle’s lifetime: a recycled list
slot whose current row rotates. Fields projected from a dynamic source resolve their
path through the source on every operation instead of trusting the one cached at
projection time, and their tracked reads also run
Source::track_extra.Source§fn track_extra(self)
fn track_extra(self)
Extra tracking a projected field’s tracked reads perform. A dynamic source tracks its
own rebind signal here, so a control bound at build follows the slot to its next row.
Source§fn path(self) -> Path
fn path(self) -> Path
The path this source occupies. Implementations revalidate against the interner, so the
result is always current.
Source§fn node(self) -> NodeId
fn node(self) -> NodeId
This source’s interned id, so a child can be built with no lookup of its own. Read more
Source§fn components(self, out: &mut Vec<u64>)
fn components(self, out: &mut Vec<u64>)
The path as plain components, resolved by walking the handle chain rather than the
interner. This is what crosses a thread boundary: a worker names what it changed with
components, and the main thread re-establishes them on its own side when it announces.
fn with_value_untracked<R>(self, f: impl FnOnce(Option<&T>) -> R) -> R
Source§fn update_value(self, f: impl FnOnce(&mut T)) -> bool
fn update_value(self, f: impl FnOnce(&mut T)) -> bool
Returns false when the value is gone (a deleted row), in which case nothing is
announced either.
fn bump_version(self)
Auto Trait Implementations§
impl<T> !Send for ModelSlot<T>
impl<T> !Sync for ModelSlot<T>
impl<T> Freeze for ModelSlot<T>
impl<T> RefUnwindSafe for ModelSlot<T>
impl<T> Unpin for ModelSlot<T>
impl<T> UnsafeUnpin for ModelSlot<T>
impl<T> UnwindSafe for ModelSlot<T>
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