dioxus_gestures/state/
options.rs

1use nanoid::nanoid;
2
3#[derive(Clone)]
4pub struct UseGesturesOptions {
5    pub target_id_attribute_name: &'static str,
6    pub target_id: String,
7}
8
9impl UseGesturesOptions {
10    pub fn target_id_attribute_name(mut self, attribute_name: &'static str) -> Self {
11        self.target_id_attribute_name = attribute_name;
12        self
13    }
14}
15
16impl UseGesturesOptions {
17    pub fn target_id(mut self, target_id: String) -> Self {
18        self.target_id = target_id;
19        self
20    }
21}
22
23impl Default for UseGesturesOptions {
24    fn default() -> Self {
25        Self { target_id_attribute_name: "data-gestures-id", target_id: nanoid!() }
26    }
27}