pub struct TreeDriver {
pub row_height: RowHeight,
pub children_len: Box<dyn Fn(Option<u64>) -> usize>,
pub child_token: Box<dyn Fn(Option<u64>, usize) -> u64>,
pub expandable: Box<dyn Fn(u64) -> bool>,
pub section_header: Box<dyn Fn(u64) -> bool>,
pub expanded: Box<dyn Fn(u64) -> bool>,
pub build: Box<dyn Fn(u64, RNode) -> TreeBuiltRow>,
pub type_select_text: Box<dyn Fn(u64) -> String>,
pub resolve_row: RowResolver,
pub row_menu: Option<RowMenuFn>,
pub moves: Option<TreeMovesDriver>,
}Expand description
Supplied by the tree() piece, type-erased over the item type. day-core invokes these to
answer the native data-source and to build/rebind rows. All hierarchy queries are
token-addressed (None = the root level); see docs/tree.md for why indices cannot
address tree rows.
Fields§
§row_height: RowHeight§children_len: Box<dyn Fn(Option<u64>) -> usize>How many children parent has (reads the piece’s snapshot; no tree access).
child_token: Box<dyn Fn(Option<u64>, usize) -> u64>The i-th child of parent: the stable token every backend keys its rows by.
expandable: Box<dyn Fn(u64) -> bool>Whether this token can hold children at all (draws or omits the disclosure).
section_header: Box<dyn Fn(u64) -> bool>§expanded: Box<dyn Fn(u64) -> bool>The piece’s current desired expansion state for this token (untracked read of the app’s expansion signal), which is what the flattener descends into.
build: Box<dyn Fn(u64, RNode) -> TreeBuiltRow>Build the row for token into anchor. Uses BuildCx internally, so it must be
called with no with_tree borrow held. Returns the row’s scope + a rebind writer.
type_select_text: Box<dyn Fn(u64) -> String>The row’s type-ahead string (docs/tree.md); native type-select answers from it.
resolve_row: RowResolverResolve a dayscript row id (the piece’s .row_id string) to its token. This is how the
expand:/tree_move: steps and the mock address rows without native gestures.
The row’s summon-time context menu (docs/menus.md), None = no row menus.
moves: Option<TreeMovesDriver>Drag-to-move half, present when the piece is .movable(true) (docs/tree.md).
Auto Trait Implementations§
impl !RefUnwindSafe for TreeDriver
impl !Send for TreeDriver
impl !Sync for TreeDriver
impl !UnwindSafe for TreeDriver
impl Freeze for TreeDriver
impl Unpin for TreeDriver
impl UnsafeUnpin for TreeDriver
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
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> ⓘ
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> ⓘ
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