pub struct FullPermission { /* private fields */ }Expand description
a struct that represents a file permission for the file kind and the three owner kinds
allows easily access, modify and convert the permission to a string representation
see the example for more details. new
Implementations§
Source§impl FullPermission
impl FullPermission
Sourcepub fn new(mode: u32) -> Result<Self, FullPermissionError>
pub fn new(mode: u32) -> Result<Self, FullPermissionError>
accepts valid decimal digit represents the file permission.
returns either instance of the struct or an FullPermissionError Result.
§Example
use fmodeparser::FullPermission;
let mode_number = 33188;
let full_permission = FullPermission::new(mode_number)?;Sourcepub fn get_file_type(&self) -> char
pub fn get_file_type(&self) -> char
returns character representing the file type. example: - for a regular file
Sourcepub fn get_user(&mut self) -> &mut OwnersKind
pub fn get_user(&mut self) -> &mut OwnersKind
returns the user owner that gives you the full authority to modify this owner kind.
Sourcepub fn get_group(&mut self) -> &mut OwnersKind
pub fn get_group(&mut self) -> &mut OwnersKind
returns the group owner that gives you the full authority to modify this owner kind.
Sourcepub fn get_other(&mut self) -> &mut OwnersKind
pub fn get_other(&mut self) -> &mut OwnersKind
returns the other owner that gives you the full authority to modify this owner kind.
Sourcepub fn get_mode(&mut self) -> u32
pub fn get_mode(&mut self) -> u32
returns the mode of the file converted from octal to decimal.
Also it can be reused again to construct a new FullPermission object.
Sourcepub fn mode_as_octal(&mut self) -> String
pub fn mode_as_octal(&mut self) -> String
returns the mode as an octal number string.
this is not meant to be used to be bypassed within the crate !! only for representation.