Trait emf_core_base_rs_ffi::version::api::VersionBinding [−][src]
pub trait VersionBinding {}Show methods
unsafe fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version; unsafe fn new_long(
&self,
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8
) -> Version; unsafe fn new_full(
&self,
major: i32,
minor: i32,
patch: i32,
release_type: ReleaseType,
release_number: i8,
build: i64
) -> Version; unsafe fn from_string(
&self,
buffer: NonNullConst<ConstSpan<u8>>
) -> Result<Version, Error>; unsafe fn string_length_short(
&self,
version: NonNullConst<Version>
) -> usize; unsafe fn string_length_long(&self, version: NonNullConst<Version>) -> usize; unsafe fn string_length_full(&self, version: NonNullConst<Version>) -> usize; unsafe fn as_string_short(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>; unsafe fn as_string_long(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>; unsafe fn as_string_full(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>; unsafe fn string_is_valid(
&self,
version_string: NonNullConst<ConstSpan<u8>>
) -> Bool; unsafe fn compare(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32; unsafe fn compare_weak(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32; unsafe fn compare_strong(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32; unsafe fn is_compatible(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> Bool;
Helper trait for using the version api.
Required methods
unsafe 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.
Safety
The function crosses the ffi boundary.
unsafe 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.
Safety
The function crosses the ffi boundary.
unsafe 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.
Safety
The function crosses the ffi boundary.
unsafe fn from_string(
&self,
buffer: NonNullConst<ConstSpan<u8>>
) -> Result<Version, Error>
[src]
&self,
buffer: NonNullConst<ConstSpan<u8>>
) -> Result<Version, Error>
Constructs a version from a string.
Failure
Fails if string_is_valid(buffer) == Bool::False
.
Return
Constructed version.
Safety
The function crosses the ffi boundary.
unsafe fn string_length_short(&self, version: NonNullConst<Version>) -> usize
[src]
Computes the length of the short version string.
Return
Length of the string.
Safety
The function crosses the ffi boundary.
unsafe fn string_length_long(&self, version: NonNullConst<Version>) -> usize
[src]
Computes the length of the long version string.
Return
Length of the string.
Safety
The function crosses the ffi boundary.
unsafe fn string_length_full(&self, version: NonNullConst<Version>) -> usize
[src]
Computes the length of the full version string.
Return
Length of the string.
Safety
The function crosses the ffi boundary.
unsafe fn as_string_short(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
Represents the version as a short string.
Failure
This function fails if buffer.as_ref.len() < string_length_short(version)
.
Return
Number of written characters on success, error otherwise.
Safety
The function crosses the ffi boundary.
unsafe fn as_string_long(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
Represents the version as a long string.
Failure
This function fails if buffer.as_ref.len() < string_length_long(version)
.
Return
Number of written characters on success, error otherwise.
Safety
The function crosses the ffi boundary.
unsafe fn as_string_full(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
Represents the version as a full string.
Failure
This function fails if buffer.as_ref.len() < string_length_full(version)
.
Return
Number of written characters on success, error otherwise.
Safety
The function crosses the ffi boundary.
unsafe fn string_is_valid(
&self,
version_string: NonNullConst<ConstSpan<u8>>
) -> Bool
[src]
&self,
version_string: NonNullConst<ConstSpan<u8>>
) -> Bool
Checks whether the version string is valid.
Return
Bool::True if the string is valid, Bool::False otherwise.
Safety
The function crosses the ffi boundary.
unsafe fn compare(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
Compares two versions.
Compares two version, disregarding their build number.
Return
-1
iflhs
>rhs
.0
iflhs
==rhs
.1
iflhs
<rhs
.
Safety
The function crosses the ffi boundary.
unsafe fn compare_weak(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
Compares two versions.
Compares two version, disregarding their build number and release type.
Return
-1
iflhs
>rhs
.0
iflhs
==rhs
.1
iflhs
<rhs
.
Safety
The function crosses the ffi boundary.
unsafe fn compare_strong(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
Compares two versions.
Return
-1
iflhs
>rhs
.0
iflhs
==rhs
.1
iflhs
<rhs
.
Safety
The function crosses the ffi boundary.
unsafe fn is_compatible(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> Bool
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> Bool
Checks for compatibility of two versions.
Two compatible versions can be used interchangeably.
Note
This function is not commutative.
Return
Bool::True if the versions are compatible, Bool::False otherwise.
Safety
The function crosses the ffi boundary.
Implementors
impl VersionBinding for CBaseInterface
[src]
impl VersionBinding for CBaseInterface
[src]unsafe fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version
[src]
unsafe 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
unsafe 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
unsafe fn from_string(
&self,
buffer: NonNullConst<ConstSpan<u8>>
) -> Result<Version, Error>
[src]
&self,
buffer: NonNullConst<ConstSpan<u8>>
) -> Result<Version, Error>
unsafe fn string_length_short(&self, version: NonNullConst<Version>) -> usize
[src]
unsafe fn string_length_long(&self, version: NonNullConst<Version>) -> usize
[src]
unsafe fn string_length_full(&self, version: NonNullConst<Version>) -> usize
[src]
unsafe fn as_string_short(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
unsafe fn as_string_long(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
unsafe fn as_string_full(
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
[src]
&self,
version: NonNullConst<Version>,
buffer: NonNull<MutSpan<u8>>
) -> Result<usize, Error>
unsafe fn string_is_valid(
&self,
version_string: NonNullConst<ConstSpan<u8>>
) -> Bool
[src]
&self,
version_string: NonNullConst<ConstSpan<u8>>
) -> Bool
unsafe fn compare(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
unsafe fn compare_weak(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
unsafe fn compare_strong(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> i32
unsafe fn is_compatible(
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> Bool
[src]
&self,
lhs: NonNullConst<Version>,
rhs: NonNullConst<Version>
) -> Bool