pub enum Difference {
Major,
PreMajor,
Minor,
PreMinor,
Patch,
PrePatch,
PreRelease,
}Expand description
The kind of change between two versions.
The Pre* variants mean the higher version is a prerelease. Difference::as_str
renders the same lowercase names node-semver uses ("major", "premajor", …). The
derived Ord follows declaration order (Major < PreMajor < Minor < … < PreRelease);
it is a stable total order, not a ranking of “impact”.
Variants§
Major
A major bump (1.x.y → 2.0.0).
PreMajor
A major bump to a prerelease (1.0.0 → 2.0.0-rc).
Minor
A minor bump (1.0.x → 1.1.0).
PreMinor
A minor bump to a prerelease (1.0.0 → 1.1.0-rc).
Patch
A patch bump (1.0.0 → 1.0.1).
PrePatch
A patch bump to a prerelease (1.0.0 → 1.0.1-rc).
PreRelease
Only the prerelease identifiers differ (1.0.0-a → 1.0.0-b).
Implementations§
Source§impl Difference
impl Difference
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The node-semver name for this difference ("major", "premajor", "minor",
"preminor", "patch", "prepatch", "prerelease").
Sourcepub const fn is_prerelease(self) -> bool
pub const fn is_prerelease(self) -> bool
Whether this is one of the prerelease variants (PreMajor, PreMinor,
PrePatch, PreRelease).
Trait Implementations§
Source§impl Clone for Difference
impl Clone for Difference
Source§fn clone(&self) -> Difference
fn clone(&self) -> Difference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Difference
Source§impl Debug for Difference
impl Debug for Difference
impl Eq for Difference
Source§impl Hash for Difference
impl Hash for Difference
Source§impl Ord for Difference
impl Ord for Difference
Source§fn cmp(&self, other: &Difference) -> Ordering
fn cmp(&self, other: &Difference) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Difference
impl PartialEq for Difference
Source§fn eq(&self, other: &Difference) -> bool
fn eq(&self, other: &Difference) -> bool
self and other values to be equal, and is used by ==.