const-semver

Library for constructing semver-compatible Versions at compile-time

1 unstable release

0.1.4 Apr 19, 2021
0.1.3 Apr 19, 2021
0.1.2 Apr 19, 2021
0.1.1 Apr 19, 2021
0.1.0 Apr 19, 2021

MIT license

9KB
212 lines

const-semver

Const construction of semver-compatible version structs in Rust.

It's simply a const clone of Steve Klabnik's semver crate, with some utilities for converting between them.

Primary use case is for defining const Version strings at compile-time, for example:

use const_semver::{Version, version};

trait Resource {
    const VERSION: Version;
}

struct MyResource {}

impl Resource for MyResource {
    const VERSION: Version = version!(1,2,3-beta.4+amd64)
}

Dependencies

~2MB
~43K SLoC