[−][src]Struct semver_constraints::Constraint
A set of Range
s combines to make a Constraint
. Constraint
s are the union of multiple
Range
s. Upon manual creation or updating of a Constraint
, the Constraint
will unify all
of its Range
s such that all of the Range
s are disjoint. Unification is eager: it's done
whenever the set is modified to keep the internal representation of the set unified at all
times (this is useful for converting the Constraint
to a string, since the Display
trait
doesn't allow mutating self).
Syntax-wise, a Constraint
is just a list of comma-separated ranges.
Methods
impl Constraint
[src]
pub fn new(ranges: IndexSet<Range>) -> Constraint
[src]
Creates a new Constraint
from a set of Range
s.
pub fn empty() -> Constraint
[src]
pub fn any() -> Constraint
[src]
pub fn insert(&mut self, range: Range)
[src]
Inserts a Range
into the set.
pub fn retrieve(&self) -> &IndexSet<Range>
[src]
Borrows the set of Range
s from this struct, unifying it in the process.
pub fn take(self) -> IndexSet<Range>
[src]
Takes the set of Range
s from this struct, unifying it in the process.
pub fn unify(&mut self)
[src]
Unifies all of the ranges in the set such that all of the ranges are disjoint.
pub fn is_empty(&self) -> bool
[src]
pub fn satisfies(&self, v: &Version) -> bool
[src]
Checks if a Version
is satisfied by this Constraint
.
pub fn intersection(&self, other: &Constraint) -> Constraint
[src]
pub fn union(&self, other: &Constraint) -> Constraint
[src]
pub fn difference(&self, other: &Constraint) -> Constraint
[src]
pub fn complement(&self) -> Constraint
[src]
pub fn relation(&self, other: &Constraint) -> Relation
[src]
Trait Implementations
impl PartialEq<Constraint> for Constraint
[src]
fn eq(&self, other: &Constraint) -> bool
[src]
fn ne(&self, other: &Constraint) -> bool
[src]
impl Default for Constraint
[src]
impl From<Range> for Constraint
[src]
fn from(r: Range) -> Constraint
[src]
impl From<Version> for Constraint
[src]
fn from(v: Version) -> Constraint
[src]
impl Clone for Constraint
[src]
fn clone(&self) -> Constraint
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Constraint
[src]
impl Display for Constraint
[src]
impl Debug for Constraint
[src]
impl FromStr for Constraint
[src]
Auto Trait Implementations
impl Send for Constraint
impl Sync for Constraint
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,