1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
pub struct Flag { set: bool, } impl Flag { pub fn new() -> Self { Self { set: false } } pub fn set(&mut self) { self.set = true; } pub fn reset(&mut self) { self.set = false; } pub fn is_set(&self) -> bool { return self.set; } }