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.
Sourcepub fn matches_prerelease(&self, version: &Version) -> bool
pub fn matches_prerelease(&self, version: &Version) -> bool
Allows to match pre-release in SemVer-Compatible way.
See semver_eval_ext
for matches_prerelease
semantics.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§impl Hash for OptVersionReq
impl Hash for OptVersionReq
Source§impl PartialEq for OptVersionReq
impl PartialEq for OptVersionReq
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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 bytesPrecise
: 64 bytes