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
Exactly(Version)
Match the exact version number. (=)
ExactlyNot(Version)
Exclude the exact version number. (!=)
GreaterThan(Version)
Exclusively match any greater version number. (>)
GreaterThanOrEqualTo(Version)
Inclusively match any greater version number. (>=)
LessThan(Version)
Exclusively match any lesser version number. (<)
LessThanOrEqualTo(Version)
Inclusively match any lesser version number. (<=)