Struct specifications::version::Version
source · pub struct Version {
pub major: u64,
pub minor: u64,
pub patch: u64,
}
Expand description
Implements the Version, which is used to keep track of package versions.
Fields§
§major: u64
The major version number. If all three are set to u64::MAX, is interpreted as an unresolved ‘latest’ version number.
minor: u64
The minor version number. If all three are set to u64::MAX, is interpreted as an unresolved ‘latest’ version number.
patch: u64
The patch version number. If all three are set to u64::MAX, is interpreted as an unresolved ‘latest’ version number.
Implementations§
source§impl Version
impl Version
sourcepub const fn new(major: u64, minor: u64, patch: u64) -> Self
pub const fn new(major: u64, minor: u64, patch: u64) -> Self
Constructor for the Version.
Note that this function panics if you try to create a ‘latest’ function this way; use latest() instead.
Arguments
major
: The major version number.minor
: The minor version number.patch
: The patch version number.
sourcepub const fn latest() -> Self
pub const fn latest() -> Self
Constructor for the Version that sets it to an (unresolved) ‘latest’ version.
sourcepub fn from_package_pair(package: &str) -> Result<(String, Self), ParseError>
pub fn from_package_pair(package: &str) -> Result<(String, Self), ParseError>
sourcepub fn resolve_latest<I: IntoIterator<Item = Self>>(
&mut self,
iter: I,
) -> Result<(), ResolveError>
pub fn resolve_latest<I: IntoIterator<Item = Self>>( &mut self, iter: I, ) -> Result<(), ResolveError>
Resolves this version in case it’s a ‘latest’ version.
Generic types
I
: The type of the iterator passed to this function.
Arguments
iter
: An iterator over resolved version numbers.
Returns
Nothing on success (except that this version now is equal to the latest version in the bunch), or a VersionError otherwise.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Ord for Version
impl Ord for Version
source§impl PartialOrd<Version> for Version
impl PartialOrd<Version> for Version
source§impl PartialOrd for Version
impl PartialOrd for Version
impl Copy for Version
impl Eq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key
and return true
if they are equal.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
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request