Struct VersionReq

struct VersionReq { ... }

SemVer version requirement describing the intersection of some version comparators, such as >=1.2.3, <1.8.

Syntax

Fields

comparators: crate::alloc::vec::Vec<Comparator>

Implementations

impl VersionReq

fn parse(text: &str) -> Result<Self, Error>

Create VersionReq by parsing from string representation.

Errors

Possible reasons for the parse to fail include:

  • >a.b — unexpected characters in the partial version.

  • @1.0.0 — unrecognized comparison operator.

  • ^1.0.0, — unexpected end of input.

  • >=1.0 <2.0 — missing comma between comparators.

  • *.* — unsupported wildcard syntax.

fn matches(self: &Self, version: &Version) -> bool

Evaluate whether the given Version satisfies the version requirement described by self.

impl Clone for VersionReq

fn clone(self: &Self) -> VersionReq

impl Debug for VersionReq

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Default for VersionReq

fn default() -> Self

impl Display for crate::VersionReq

fn fmt(self: &Self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result

impl Eq for VersionReq

impl Freeze for VersionReq

impl FromIterator for crate::VersionReq

fn from_iter<I>(iter: I) -> Self
where
    I: IntoIterator<Item = Comparator>

impl FromStr for crate::VersionReq

fn from_str(text: &str) -> Result<Self, <Self as >::Err>

impl Hash for VersionReq

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl PartialEq for VersionReq

fn eq(self: &Self, other: &VersionReq) -> bool

impl RefUnwindSafe for VersionReq

impl Send for VersionReq

impl Serialize for crate::VersionReq

fn serialize<S>(self: &Self, serializer: S) -> Result<<S as >::Ok, <S as >::Error>
where
    S: Serializer

impl StructuralPartialEq for VersionReq

impl Sync for VersionReq

impl Unpin for VersionReq

impl UnwindSafe for VersionReq

impl<'de> Deserialize for crate::VersionReq

fn deserialize<D>(deserializer: D) -> Result<Self, <D as >::Error>
where
    D: Deserializer<'de>

impl<T> Any for VersionReq

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for VersionReq

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for VersionReq

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for VersionReq

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> DeserializeOwned for VersionReq

impl<T> From for VersionReq

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for VersionReq

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for VersionReq

fn to_string(self: &Self) -> String

impl<T, U> Into for VersionReq

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for VersionReq

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for VersionReq

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>