pub struct Permission(/* private fields */);
Expand description
Represents a permission.
The permission can be read, write, and execute.
§Examples
use file_system::Permission_type;
let read = Permission_type::Read_only;
let write = Permission_type::Write_only;
let execute = Permission_type::Execute_only;
assert!(read.get_read() && !read.get_write() && !read.get_execute());
assert!(!write.get_read() && write.get_write() && !write.get_execute());
assert!(!execute.get_read() && !execute.get_write() && execute.get_execute());
Implementations§
Source§impl Permission
impl Permission
pub const READ_ONLY: Self
pub const WRITE_ONLY: Self
pub const EXECUTE_ONLY: Self
pub const READ_WRITE: Self
pub const WRITE_EXECUTE: Self
pub const READ_EXECUTE: Self
pub const NONE: Self
pub const FULL: Self
Sourcepub fn set_execute(self, execute: bool) -> Self
pub fn set_execute(self, execute: bool) -> Self
Sets the execute permission.
Sourcepub const fn get_execute(&self) -> bool
pub const fn get_execute(&self) -> bool
Gets the execute permission.
pub fn include(&self, other: Self) -> bool
Trait Implementations§
Source§impl Clone for Permission
impl Clone for Permission
Source§fn clone(&self) -> Permission
fn clone(&self) -> Permission
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Permission
impl Debug for Permission
Source§impl Display for Permission
impl Display for Permission
Source§impl PartialEq for Permission
impl PartialEq for Permission
impl Copy for Permission
impl Eq for Permission
impl StructuralPartialEq for Permission
Auto Trait Implementations§
impl Freeze for Permission
impl RefUnwindSafe for Permission
impl Send for Permission
impl Sync for Permission
impl Unpin for Permission
impl UnwindSafe for Permission
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more