1#[derive(Copy, Clone, Debug, PartialEq)] 2pub struct Version(pub u16); 3 4impl Version { 5 pub fn num(self) -> u16 { 6 self.0 7 } 8 9 pub fn bytes_per_offset(self) -> usize { 10 if self.0 >= 11 { 11 8 12 } else { 13 4 14 } 15 } 16}