pub struct SpecVersion { /* private fields */ }Expand description
Description of a version of the FEF specification.
Holds information about the major, minor, and micro version of the FEF specification.
§Examples
Getting a version string:
let version = fef::common::version::SpecVersion::new(1, 2, 3);
assert_eq!(format!("{}", version), "v1.2.3");Implementations§
Source§impl SpecVersion
impl SpecVersion
Sourcepub const fn new(major: u32, minor: u32, micro: u32) -> SpecVersion
pub const fn new(major: u32, minor: u32, micro: u32) -> SpecVersion
Creates a new SpecVersion with the given major, minor, and micro version numbers.
§Examples
let version = SpecVersion::new(1, 2, 3);
assert_eq!(version.major(), 1);
assert_eq!(version.minor(), 2);
assert_eq!(version.micro(), 3);Sourcepub const fn major(&self) -> u32
pub const fn major(&self) -> u32
Returns the major version number.
§Examples
let version = SpecVersion::new(1, 2, 3);
assert_eq!(version.major(), 1);Trait Implementations§
Source§impl Clone for SpecVersion
impl Clone for SpecVersion
Source§fn clone(&self) -> SpecVersion
fn clone(&self) -> SpecVersion
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpecVersion
Formats the version as a string when displayed in the format “SpecVersion({MAJOR}.{MINOR}.{MICRO})”.
impl Debug for SpecVersion
Formats the version as a string when displayed in the format “SpecVersion({MAJOR}.{MINOR}.{MICRO})”.
§Examples
let version = SpecVersion::new(1, 2, 3);
assert_eq!(format!("{:?}", version), "SpecVersion(1.2.3)");Source§impl Default for SpecVersion
Implements the default value for SpecVersion as SpecVersion(0.0.0).
impl Default for SpecVersion
Implements the default value for SpecVersion as SpecVersion(0.0.0).
§Examples
let version = SpecVersion::default();
assert_eq!(version, SpecVersion::new(0, 0, 0));Source§impl Display for SpecVersion
Formats the version as a string when displayed in the format “v{MAJOR}.{MINOR}.{MICRO}”.
impl Display for SpecVersion
Formats the version as a string when displayed in the format “v{MAJOR}.{MINOR}.{MICRO}”.
§Examples
let version = SpecVersion::new(1, 2, 3);
assert_eq!(format!("{}", version), "v1.2.3");Source§impl Hash for SpecVersion
impl Hash for SpecVersion
Source§impl Ord for SpecVersion
Versions are ordered by their major, minor, and micro version numbers lexicographically.
impl Ord for SpecVersion
Versions are ordered by their major, minor, and micro version numbers lexicographically.
§Examples
let version1 = SpecVersion::new(1, 2, 3);
let version2 = SpecVersion::new(1, 2, 4);
let version3 = SpecVersion::new(1, 3, 0);
let version4 = SpecVersion::new(2, 0, 0);
assert!(version1 < version2);
assert!(version2 < version3);
assert!(version3 < version4);Source§impl PartialEq for SpecVersion
impl PartialEq for SpecVersion
Source§impl PartialOrd for SpecVersion
impl PartialOrd for SpecVersion
impl Copy for SpecVersion
impl Eq for SpecVersion
impl StructuralPartialEq for SpecVersion
Auto Trait Implementations§
impl Freeze for SpecVersion
impl RefUnwindSafe for SpecVersion
impl Send for SpecVersion
impl Sync for SpecVersion
impl Unpin for SpecVersion
impl UnwindSafe for SpecVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more