#permissions #flags #manage #simple #performance

fastperm

A dead-simple, extreme fast permission flag system for Rust with no dependencies

3 stable releases

1.0.2 Mar 12, 2022

#1916 in Rust patterns

Apache-2.0

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


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));

Credit

No runtime deps