Enum recital::resolve::Operation [] [src]

pub enum Operation {
    Exactly(Version),
    ExactlyNot(Version),
    GreaterThan(Version),
    GreaterThanOrEqualTo(Version),
    LessThan(Version),
    LessThanOrEqualTo(Version),
}

A version number constraint as an equality and inequality check.

The following example will create a very simple constraint based on an equality/inequality check that will allow any version number equal to or above 1.3.9.

use recital::resolve::Constraint;
use recital::resolve::Operation::GreaterThanOrEqualTo;

let operation = GreaterThanOrEqualTo(version!(1, 3, 9));

if operation.allows(&version!(1, 5, 6)) {
    // ... allowed ...
}

if !operation.allows(&version!(1, 2, 1)) {
    // ... not allowed ...
}

This enum is not intended to be used by itself. You would be better off doing direct comparisons (e.g. a > b). You are expected to use multiple instances of this enum as a set of constraints. Please see the Constraints enum documentation.

Variants

Match the exact version number. (=)

Exclude the exact version number. (!=)

Exclusively match any greater version number. (>)

Inclusively match any greater version number. (>=)

Exclusively match any lesser version number. (<)

Inclusively match any lesser version number. (<=)

Trait Implementations

impl Constraint for Operation
[src]

Checks if the given version number satisifies this constraint.