pub struct ListReorder {
pub can_move: Rc<dyn Fn(usize, usize) -> i64>,
pub move_row: Rc<dyn Fn(usize, usize)>,
}Expand description
The synchronous drag-to-reorder half of ListSource (docs/list.md). Both closures follow
bind_row’s discipline: called on the UI thread from inside native drag callbacks, outside
any day-core borrow, and they run to completion synchronously.
Fields§
§can_move: Rc<dyn Fn(usize, usize) -> i64>May row from drop at row to? Called from the native validate/hover hook so the
affordance (gap, insertion mark, forbidden cursor) reflects the app’s answer live.
Returns the accepted target index: to itself to allow, another index to retarget the
drop, or -1 to deny.
move_row: Rc<dyn Fn(usize, usize)>Commit: row from dropped at row to (an index can_move accepted). Rotates Day’s row
snapshot before returning (so len/token_at/bind_row reflect the new order while the
native move animates) and defers the app’s own callback to the next event drain.
Trait Implementations§
Source§impl Clone for ListReorder
impl Clone for ListReorder
Source§fn clone(&self) -> ListReorder
fn clone(&self) -> ListReorder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more