(&mut self)
| 26 | } |
| 27 | |
| 28 | pub fn check_timeout(&mut self) -> bool { |
| 29 | if let Some(start) = self.start_time { |
| 30 | if start.elapsed() > Duration::from_millis(LEADER_TIMEOUT_MS) { |
| 31 | self.reset(); |
| 32 | return true; |
| 33 | } |
| 34 | } |
| 35 | false |
| 36 | } |
| 37 | |
| 38 | pub fn reset(&mut self) { |
| 39 | self.active = false; |