Skip to content
/ efuse-rs Public

Rust library for software fuses

License

Apache-2.0, MIT licenses found

Licenses found

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

lucab/efuse-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

efuse

Build Status crates.io LoC Documentation

A Rust library for software fuses.

This library provides boolean-like types that behave like software fuses: they can be "zapped" once, after which they remain in the toggled state forever. It supports fuses with custom initial boolean state, as well as atomic fuses.

Example

let initial_state = true;
let mut fuse = efuse::Fuse::new(initial_state);
assert_eq!(fuse.as_bool(), true);

fuse.zap();
assert_eq!(fuse.is_zapped(), true);
assert_eq!(fuse.as_bool(), false);

fuse.zap();
assert_eq!(fuse.as_bool(), false);

let already_zapped = fuse.zap_once();
assert!(already_zapped.is_err());

License

Licensed under either of

at your option.

About

Rust library for software fuses

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE-2.0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages