ferroui_base/utilities/
cancel_event_args.rs1use std::cell::Cell;
2use std::rc::Rc;
3
4#[derive(Clone, Debug, Default)]
11pub struct CancelEventArgs {
12 cancel: Rc<Cell<bool>>,
13}
14
15impl PartialEq for CancelEventArgs {
16 fn eq(&self, other: &Self) -> bool {
17 Rc::ptr_eq(&self.cancel, &other.cancel)
18 }
19}
20
21impl CancelEventArgs {
22 pub fn new() -> Self {
24 Self::default()
25 }
26
27 pub fn cancel(&self) -> bool {
29 self.cancel.get()
30 }
31
32 pub fn set_cancel(&self, value: bool) {
33 self.cancel.set(value)
34 }
35}