pub struct Permissions {
pub owner_read: bool,
pub owner_write: bool,
pub owner_exec: bool,
pub group_read: bool,
pub group_write: bool,
pub group_exec: bool,
pub other_read: bool,
pub other_write: bool,
pub other_exec: bool,
}Expand description
Unix-style file permissions.
§Examples
use heroforge_core::fs::Permissions;
// Create from octal
let perms = Permissions::from_octal(0o755);
assert_eq!(perms.to_string_repr(), "rwxr-xr-x");
// Use preset
let exec = Permissions::executable();
assert_eq!(exec.to_octal(), 0o755);Fields§
§owner_read: boolRead permission for owner
owner_write: boolWrite permission for owner
owner_exec: boolExecute permission for owner
group_read: boolRead permission for group
group_write: boolWrite permission for group
group_exec: boolExecute permission for group
other_read: boolRead permission for others
other_write: boolWrite permission for others
other_exec: boolExecute permission for others
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn from_octal(mode: u32) -> Self
pub fn from_octal(mode: u32) -> Self
Create permissions from octal (e.g., 0o755).
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Convert to string representation (e.g., “rwxr-xr-x”).
Sourcepub fn executable() -> Self
pub fn executable() -> Self
Create permissions for an executable file (755 = rwxr-xr-x).
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
Source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Permissions
impl Debug for Permissions
Source§impl PartialEq for Permissions
impl PartialEq for Permissions
impl Copy for Permissions
impl Eq for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations§
impl Freeze for Permissions
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)