Enum cargo::util::OptVersionReq
source · pub enum OptVersionReq {
Any,
Req(VersionReq),
Locked(Version, VersionReq),
Precise(Version, VersionReq),
}
Variants§
Any
Req(VersionReq)
Locked(Version, VersionReq)
The exact locked version and the original version requirement.
Precise(Version, VersionReq)
The exact requested version and the original version requirement.
This looks identical to OptVersionReq::Locked
but has a different
meaning, and is used for the --precise
field of cargo update
.
See comments in OptVersionReq::matches
for more.
Implementations§
source§impl OptVersionReq
impl OptVersionReq
pub fn exact(version: &Version) -> Self
pub fn lock_to_exact(version: &Version) -> Self
pub fn is_exact(&self) -> bool
pub fn lock_to(&mut self, version: &Version)
sourcepub fn precise_to(&mut self, version: &Version)
pub fn precise_to(&mut self, version: &Version)
Makes the requirement precise to the requested version.
This is used for the --precise
field of cargo update
.
pub fn is_precise(&self) -> bool
sourcepub fn precise_version(&self) -> Option<&Version>
pub fn precise_version(&self) -> Option<&Version>
Gets the version to which this req is precise to, if any.
pub fn is_locked(&self) -> bool
sourcepub fn locked_version(&self) -> Option<&Version>
pub fn locked_version(&self) -> Option<&Version>
Gets the version to which this req is locked, if any.
pub fn matches(&self, version: &Version) -> bool
Trait Implementations§
source§impl Clone for OptVersionReq
impl Clone for OptVersionReq
source§fn clone(&self) -> OptVersionReq
fn clone(&self) -> OptVersionReq
Returns a copy of the value. Read more
1.0.0 · 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 OptVersionReq
impl Debug for OptVersionReq
source§impl Display for OptVersionReq
impl Display for OptVersionReq
source§impl From<VersionReq> for OptVersionReq
impl From<VersionReq> for OptVersionReq
source§fn from(req: VersionReq) -> Self
fn from(req: VersionReq) -> Self
Converts to this type from the input type.
source§impl Hash for OptVersionReq
impl Hash for OptVersionReq
source§impl PartialEq for OptVersionReq
impl PartialEq for OptVersionReq
source§fn eq(&self, other: &OptVersionReq) -> bool
fn eq(&self, other: &OptVersionReq) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for OptVersionReq
impl StructuralPartialEq for OptVersionReq
Auto Trait Implementations§
impl Freeze for OptVersionReq
impl RefUnwindSafe for OptVersionReq
impl Send for OptVersionReq
impl Sync for OptVersionReq
impl Unpin for OptVersionReq
impl UnwindSafe for OptVersionReq
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<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.