Enum recital::version::Identifier
[−]
[src]
pub enum Identifier { Number(u64), Alpha(String), }
Represents an alphanumeric or numberic identifier.
An identifier in a semantic version number is a simple sequence of letters
(a-z, A-Z), numbers (0-9), and hyphens that can appear in any order. Each
identifier in a version number is separated by a dot (.
). Knowing the
difference between numeric and alphanumeric identifiers is important when
version numbers are being compared.
Variants
Number(u64)
Reprents a numeric identifier.
A numeric identifier, as the name implies, may only have numbers. During comparison with other identifiers, numberc identifiers are compared normally to each other. However, when a numeric identifier is compared to a numeric identifier, it will always be the lesser of the two.
Alpha(String)
Represents an alphanumeric identifier.
An alphanumeric identifier, as the name implies, may have letters and/or numbers. The letters are limited to a-z, A-Z, numbers to 0-9, and may also include one or more hyphens. During comparison with other identifiers, alphanumeric identifiers are compared normally to each other. However, when an alphanumeric identifier is compared to a numeric identifier, it will always be the greater of the two.
Trait Implementations
impl Clone for Identifier
[src]
fn clone(&self) -> Identifier
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Identifier
[src]
impl Eq for Identifier
[src]
impl Ord for Identifier
[src]
fn cmp(&self, __arg_0: &Identifier) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialEq for Identifier
[src]
fn eq(&self, __arg_0: &Identifier) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Identifier) -> bool
This method tests for !=
.
impl PartialOrd for Identifier
[src]
fn partial_cmp(&self, __arg_0: &Identifier) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Identifier) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Identifier) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Identifier) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Identifier) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Display for Identifier
[src]
impl<'a> From<&'a str> for Identifier
[src]
fn from(s: &'a str) -> Identifier
Performs the conversion.
impl From<String> for Identifier
[src]
fn from(s: String) -> Identifier
Performs the conversion.
impl From<f32> for Identifier
[src]
fn from(n: f32) -> Identifier
Performs the conversion.
impl From<f64> for Identifier
[src]
fn from(n: f64) -> Identifier
Performs the conversion.
impl From<i8> for Identifier
[src]
fn from(n: i8) -> Identifier
Performs the conversion.
impl From<i16> for Identifier
[src]
fn from(n: i16) -> Identifier
Performs the conversion.
impl From<i32> for Identifier
[src]
fn from(n: i32) -> Identifier
Performs the conversion.
impl From<i64> for Identifier
[src]
fn from(n: i64) -> Identifier
Performs the conversion.
impl From<u8> for Identifier
[src]
fn from(n: u8) -> Identifier
Performs the conversion.
impl From<u16> for Identifier
[src]
fn from(n: u16) -> Identifier
Performs the conversion.
impl From<u32> for Identifier
[src]
fn from(n: u32) -> Identifier
Performs the conversion.
impl From<u64> for Identifier
[src]
fn from(n: u64) -> Identifier
Performs the conversion.