Struct elba::package::version::Constraint[][src]

pub struct Constraint { /* fields omitted */ }

A set of Ranges combines to make a Constraint. Constraints are the union of multiple Ranges. Upon manual creation or updating of a Constraint, the Constraint will unify all of its Ranges such that all of the Ranges 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]

Creates a new Constraint from a set of Ranges.

Inserts a Range into the set.

Borrows the set of Ranges from this struct, unifying it in the process.

Takes the set of Ranges from this struct, unifying it in the process.

Unifies all of the ranges in the set such that all of the ranges are disjoint.

Checks if a Version is satisfied by this Constraint.

Trait Implementations

impl Clone for Constraint
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Constraint
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Constraint
[src]

impl Default for Constraint
[src]

Returns the "default value" for a type. Read more

impl From<Range> for Constraint
[src]

Performs the conversion.

impl From<Version> for Constraint
[src]

Performs the conversion.

impl FromStr for Constraint
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Debug for Constraint
[src]

Formats the value using the given formatter. Read more

impl Display for Constraint
[src]

Formats the value using the given formatter. Read more

impl Serialize for Constraint
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Constraint
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl Send for Constraint

impl Sync for Constraint