pub struct Version(Version);Expand description
A semantic version wrapper used throughout the model layer.
Tuple Fields§
§0: VersionImplementations§
Source§impl Version
impl Version
Sourcepub fn new(major: u64, minor: u64, patch: u64) -> Self
pub fn new(major: u64, minor: u64, patch: u64) -> Self
Build a version from explicit major, minor, and patch components.
Sourcepub fn parse(value: &str) -> Result<Self, ModelError>
pub fn parse(value: &str) -> Result<Self, ModelError>
Parse a strict semantic version string.
Sourcepub fn parse_lossy(value: &str) -> Result<Self, ModelError>
pub fn parse_lossy(value: &str) -> Result<Self, ModelError>
Parses a version string, accepting common Winget-style variants.
pub fn as_semver(&self) -> &Version
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
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 Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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