Struct Comparator

pub struct Comparator { pub op: Op, pub major: u64, pub minor: Option<u64>, pub patch: Option<u64>, pub pre: Prerelease }

A pair of comparison operator and partial version, such as >=1.2. Forms one piece of a VersionReq.

Fields

op: Op
major: u64
minor: Option<u64>
patch: Option<u64>

Patch is only allowed if minor is Some.

pre: Prerelease

Non-empty pre-release is only allowed if patch is Some.

Implementations

impl Comparator

fn parse(text: &str) -> Result<Self, Error>
fn matches(&self, version: &Version) -> bool

Trait Implementations

impl Clone for Comparator

fn clone(&self) -> Self

impl Debug for Comparator

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

impl Display for Comparator

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

impl Eq for Comparator

impl FromStr for Comparator

type Err = Error;
fn from_str(text: &str) -> Result<Self, Self::Err>

impl Hash for Comparator

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

impl PartialEq for Comparator

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

impl Serialize for Comparator

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

impl StructuralPartialEq for Comparator

impl<'de> Deserialize<'de> for Comparator

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

Auto Trait Implementations

impl Freeze for Comparator

impl RefUnwindSafe for Comparator

impl Send for Comparator

impl Sync for Comparator

impl Unpin for Comparator

impl UnsafeUnpin for Comparator

impl UnwindSafe for Comparator

Blanket Implementations

impl<T> Any for Comparator where T: 'static + ?Sized,

impl<T> Borrow<T> for Comparator where T: ?Sized,

impl<T> BorrowMut<T> for Comparator where T: ?Sized,

impl<T> CloneToUninit for Comparator where T: Clone,

impl<T> DeserializeOwned for Comparator where T: for<'de> Deserialize<'de>,

impl<T> From<T> for Comparator

impl<T> ToOwned for Comparator where T: Clone,

impl<T> ToString for Comparator where T: Display + ?Sized,

impl<T, U> Into<U> for Comparator where U: From<T>,

impl<T, U> TryFrom<U> for Comparator where U: Into<T>,

impl<T, U> TryInto<U> for Comparator where U: TryFrom<T>,