Enum cargo::util::OptVersionReq
source · [−]pub enum OptVersionReq {
Any,
Req(VersionReq),
Locked(Version, VersionReq),
}
Variants
Any
Req(VersionReq)
Locked(Version, VersionReq)
The exact locked version and the original version requirement.
Implementations
sourceimpl OptVersionReq
impl OptVersionReq
pub fn exact(version: &Version) -> Self
pub fn is_exact(&self) -> bool
pub fn lock_to(&mut self, version: &Version)
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
sourceimpl Clone for OptVersionReq
impl Clone for OptVersionReq
sourcefn clone(&self) -> OptVersionReq
fn clone(&self) -> OptVersionReq
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for OptVersionReq
impl Debug for OptVersionReq
sourceimpl Display for OptVersionReq
impl Display for OptVersionReq
sourceimpl From<VersionReq> for OptVersionReq
impl From<VersionReq> for OptVersionReq
sourcefn from(req: VersionReq) -> Self
fn from(req: VersionReq) -> Self
Converts to this type from the input type.
sourceimpl Hash for OptVersionReq
impl Hash for OptVersionReq
sourceimpl PartialEq<OptVersionReq> for OptVersionReq
impl PartialEq<OptVersionReq> for OptVersionReq
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &OptVersionReq) -> bool
fn ne(&self, other: &OptVersionReq) -> bool
This method tests for !=
.
impl Eq for OptVersionReq
impl StructuralEq for OptVersionReq
impl StructuralPartialEq for OptVersionReq
Auto Trait Implementations
impl RefUnwindSafe for OptVersionReq
impl Send for OptVersionReq
impl Sync for OptVersionReq
impl Unpin for OptVersionReq
impl UnwindSafe for OptVersionReq
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.