pub enum Constraint {
Single {
op: Op,
version: String,
},
Multi {
constraints: Vec<Constraint>,
conjunctive: bool,
},
MatchAll,
MatchNone,
}Variants§
Implementations§
Source§impl Constraint
impl Constraint
pub fn new(op: Op, version: impl Into<String>) -> Constraint
pub fn is_single(&self) -> bool
Sourcepub fn match_specific(
&self,
provider: &Constraint,
compare_branches: bool,
) -> bool
pub fn match_specific( &self, provider: &Constraint, compare_branches: bool, ) -> bool
Constraint::matchSpecific($provider, $compareBranches): self is
the constraint, provider the candidate version (or another simple
constraint).
Sourcepub fn matches(&self, provider: &Constraint) -> bool
pub fn matches(&self, provider: &Constraint) -> bool
ConstraintInterface::matches($provider).
Sourcepub fn matches_version(&self, version: &str) -> bool
pub fn matches_version(&self, version: &str) -> bool
CompilingMatcher::match($constraint, OP_EQ, $version), the form
Composer uses everywhere to test a version.
Sourcepub fn create(constraints: Vec<Constraint>, conjunctive: bool) -> Constraint
pub fn create(constraints: Vec<Constraint>, conjunctive: bool) -> Constraint
MultiConstraint::create($constraints, $conjunctive).
pub fn lower_bound(&self) -> Bound
pub fn upper_bound(&self) -> Bound
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§impl Debug for Constraint
impl Debug for Constraint
Source§impl Display for Constraint
impl Display for Constraint
impl Eq for Constraint
Source§impl Hash for Constraint
impl Hash for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more