pub struct BuildVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
Represents a semantic version number following the MAJOR.MINOR.PATCH format.
§Examples
use types::BuildVersion;
let version = BuildVersion::new(1, 2, 3);
assert_eq!(version.to_string(), "1.2.3");
let parsed = "1.2.3".parse::<BuildVersion>().unwrap();
assert_eq!(version, parsed);Fields§
§major: u32Major version number, incremented for incompatible API changes
minor: u32Minor version number, incremented for backwards-compatible functionality additions
patch: u32Patch version number, incremented for backwards-compatible bug fixes
Implementations§
Source§impl BuildVersion
impl BuildVersion
Sourcepub fn new(major: u32, minor: u32, patch: u32) -> BuildVersion
pub fn new(major: u32, minor: u32, patch: u32) -> BuildVersion
Creates a new BuildVersion with the specified version numbers.
§Arguments
major- The major version numberminor- The minor version numberpatch- The patch version number
Sourcepub fn min() -> BuildVersion
pub fn min() -> BuildVersion
Returns the minimum possible version (0.0.0).
Trait Implementations§
Source§impl CandidType for BuildVersion
impl CandidType for BuildVersion
Source§impl Clone for BuildVersion
impl Clone for BuildVersion
Source§fn clone(&self) -> BuildVersion
fn clone(&self) -> BuildVersion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BuildVersion
impl Debug for BuildVersion
Source§impl Default for BuildVersion
impl Default for BuildVersion
Source§fn default() -> BuildVersion
fn default() -> BuildVersion
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BuildVersion
impl<'de> Deserialize<'de> for BuildVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BuildVersion
impl Display for BuildVersion
Source§impl FromStr for BuildVersion
impl FromStr for BuildVersion
Source§impl Ord for BuildVersion
impl Ord for BuildVersion
Source§fn cmp(&self, other: &BuildVersion) -> Ordering
fn cmp(&self, other: &BuildVersion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BuildVersion
impl PartialEq for BuildVersion
Source§impl PartialOrd for BuildVersion
impl PartialOrd for BuildVersion
Source§impl Serialize for BuildVersion
impl Serialize for BuildVersion
impl Copy for BuildVersion
impl Eq for BuildVersion
impl StructuralPartialEq for BuildVersion
Auto Trait Implementations§
impl Freeze for BuildVersion
impl RefUnwindSafe for BuildVersion
impl Send for BuildVersion
impl Sync for BuildVersion
impl Unpin for BuildVersion
impl UnwindSafe for BuildVersion
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