dry run publish
bitstates
Reactive bit state management with event callbacks for Rust.
Installation
[]
= "0.1.0"
Example
use BitState;
License
MIT OR Apache-2.0
dry run publish
Reactive bit state management with event callbacks for Rust.
[dependencies]
bitstates = "0.1.0"
use bitstates::BitState;
#[derive(BitState)]
#[repr(u8)]
enum Status {
Ready = 0,
Active = 1,
}
fn main() {
let mut status = StatusSet::new(
|flag| println!("SET: {:?}", flag),
|flag| println!("CLEARED: {:?}", flag),
);
status.set_with_state(0b01);
}
MIT OR Apache-2.0