pub struct Version {
pub major: u64,
pub minor: u64,
pub patch: u64,
}Fields§
§major: u64§minor: u64§patch: u64Implementations§
Source§impl Version
impl Version
Sourcepub fn parse(tag_str: &str, tag_prefix: &str) -> Option<Self>
pub fn parse(tag_str: &str, tag_prefix: &str) -> Option<Self>
Parse a semantic version from a tag string with optional prefix. Tries to parse with prefix first, then without prefix. Examples: “v1.2.3” with prefix “v” -> Some(Version { 1, 2, 3 }) “1.2.3” with prefix “v” -> Some(Version { 1, 2, 3 }) (fallback)
Sourcepub fn format(&self, tag_prefix: &str) -> String
pub fn format(&self, tag_prefix: &str) -> String
Format version as a semantic version string with tag prefix. Examples: Version { 1, 2, 3 } with prefix “v” -> “v1.2.3”
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnsafeUnpin 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