pub enum VersionReq {
Latest,
Spec(VersionSpec),
}Expand description
Represents a version requirement.
Variants§
Latest
Used when the latest version is desired.
Spec(VersionSpec)
Used when a specific version is required, or one that matches a predicate.
Implementations§
Source§impl VersionReq
impl VersionReq
Sourcepub fn parse(s: &str) -> Result<Self, ParseVersionReqError>
pub fn parse(s: &str) -> Result<Self, ParseVersionReqError>
Parses a string into a VersionReq.
§Examples
let exact_req = VersionReq::parse("= 1.2.3")?;
let latest = VersionReq::parse("")?;Trait Implementations§
Source§impl Clone for VersionReq
impl Clone for VersionReq
Source§fn clone(&self) -> VersionReq
fn clone(&self) -> VersionReq
Returns a duplicate 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 VersionReq
impl Debug for VersionReq
Source§impl Display for VersionReq
impl Display for VersionReq
Source§impl From<VersionReq> for VersionReq
impl From<VersionReq> for VersionReq
Source§fn from(value: VersionReq) -> Self
fn from(value: VersionReq) -> Self
Converts to this type from the input type.
Source§impl FromStr for VersionReq
impl FromStr for VersionReq
Source§impl PartialEq for VersionReq
impl PartialEq for VersionReq
Source§impl TryFrom<VersionReq> for VersionReq
impl TryFrom<VersionReq> for VersionReq
Source§type Error = ParseVersionReqError
type Error = ParseVersionReqError
The type returned in the event of a conversion error.
impl Copy for VersionReq
impl Eq for VersionReq
impl StructuralPartialEq for VersionReq
Auto Trait Implementations§
impl Freeze for VersionReq
impl RefUnwindSafe for VersionReq
impl Send for VersionReq
impl Sync for VersionReq
impl Unpin for VersionReq
impl UnwindSafe for VersionReq
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