pub trait TreeConn: 'static {
type Slot: Copy + 'static;
type Key: Clone + Hash + Eq + 'static;
// Required methods
fn refresh(&self) -> Vec<(u64, Option<u64>)>;
fn tokens_now(&self) -> Vec<u64>;
fn children_len(&self, parent: Option<u64>) -> usize;
fn child_token(&self, parent: Option<u64>, index: usize) -> u64;
fn parent_of(&self, token: u64) -> Option<Option<u64>>;
fn key_of(&self, token: u64) -> Option<Self::Key>;
fn token_of(&self, key: &Self::Key) -> u64;
fn slot_for(&self, token: u64) -> Option<Self::Slot>;
fn rebind(&self, slot: &Self::Slot, token: u64);
fn values_flow_by_reload(&self) -> bool;
}Expand description
One tree’s live connection to its data, held for the life of the tree that connected
it. All hierarchy queries are TOKEN-addressed (docs/tree.md): None = the root level.
Required Associated Types§
Required Methods§
Sourcefn refresh(&self) -> Vec<(u64, Option<u64>)>
fn refresh(&self) -> Vec<(u64, Option<u64>)>
Refresh the snapshot and return the tree’s shape: (token, parent) pairs in walk
order. A tracked read: the enclosing watch re-runs exactly when something this read
depends on changes.
Sourcefn tokens_now(&self) -> Vec<u64>
fn tokens_now(&self) -> Vec<u64>
Every token in the current snapshot, walk order, no refresh and no tracking.
fn children_len(&self, parent: Option<u64>) -> usize
fn child_token(&self, parent: Option<u64>, index: usize) -> u64
Sourcefn parent_of(&self, token: u64) -> Option<Option<u64>>
fn parent_of(&self, token: u64) -> Option<Option<u64>>
Some(parent) for a known token (Some(None) = a root row), None for an unknown one.
fn key_of(&self, token: u64) -> Option<Self::Key>
Sourcefn slot_for(&self, token: u64) -> Option<Self::Slot>
fn slot_for(&self, token: u64) -> Option<Self::Slot>
A fresh slot for token (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, token: u64)
fn rebind(&self, slot: &Self::Slot, token: u64)
Point an existing slot at token: the recycle write.
Sourcefn values_flow_by_reload(&self) -> bool
fn values_flow_by_reload(&self) -> bool
Whether row VALUES reach existing rows only through reload→rebind (see
RowConn::values_flow_by_reload).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".