4 releases

0.1.2 Apr 22, 2025
0.1.1 Apr 8, 2025
0.1.0 Mar 21, 2025
0.0.1 Mar 18, 2025

#16 in #file-permissions

Download history 49/week @ 2025-09-18 72/week @ 2025-09-25 38/week @ 2025-10-02 25/week @ 2025-10-09 83/week @ 2025-10-16 57/week @ 2025-10-23 34/week @ 2025-10-30 31/week @ 2025-11-06 42/week @ 2025-11-13 35/week @ 2025-11-20 45/week @ 2025-11-27 37/week @ 2025-12-04 27/week @ 2025-12-11 39/week @ 2025-12-18 35/week @ 2025-12-25 38/week @ 2026-01-01

146 downloads per month
Used in 15 crates (via iocore)

MIT license

24KB
430 lines

trilobyte

This crate provides the TriloByte data-structure.


TriloByte

TriloByte is a data-structure representing 3 bits, primarily designed for representing masks and the 3 role permissions of unix files (user, group and other).

For example, a unix file with mode 007 can be represented with 3 trilobytes:

use trilobyte::TriloByte;

let trilobytes = [
    TriloByte(false, false, false),
    TriloByte(false, false, false),
    TriloByte(true, true, true),
];
let mode = trilobytes.iter().map(|t| t.to_string_octal()).collect::<String>();
assert_eq!(mode, "007");

Continuous Integration

No runtime deps