electron_sys/interface/
upload_progress.rs

1use wasm_bindgen::prelude::*;
2
3#[wasm_bindgen]
4#[derive(Clone, Copy, Debug, Eq, Ord, Hash, PartialEq, PartialOrd)]
5pub struct UploadProgress {
6    active: bool,
7    current: usize,
8    started: bool,
9    total: usize,
10}
11
12#[wasm_bindgen]
13impl UploadProgress {
14    #[wasm_bindgen(constructor)]
15    pub fn new(active: bool, current: usize, started: bool, total: usize) -> UploadProgress {
16        UploadProgress {
17            active,
18            current,
19            started,
20            total,
21        }
22    }
23
24    #[wasm_bindgen(getter)]
25    pub fn active(&self) -> bool {
26        self.active
27    }
28
29    #[wasm_bindgen(setter)]
30    pub fn set_active(&mut self, value: bool) {
31        self.active = value;
32    }
33
34    #[wasm_bindgen(getter)]
35    pub fn current(&self) -> usize {
36        self.current
37    }
38
39    #[wasm_bindgen(setter)]
40    pub fn set_current(&mut self, value: usize) {
41        self.current = value;
42    }
43
44    #[wasm_bindgen(getter)]
45    pub fn started(&self) -> bool {
46        self.started
47    }
48
49    #[wasm_bindgen(setter)]
50    pub fn set_started(&mut self, value: bool) {
51        self.started = value;
52    }
53
54    #[wasm_bindgen(getter)]
55    pub fn total(&self) -> usize {
56        self.total
57    }
58
59    #[wasm_bindgen(setter)]
60    pub fn set_total(&mut self, value: usize) {
61        self.total = value;
62    }
63}