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]
&self,
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8
) -> Version
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]
&self,
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8,
build: i64
) -> Version
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]
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]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
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]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
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]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
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]
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]
fn is_compatible(&self, lhs: &Version, rhs: &Version) -> bool
[src]
Implementors
impl<T> VersionAPI for T where
T: VersionBinding,
[src]
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]
&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
[src]
&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>
[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]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
fn as_string_long(
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
fn as_string_full(
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>
[src]
&self,
version: &Version,
buffer: impl AsMut<str>
) -> Result<usize, Error>