Struct embedded_semver::Semver[][src]

pub struct Semver {
    pub major: usize,
    pub minor: usize,
    pub patch: usize,
    // some fields omitted
}

Represents a version number conforming to the semantic versioning scheme

Conversions:

Wikipedia explains semantic versioning and the fields in detail.

Fields

major: usize

The semantic versioning major version (high risk)

minor: usize

The semantic versioning minor version (medium risk)

patch: usize

The semantic versioning patch version (lowest risk)

Implementations

impl Semver[src]

pub fn new(major: usize, minor: usize, patch: usize) -> Self[src]

Helper for constructing new instance

pub fn from_i64(n: i64) -> Result<Self, Error>[src]

Construct from an i64

pub fn from_u64(n: u64) -> Result<Self, Error>[src]

Construct from an u64

pub fn from_i32(n: i32) -> Result<Self, Error>[src]

Construct from an i32

pub fn from_u32(n: u32) -> Result<Self, Error>[src]

Construct from an u32

pub fn to_i32(&self) -> Result<i32, Error>[src]

Convert to an i32. Errs if any of the fields overflow

pub fn to_u32(&self) -> Result<u32, Error>[src]

Convert to an u32. Errs if any of the fields overflow

pub fn to_i64(&self) -> Result<i64, Error>[src]

Convert to an u64. Errs if any of the fields overflow

pub fn to_u64(&self) -> Result<u64, Error>[src]

Convert to an u64. Errs if any of the fields overflow

Trait Implementations

impl Debug for Semver[src]

impl PartialEq<Semver> for Semver[src]

impl StructuralPartialEq for Semver[src]

Auto Trait Implementations

impl RefUnwindSafe for Semver

impl Send for Semver

impl Sync for Semver

impl Unpin for Semver

impl UnwindSafe for Semver

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Tap for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.