3 stable releases
1.0.2 | Mar 12, 2022 |
---|
#2015 in Rust patterns
6KB
65 lines
fastperm
A dead-simple, extreme fast permission flag system for Rust with no dependencies.
Usage
use fastperm::{add, rm, check};
// Add a flag to a permission digit.
assert_eq!(add(0, 1), 2);
// Remove a flag from a permission digit.
assert_eq!(rm(2, 1), 0);
// Check if a flag is in a permission digit.
assert!(check(2, 1));
Credit
Authors
- pan93412 <pan93412@gmail.com>
lib.rs
:
FastPerm
A dead-simple, extreme fast permission flag system for Rust.
Usage
use fastperm::{add, rm, check};
// Add a flag to a permission digit.
assert_eq!(add(0, 1), 2);
// Remove a flag from a permission digit.
assert_eq!(rm(2, 1), 0);
// Check if a flag is in a permission digit.
assert!(check(2, 1));