1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
pub struct Quit{ need_quit : bool } impl Quit { pub(in crate) fn new() -> Quit { Quit { need_quit : false } } pub fn need_quit(&self) -> bool { self.need_quit } pub fn quit(&mut self) { self.need_quit = true } }