pub struct ModelVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
pub pre_release: Option<String>,
pub build: Option<String>,
}Expand description
Model version identifier
Fields§
§major: u32Major version (breaking changes)
minor: u32Minor version (new features, backward compatible)
patch: u32Patch version (bug fixes, backward compatible)
pre_release: Option<String>Optional pre-release identifier
build: Option<String>Build metadata
Implementations§
Source§impl ModelVersion
impl ModelVersion
Sourcepub fn with_pre_release(self, pre_release: String) -> Self
pub fn with_pre_release(self, pre_release: String) -> Self
Create a version with pre-release identifier
Sourcepub fn with_build(self, build: String) -> Self
pub fn with_build(self, build: String) -> Self
Create a version with build metadata
Sourcepub fn is_compatible_with(&self, other: &ModelVersion) -> bool
pub fn is_compatible_with(&self, other: &ModelVersion) -> bool
Check if this version is compatible with another version
Sourcepub fn is_newer_than(&self, other: &ModelVersion) -> bool
pub fn is_newer_than(&self, other: &ModelVersion) -> bool
Check if this version is newer than another
Sourcepub fn requires_migration_from(&self, other: &ModelVersion) -> bool
pub fn requires_migration_from(&self, other: &ModelVersion) -> bool
Check if this version requires migration from another
Trait Implementations§
Source§impl Clone for ModelVersion
impl Clone for ModelVersion
Source§fn clone(&self) -> ModelVersion
fn clone(&self) -> ModelVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelVersion
impl Debug for ModelVersion
Source§impl Display for ModelVersion
impl Display for ModelVersion
impl Eq for ModelVersion
Source§impl FromStr for ModelVersion
impl FromStr for ModelVersion
Source§impl Hash for ModelVersion
impl Hash for ModelVersion
Source§impl PartialEq for ModelVersion
impl PartialEq for ModelVersion
impl StructuralPartialEq for ModelVersion
Auto Trait Implementations§
impl Freeze for ModelVersion
impl RefUnwindSafe for ModelVersion
impl Send for ModelVersion
impl Sync for ModelVersion
impl Unpin for ModelVersion
impl UnsafeUnpin for ModelVersion
impl UnwindSafe for ModelVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more