1 #[derive(Derivative)] 2 #[derivative(PartialEq, Hash)] 3 pub struct Version { 4 /// The major version. 5 pub major: u64, 6 /// The minor version. 7 pub minor: u64, 8 /// The patch version. 9 pub patch: u64, 10 /// The pre-release version identifier. 11 pub pre: Vec<Identifier>, 12 // We should ignore build metadata 13 // here, otherwise versions v1 and 14 // v2 can exist such that !(v1 < v2) 15 // && !(v1 > v2) && v1 != v2, which 16 // violate strict total ordering rules. 17 #[derivative(PartialEq="ignore")] 18 #[derivative(Hash="ignore")] 19 /// The build metadata, ignored when 20 /// determining version precedence. 21 pub build: Vec<Identifier>, 22 } 23