pub struct PreRelease(/* private fields */);Expand description
A parsed pre-release identifier list such as alpha.1.
Implementations§
Source§impl PreRelease
impl PreRelease
Sourcepub fn new(s: &str) -> Result<Self, SemverError>
pub fn new(s: &str) -> Result<Self, SemverError>
Parse a pre-release identifier list such as alpha.1.
§Examples
use js_semver::PreRelease;
let pre = PreRelease::new("alpha.1").unwrap();
assert_eq!(pre.to_string(), "alpha.1");§Errors
Returns SemverError if s is not valid pre-release metadata.
Trait Implementations§
Source§impl Clone for PreRelease
impl Clone for PreRelease
Source§fn clone(&self) -> PreRelease
fn clone(&self) -> PreRelease
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PreRelease
impl Debug for PreRelease
Source§impl Default for PreRelease
impl Default for PreRelease
Source§fn default() -> PreRelease
fn default() -> PreRelease
Returns the “default value” for a type. Read more
Source§impl Display for PreRelease
impl Display for PreRelease
impl Eq for PreRelease
Source§impl FromStr for PreRelease
impl FromStr for PreRelease
Source§impl Ord for PreRelease
impl Ord for PreRelease
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PreRelease
impl PartialEq for PreRelease
Source§impl PartialOrd for PreRelease
impl PartialOrd for PreRelease
impl StructuralPartialEq for PreRelease
Auto Trait Implementations§
impl Freeze for PreRelease
impl RefUnwindSafe for PreRelease
impl Send for PreRelease
impl Sync for PreRelease
impl Unpin for PreRelease
impl UnsafeUnpin for PreRelease
impl UnwindSafe for PreRelease
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