Loading RustViz Engine...
Encode file permissions (Read, Write, Execute) as a single u8 integer.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub struct Permissions(pub u8);
impl Permissions {
pub const READ: u8 = 1 << 0;
pub const WRITE: u8 = 1 << 1;
pub const EXEC: u8 = 1 << 2;
pub fn has_read(&self) -> bool { (self.0 & Self::READ) != 0 }
pub fn has_write(&self) -> bool { (self.0 & Self::WRITE) != 0 }
}