Struct GoModuleVersion
pub struct GoModuleVersion(/* private fields */);Expand description
Validated Go module version metadata.
Implementations§
§impl GoModuleVersion
impl GoModuleVersion
pub fn new(value: impl AsRef<str>) -> Result<GoModuleVersion, GoModuleError>
pub fn new(value: impl AsRef<str>) -> Result<GoModuleVersion, GoModuleError>
Creates a Go module version label.
§Errors
Returns GoModuleError when the version is empty or not lightweight vMAJOR.MINOR.PATCH-shaped.
pub fn is_pseudo_version(&self) -> bool
pub fn is_pseudo_version(&self) -> bool
Returns whether this label is pseudo-version-shaped.
Trait Implementations§
§impl AsRef<str> for GoModuleVersion
impl AsRef<str> for GoModuleVersion
§impl Clone for GoModuleVersion
impl Clone for GoModuleVersion
§fn clone(&self) -> GoModuleVersion
fn clone(&self) -> GoModuleVersion
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 more§impl Debug for GoModuleVersion
impl Debug for GoModuleVersion
§impl Display for GoModuleVersion
impl Display for GoModuleVersion
§impl FromStr for GoModuleVersion
impl FromStr for GoModuleVersion
§type Err = GoModuleError
type Err = GoModuleError
The associated error which can be returned from parsing.
§fn from_str(
value: &str,
) -> Result<GoModuleVersion, <GoModuleVersion as FromStr>::Err>
fn from_str( value: &str, ) -> Result<GoModuleVersion, <GoModuleVersion as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for GoModuleVersion
impl Hash for GoModuleVersion
§impl Ord for GoModuleVersion
impl Ord for GoModuleVersion
§impl PartialEq for GoModuleVersion
impl PartialEq for GoModuleVersion
§impl PartialOrd for GoModuleVersion
impl PartialOrd for GoModuleVersion
§impl TryFrom<&str> for GoModuleVersion
impl TryFrom<&str> for GoModuleVersion
§type Error = GoModuleError
type Error = GoModuleError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<GoModuleVersion, <GoModuleVersion as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<GoModuleVersion, <GoModuleVersion as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for GoModuleVersion
impl StructuralPartialEq for GoModuleVersion
Auto Trait Implementations§
impl Freeze for GoModuleVersion
impl RefUnwindSafe for GoModuleVersion
impl Send for GoModuleVersion
impl Sync for GoModuleVersion
impl Unpin for GoModuleVersion
impl UnsafeUnpin for GoModuleVersion
impl UnwindSafe for GoModuleVersion
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