Enum cargo::util::semver_ext::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.
sourcepub fn matches_prerelease(&self, version: &Version) -> bool
pub fn matches_prerelease(&self, version: &Version) -> bool
An interim approach allows to update to SemVer-Compatible prerelease version.
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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