Trait emf_core_base_rs::version::VersionAPI[][src]

pub trait VersionAPI {
Show methods fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version;
fn new_long(
        &self,
        major: i32,
        minor: i32,
        patch: i32,
        release_type: ReleaseType,
        release_number: i8
    ) -> Version;
fn new_full(
        &self,
        major: i32,
        minor: i32,
        patch: i32,
        release_type: ReleaseType,
        release_number: i8,
        build: i64
    ) -> Version;
fn from_string(&self, buffer: impl AsRef<str>) -> Result<Version, Error>;
fn string_length_short(&self, version: &Version) -> usize;
fn string_length_long(&self, version: &Version) -> usize;
fn string_length_full(&self, version: &Version) -> usize;
fn as_string_short(
        &self,
        version: &Version,
        buffer: impl AsMut<str>
    ) -> Result<usize, Error>;
fn as_string_long(
        &self,
        version: &Version,
        buffer: impl AsMut<str>
    ) -> Result<usize, Error>;
fn as_string_full(
        &self,
        version: &Version,
        buffer: impl AsMut<str>
    ) -> Result<usize, Error>;
fn string_is_valid(&self, version_string: impl AsRef<str>) -> bool;
fn compare(&self, lhs: &Version, rhs: &Version) -> Ordering;
fn compare_weak(&self, lhs: &Version, rhs: &Version) -> Ordering;
fn compare_strong(&self, lhs: &Version, rhs: &Version) -> Ordering;
fn is_compatible(&self, lhs: &Version, rhs: &Version) -> bool;
}

Trait for providing access to the version api.

Required methods

fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version[src]

Constructs a new version.

Constructs a new version with major, minor and patch and sets the rest to 0.

Return

Constructed version.

fn new_long(
    &self,
    major: i32,
    minor: i32,
    patch: i32,
    release_type: ReleaseType,
    release_number: i8
) -> Version
[src]

Constructs a new version.

Constructs a new version with major, minor, patch, release_type and release_number and sets the rest to 0.

Return

Constructed version.

fn new_full(
    &self,
    major: i32,
    minor: i32,
    patch: i32,
    release_type: ReleaseType,
    release_number: i8,
    build: i64
) -> Version
[src]

Constructs a new version.

Constructs a new version with major, minor, patch, release_type, release_number and build.

Return

Constructed version.

fn from_string(&self, buffer: impl AsRef<str>) -> Result<Version, Error>[src]

Constructs a version from a string.

Failure

Fails if string_is_valid(buffer) == false.

Return

Constructed version.

fn string_length_short(&self, version: &Version) -> usize[src]

Computes the length of the short version string.

Return

Length of the string.

fn string_length_long(&self, version: &Version) -> usize[src]

Computes the length of the long version string.

Return

Length of the string.

fn string_length_full(&self, version: &Version) -> usize[src]

Computes the length of the full version string.

Return

Length of the string.

fn as_string_short(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

Represents the version as a short string.

Failure

This function fails if buffer.len() < string_length_short(version).

Return

Number of written characters on success, error otherwise.

fn as_string_long(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

Represents the version as a long string.

Failure

This function fails if buffer.len() < string_length_long(version).

Return

Number of written characters on success, error otherwise.

fn as_string_full(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

Represents the version as a full string.

Failure

This function fails if buffer.len() < string_length_full(version).

Return

Number of written characters on success, error otherwise.

fn string_is_valid(&self, version_string: impl AsRef<str>) -> bool[src]

Checks whether the version string is valid.

Return

true if the string is valid, false otherwise.

fn compare(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

Compares two versions.

Compares two version, disregarding their build number.

Return

Order of the versions.

fn compare_weak(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

Compares two versions.

Compares two version, disregarding their build number and release type.

Return

Order of the versions.

fn compare_strong(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

Compares two versions.

Return

Order of the versions.

fn is_compatible(&self, lhs: &Version, rhs: &Version) -> bool[src]

Checks for compatibility of two versions.

Two compatible versions can be used interchangeably.

Note

This function is not commutative.

Return

true if the versions are compatible, false otherwise.

Loading content...

Implementors

impl<T> VersionAPI for T where
    T: VersionBinding
[src]

fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version[src]

fn new_long(
    &self,
    major: i32,
    minor: i32,
    patch: i32,
    release_type: ReleaseType,
    release_number: i8
) -> Version
[src]

fn new_full(
    &self,
    major: i32,
    minor: i32,
    patch: i32,
    release_type: ReleaseType,
    release_number: i8,
    build: i64
) -> Version
[src]

fn from_string(&self, buffer: impl AsRef<str>) -> Result<Version, Error>[src]

fn string_length_short(&self, version: &Version) -> usize[src]

fn string_length_long(&self, version: &Version) -> usize[src]

fn string_length_full(&self, version: &Version) -> usize[src]

fn as_string_short(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

fn as_string_long(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

fn as_string_full(
    &self,
    version: &Version,
    buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]

fn string_is_valid(&self, version_string: impl AsRef<str>) -> bool[src]

fn compare(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

fn compare_weak(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

fn compare_strong(&self, lhs: &Version, rhs: &Version) -> Ordering[src]

fn is_compatible(&self, lhs: &Version, rhs: &Version) -> bool[src]

Loading content...