[][src]Struct rocfl::VersionNum

pub struct VersionNum {
    pub number: u32,
    pub width: usize,
}

Represents an OCFL object version.

Fields

number: u32width: usize

Implementations

impl VersionNum[src]

pub fn previous(&self) -> Result<VersionNum>[src]

Returns the previous version, or an Error if the previous version is invalid (less than 1).

pub fn next(&self) -> Result<VersionNum>[src]

Returns the next version, or an Error if the next version is invalid. Version number only have limits if they are zero-padded.

Trait Implementations

impl Clone for VersionNum[src]

impl Debug for VersionNum[src]

impl<'de> Deserialize<'de> for VersionNum[src]

impl Display for VersionNum[src]

impl Eq for VersionNum[src]

impl FromStr for VersionNum[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

This function is used when parsing command line arguments. It attempts to interpret a string as a version if it is formatted like any of these examples: v3, v00009, or 8.

impl Hash for VersionNum[src]

impl Ord for VersionNum[src]

impl PartialEq<VersionNum> for VersionNum[src]

impl PartialOrd<VersionNum> for VersionNum[src]

impl<'_> TryFrom<&'_ str> for VersionNum[src]

type Error = RocflError

The type returned in the event of a conversion error.

fn try_from(version: &str) -> Result<Self, Self::Error>[src]

Parses a string in the format of v1 or v0002 into a VersionNum. An error is return if the version string is invalid.

impl TryFrom<u32> for VersionNum[src]

type Error = RocflError

The type returned in the event of a conversion error.

fn try_from(version: u32) -> Result<Self, Self::Error>[src]

Parses a positive integer into a VersionNum. An error is returned if it is invalid.

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.