pub trait RowConn: 'static {
type Slot: Copy + 'static;
type Ref: 'static;
// Required methods
fn refresh(&self) -> Vec<u64>;
fn len(&self) -> usize;
fn token_at(&self, index: usize) -> u64;
fn tokens_now(&self) -> Vec<u64>;
fn slot_at(&self, index: usize) -> Option<Self::Slot>;
fn rebind(&self, slot: &Self::Slot, index: usize);
fn select_ref(&self, index: usize) -> Option<Self::Ref>;
fn values_flow_by_reload(&self) -> bool;
fn commit_move(&self, from: usize, to: usize);
fn commit_delete(&self, index: usize);
// Provided methods
fn is_empty(&self) -> bool { ... }
fn take_row_events(&self) -> Option<Vec<RowDelta>> { ... }
}Expand description
One collection’s live connection to its data, held for the life of the each/list that
RowSource::connected it.
Required Associated Types§
Required Methods§
Sourcefn refresh(&self) -> Vec<u64>
fn refresh(&self) -> Vec<u64>
Refresh the snapshot and return the display rows as identity tokens. A tracked read: the enclosing watch re-runs exactly when something this read depends on changes; for a store source that is the collection’s shape (or the projection’s own reads), never the fields a row merely displays.
Sourcefn tokens_now(&self) -> Vec<u64>
fn tokens_now(&self) -> Vec<u64>
The current tokens, no refresh and no tracking; the reorder/delete echo compares these.
Sourcefn slot_at(&self, index: usize) -> Option<Self::Slot>
fn slot_at(&self, index: usize) -> Option<Self::Slot>
A fresh slot for row index (None on a stale mid-animation pull). Call inside the
row’s scope: plain-data slots allocate their signals here.
Sourcefn rebind(&self, slot: &Self::Slot, index: usize)
fn rebind(&self, slot: &Self::Slot, index: usize)
Point an existing slot at row index: the recycle write.
Sourcefn select_ref(&self, index: usize) -> Option<Self::Ref>
fn select_ref(&self, index: usize) -> Option<Self::Ref>
The selection currency for row index.
Sourcefn values_flow_by_reload(&self) -> bool
fn values_flow_by_reload(&self) -> bool
Whether row values reach existing rows only through reload→rebind. Plain-data rows say
true (their slots hold copies); store rows say false (values flow through the store’s
per-field notifications), which lets list skip the native reload entirely when the
row set is unchanged.
Sourcefn commit_move(&self, from: usize, to: usize)
fn commit_move(&self, from: usize, to: usize)
Rotate the snapshot for a committed native move (display indices).
Sourcefn commit_delete(&self, index: usize)
fn commit_delete(&self, index: usize)
Drop a row from the snapshot for a committed native delete.
Provided Methods§
fn is_empty(&self) -> bool
Sourcefn take_row_events(&self) -> Option<Vec<RowDelta>>
fn take_row_events(&self) -> Option<Vec<RowDelta>>
What changed since the last refresh, if the source can say precisely: sequential
row deltas a host can animate. None means unknown: the list reloads, which is
always correct. Only sources that maintain their set incrementally (a live query)
answer Some.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".