1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// A volume's index in the AWS real-time NEXRAD bucket. These indexes are rotated-through as chunks
/// are accumulated and finally combined into full volumes to be archived.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct VolumeIndex(usize);

impl VolumeIndex {
    /// Creates a new volume index with the specified value.
    pub fn new(index: usize) -> Self {
        debug_assert!(index <= 999, "Volume index must be <= 999");
        Self(index)
    }

    /// Returns the volume index as a number.
    pub fn as_number(&self) -> usize {
        self.0
    }
}