| 248 | /// Represents a set of values that increment/decrement at a fixed rate. |
| 249 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
| 250 | pub struct Counter { |
| 251 | /// The initial value of the counter. |
| 252 | pub start: i64, |
| 253 | |
| 254 | /// The amount the counter increments/decrements each step. |
| 255 | pub stride: i64, |
| 256 | |
| 257 | /// The final value of the counter. |
| 258 | pub end: i64, |
| 259 | } |
| 260 | |
| 261 | impl Counter { |
| 262 | /// Return the number of steps between the start and end of the counter. |