A rust library for dealing with versions designed to be used with lovepack tools.
Contains a custom version Struct that is based on the Semantic Versioning System. Only supports the a.b.c
format, but with any number of points, i.e. a.b
, a.b.c.d
are also valid versions. Also has support for wildcards when compairing Versions
.
```rust
let wildversion = Version::fromstr("2..");
Version::fromstring("2.3.4").unwrap().iscompatiblewith(&wildversion) // will return true
```
And standard comparions can be used.
```rust
let vera = Version::fromstr("2.1.4"); let verb = Version::fromstr("2.2.3"); let verc = Version::fromstr("2.1.4");
vera < verb // true vera == verc // true
```
You can also get the latest available version from a list.
```rust
let versions : Vec
let requirement = Version::from_str("1").unwrap();
let version = requirement.latestcompatibleversion(&versions); // would be Version (1.1.0)
```
is_compatible_with
function.1.2
will be compatible with 1.2.3
Currently the only wildcard supported is *
. But ^
can be achieved by using short versions: 1.2
would match with 1.2.1
to 1.2.100
and would return the latest version in a list using ::latest_compatible_version
.