Type Alias Version

Source
pub type Version = Semver;

Aliased Type§

struct Version {
    pub components: Vec<usize>,
    pub major: usize,
    pub minor: usize,
    pub patch: usize,
    pub prerelease: Vec<String>,
    pub build: Vec<String>,
    pub raw: String,
}

Fields§

§components: Vec<usize>§major: usize§minor: usize§patch: usize§prerelease: Vec<String>§build: Vec<String>§raw: String

Implementations

Source§

impl Semver

Source

pub fn bump(&self, which: &SemverComponent) -> Result<Semver, Error>

Source§

impl Semver

Source

pub fn neq(&self, other: &Semver) -> bool

Source

pub fn gt(&self, other: &Semver) -> bool

Source

pub fn lt(&self, other: &Semver) -> bool

Source§

impl Semver

Source

pub fn infinty() -> Semver

Source§

impl Semver

Source

pub fn parse(semver: &str) -> Result<Semver, Error>

Source

pub fn from(input: (usize, usize, usize)) -> Result<Semver, Error>

Trait Implementations

Source§

impl Clone for Semver

Source§

fn clone(&self) -> Semver

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Semver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Semver

Source§

fn default() -> Semver

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Semver

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Semver, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Semver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Hash for Semver

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Semver

Source§

fn cmp(&self, other: &Semver) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Semver

Source§

fn eq(&self, other: &Semver) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Semver

Source§

fn partial_cmp(&self, other: &Semver) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Semver

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Semver