pub struct SdkVersion {
pub major: u32,
pub minor: u32,
}Expand description
Lightweight major.minor SDK version handle.
We avoid pulling in the full semver crate (≈170 KB) for what amounts
to a major-equal / minor-at-least check.
Fields§
§major: u32§minor: u32Implementations§
Source§impl SdkVersion
impl SdkVersion
Sourcepub fn matches(&self, constraint: &str) -> bool
pub fn matches(&self, constraint: &str) -> bool
Does this SDK version satisfy a constraint like ">=0.2",
"^0.2", or "0.2" exact?
Rules:
^X.Yand bareX.Y: same major, minor ≥ Y.>=X.Y: major ≥ X (when X > 0) or (major == X and minor ≥ Y) when X == 0.- Anything else: try a parse and require equality on
major.
Trait Implementations§
Source§impl Clone for SdkVersion
impl Clone for SdkVersion
Source§fn clone(&self) -> SdkVersion
fn clone(&self) -> SdkVersion
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 moreimpl Copy for SdkVersion
Source§impl Debug for SdkVersion
impl Debug for SdkVersion
impl Eq for SdkVersion
Source§impl PartialEq for SdkVersion
impl PartialEq for SdkVersion
Source§fn eq(&self, other: &SdkVersion) -> bool
fn eq(&self, other: &SdkVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SdkVersion
Auto Trait Implementations§
impl Freeze for SdkVersion
impl RefUnwindSafe for SdkVersion
impl Send for SdkVersion
impl Sync for SdkVersion
impl Unpin for SdkVersion
impl UnsafeUnpin for SdkVersion
impl UnwindSafe for SdkVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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