Disable the counter
(&mut self)
| 107 | // Increment the counter by a specific amount. Clamps at the limit. |
| 108 | // Returns the actual amount the counter was incremented by. |
| 109 | fn increment_by(&mut self, amount: u32) -> u32 { |
| 110 | if !self.enabled { |
| 111 | return 0; // Not enabled, incremented by 0 |
| 112 | } |
| 113 | |
| 114 | let current_count = self.count; |