2 unstable releases
Uses old Rust 2015
0.2.0 | Apr 30, 2016 |
---|---|
0.1.0 | Feb 4, 2016 |
#15 in #flag
3KB
87 lines
libtoggle
libtoggle
is a Rust library for feature toggles.
Basic usage:
use toggle::{Toggle, Disabled, Enabled};
struct HelloStruct<MapTg> where MapTg: Toggle<HashMap<String, i32>> {
t: MapTg,
}
fn main() {
let nomap = HelloStruct{
t: Disabled::new(),
}
nomap.t.as_ref().map(|_| { println!("i am a spooky ghost"); });
let mut hasmap = HelloStruct{
t: Enabled::new(HashMap::new()),
};
hasmap.t.as_mut().map(|t| { println!("hello world!"); });
}