pub struct TreeMovesDriver {
pub can_move: Box<dyn Fn(u64, Option<u64>, Option<usize>) -> MoveVerdict>,
pub moved: Box<dyn Fn(u64, Option<u64>, Option<usize>)>,
}Expand description
The move closures the tree() piece supplies (docs/tree.md). Exposed to the backend as
day_spec::TreeMoves by the tree source adapter; also driven directly by tree_try_move
(the dayscript tree_move: step and the mock probe).
Fields§
§can_move: Box<dyn Fn(u64, Option<u64>, Option<usize>) -> MoveVerdict>Consult the guards (structural + the app’s): may token land under parent at
index? index: None = dropped onto the parent (append).
moved: Box<dyn Fn(u64, Option<u64>, Option<usize>)>Commit an accepted move: defers the app’s on_move through the event queue
(day_spec::Event::TreeMove); the app’s own data write drives the reload.
Auto Trait Implementations§
impl !RefUnwindSafe for TreeMovesDriver
impl !Send for TreeMovesDriver
impl !Sync for TreeMovesDriver
impl !UnwindSafe for TreeMovesDriver
impl Freeze for TreeMovesDriver
impl Unpin for TreeMovesDriver
impl UnsafeUnpin for TreeMovesDriver
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
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