ssh/model/
u32iter.rs

1pub(crate) struct U32Iter {
2    num: u32,
3}
4
5impl Iterator for U32Iter {
6    type Item = u32;
7
8    fn next(&mut self) -> Option<Self::Item> {
9        if self.num == u32::MAX {
10            self.num = 0;
11        } else {
12            self.num += 1;
13        }
14        Some(self.num)
15    }
16}
17
18impl Default for U32Iter {
19    fn default() -> Self {
20        Self { num: u32::MAX }
21    }
22}