pub struct ListSwipe {
pub actions_at: Rc<dyn Fn(usize, SwipeEdge) -> Vec<ListSwipeAction>>,
pub perform: Rc<dyn Fn(usize, SwipeEdge, usize)>,
}Expand description
The synchronous swipe-actions half of ListSource (docs/list.md), the generalized
sibling of ListDelete: reveal-as-you-swipe buttons on either row edge. The offer is
pulled per row at gesture time, so labels follow row state (“Mark Read” on an unread row,
“Mark Unread” on a read one); the commit defers to the event drain like every closure here.
Fields§
§actions_at: Rc<dyn Fn(usize, SwipeEdge) -> Vec<ListSwipeAction>>The offer: the actions for row index on edge, called inside the platform’s swipe
callback, so keep it pure. Empty = no affordance for that row and edge. The first action
is the full-swipe action where the platform activates one at the far edge.
perform: Rc<dyn Fn(usize, SwipeEdge, usize)>The commit: the user activated action action (an index into the offer) on row
index, edge. Unlike a delete this never reshapes the row snapshot; the app’s
handler is deferred to the next event drain, never run inside the native callback.