Skip to content

Evaluation of configuration flags, at runtime-time.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

flier/rust-runtime-cfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runtime_cfg travis crate docs dependency status

Evaluation of configuration flags, at runtime-time.

Usage

To use runtime_cfg in your project, add the following to your Cargo.toml:

[dependencies]
runtime-cfg = "0.1"

Example

use std::convert::TryFrom;

use quote::quote;

use runtime_cfg::*;

let cfg = quote! { #[cfg(all(unix, target_pointer_width = "32"))] };

let cfg = Cfg::try_from(cfg).unwrap();
assert_eq!(cfg, all(vec![name("unix"), name_value("target_pointer_width", "32")]).into());

let flags = vec![("unix", None), ("target_pointer_width", Some("32"))];
assert!(cfg.matches(&flags));

About

Evaluation of configuration flags, at runtime-time.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages