Struct semver_parser::range::VersionReq [−][src]
Struct holding collection of version requirements.
High-level collection of requirements for versions. Requirements are Predicate
structs.
Examples
Simple single-predicate VersionReq
:
use semver_parser::range; let r = range::parse("1.0.0")?; assert_eq!(range::Predicate { op: range::Op::Compatible, major: 1, minor: Some(0), patch: Some(0), pre: Vec::new(), }, r.predicates[0] );
Multiple predicates in VersionReq
:
use semver_parser::range; let r = range::parse("> 0.0.9, <= 2.5.3")?; assert_eq!(range::Predicate { op: range::Op::Gt, major: 0, minor: Some(0), patch: Some(9), pre: Vec::new(), }, r.predicates[0] ); assert_eq!(range::Predicate { op: range::Op::LtEq, major: 2, minor: Some(5), patch: Some(3), pre: Vec::new(), }, r.predicates[1] );
Fields
predicates: Vec<Predicate>
Collection of predicates.
Trait Implementations
impl Clone for VersionReq
[src]
impl Clone for VersionReq
fn clone(&self) -> VersionReq
[src]
fn clone(&self) -> VersionReq
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for VersionReq
[src]
impl PartialEq for VersionReq
fn eq(&self, other: &VersionReq) -> bool
[src]
fn eq(&self, other: &VersionReq) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &VersionReq) -> bool
[src]
fn ne(&self, other: &VersionReq) -> bool
This method tests for !=
.
impl Eq for VersionReq
[src]
impl Eq for VersionReq
impl PartialOrd for VersionReq
[src]
impl PartialOrd for VersionReq
fn partial_cmp(&self, other: &VersionReq) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &VersionReq) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &VersionReq) -> bool
[src]
fn lt(&self, other: &VersionReq) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &VersionReq) -> bool
[src]
fn le(&self, other: &VersionReq) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &VersionReq) -> bool
[src]
fn gt(&self, other: &VersionReq) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &VersionReq) -> bool
[src]
fn ge(&self, other: &VersionReq) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for VersionReq
[src]
impl Ord for VersionReq
fn cmp(&self, other: &VersionReq) -> Ordering
[src]
fn cmp(&self, other: &VersionReq) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for VersionReq
[src]
impl Hash for VersionReq
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for VersionReq
[src]
impl Debug for VersionReq
Auto Trait Implementations
impl Send for VersionReq
impl Send for VersionReq
impl Sync for VersionReq
impl Sync for VersionReq