pub enum Term<VS: VersionSet> {
Positive(VS),
Negative(VS),
}
Expand description
A positive or negative expression regarding a set of versions.
If a version is selected then Positive(r)
and Negative(r.complement())
are equivalent, but
they have different semantics when no version is selected. A Positive
term in the partial
solution requires a version to be selected. But a Negative
term allows for a solution that
does not have that package selected. Specifically, Positive(VS::empty())
means that there was
a conflict, we need to select a version for the package but can’t pick any, while
Negative(VS::full())
would mean it is fine as long as we don’t select the package.
Variants§
Positive(VS)
For example, “1.0.0 <= v < 2.0.0” is a positive expression that is evaluated true if a version is selected and comprised between version 1.0.0 and version 2.0.0.
Negative(VS)
The term “not v < 3.0.0” is a negative expression that is evaluated true if a version is selected >= 3.0.0 or if no version is selected at all.
Trait Implementations§
source§impl<VS: PartialEq + VersionSet> PartialEq for Term<VS>
impl<VS: PartialEq + VersionSet> PartialEq for Term<VS>
impl<VS: Eq + VersionSet> Eq for Term<VS>
impl<VS: VersionSet> StructuralPartialEq for Term<VS>
Auto Trait Implementations§
impl<VS> Freeze for Term<VS>where
VS: Freeze,
impl<VS> RefUnwindSafe for Term<VS>where
VS: RefUnwindSafe,
impl<VS> Send for Term<VS>where
VS: Send,
impl<VS> Sync for Term<VS>where
VS: Sync,
impl<VS> Unpin for Term<VS>where
VS: Unpin,
impl<VS> UnwindSafe for Term<VS>where
VS: UnwindSafe,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.