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: Opmajor: u64minor: Option<u64>patch: Option<u64>Patch is only allowed if minor is Some.
pre: PrereleaseNon-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>,