Skip to main content

apply_click

Function apply_click 

Source
pub fn apply_click<T: Clone + 'static, K: Clone + PartialEq>(
    model: &impl Model<Data = T>,
    key: impl Fn(&T) -> K,
    flag: impl Fn(&mut T) -> &mut bool,
    item: K,
    shift: bool,
)
Expand description

Apply a click to a model whose rows carry the selection.

Reads the current selection out of the rows, resolves the click against it, and projects the answer back — the whole gesture, with no state in between. flag is the row’s own selected field, used for both halves.