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§
source§impl 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§
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<OptVersionReq> for OptVersionReq
impl PartialEq<OptVersionReq> 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 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§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
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> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes
Size for each variant:
Any
: 0 bytesReq
: 24 bytesLocked
: 64 bytes