trilobyte

Crates.iotrilobyte
lib.rstrilobyte
version0.1.2
created_at2025-03-18 04:29:44.846889+00
updated_at2025-04-22 16:31:06.386067+00
descriptiondata structure representing `3` bits
homepagehttps://github.com/gabrielfalcao/trilobyte
repository
max_upload_size
id1596123
size35,477
Gabriel Falcão (gabrielfalcao)

documentation

README

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

Commit count: 0

cargo fmt