pub enum VersionConstraint {
Semver(VersionReq),
Latest,
RefPin(String),
}Expand description
How a version constraint was specified.
Variants§
Semver(VersionReq)
Semver requirement (^1.0, >=0.5.0, ~2.1, exact version).
Latest
Any version, prefer newest.
RefPin(String)
Branch or commit pin — no semver resolution.
Implementations§
Source§impl VersionConstraint
impl VersionConstraint
Sourcepub fn compatible_with(&self, other: &VersionConstraint) -> CompatibilityResult
pub fn compatible_with(&self, other: &VersionConstraint) -> CompatibilityResult
Check if this constraint is compatible with another.
Matrix:
- Latest + Latest => Compatible
- Semver(same) + Semver(same) => Compatible
- RefPin(same) + RefPin(same) => Compatible
- Latest + Semver/RefPin => PotentiallyConflicting
- Different Semver/RefPin => Conflicting
- Semver + RefPin => Conflicting
Sourcepub fn compatible_with_resolved(
&self,
other: &VersionConstraint,
resolved_version: Option<&Version>,
) -> CompatibilityResult
pub fn compatible_with_resolved( &self, other: &VersionConstraint, resolved_version: Option<&Version>, ) -> CompatibilityResult
Check compatibility against a concrete resolved version.
This is stricter than pure syntactic comparison for semver constraints: two different semver expressions are compatible when both accept the already-resolved concrete version.
Trait Implementations§
Source§impl Clone for VersionConstraint
impl Clone for VersionConstraint
Source§fn clone(&self) -> VersionConstraint
fn clone(&self) -> VersionConstraint
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 VersionConstraint
impl Debug for VersionConstraint
Auto Trait Implementations§
impl Freeze for VersionConstraint
impl RefUnwindSafe for VersionConstraint
impl Send for VersionConstraint
impl Sync for VersionConstraint
impl Unpin for VersionConstraint
impl UnsafeUnpin for VersionConstraint
impl UnwindSafe for VersionConstraint
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> 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