pub struct Permissions(/* private fields */);
Expand description
Representation of the various permissions on a file.
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn read_by_owner(&self) -> bool
pub fn read_by_owner(&self) -> bool
Tests whether read by owner bit is set.
Sourcepub fn set_read_by_owner(&mut self, value: bool) -> &mut Self
pub fn set_read_by_owner(&mut self, value: bool) -> &mut Self
Modify the read by owner bit.
Sourcepub fn write_by_owner(&self) -> bool
pub fn write_by_owner(&self) -> bool
Tests whether write by owner bit is set.
Sourcepub fn set_write_by_owner(&mut self, value: bool) -> &mut Self
pub fn set_write_by_owner(&mut self, value: bool) -> &mut Self
Modify the write by owner bit.
Sourcepub fn execute_by_owner(&self) -> bool
pub fn execute_by_owner(&self) -> bool
Tests whether execute by owner bit is set.
Sourcepub fn set_execute_by_owner(&mut self, value: bool) -> &mut Self
pub fn set_execute_by_owner(&mut self, value: bool) -> &mut Self
Modify the execute by owner bit.
Sourcepub fn read_by_group(&self) -> bool
pub fn read_by_group(&self) -> bool
Tests whether read by group bit is set.
Sourcepub fn set_read_by_group(&mut self, value: bool) -> &mut Self
pub fn set_read_by_group(&mut self, value: bool) -> &mut Self
Modify the read by group bit.
Sourcepub fn write_by_group(&self) -> bool
pub fn write_by_group(&self) -> bool
Tests whether write by group bit is set.
Sourcepub fn set_write_by_group(&mut self, value: bool) -> &mut Self
pub fn set_write_by_group(&mut self, value: bool) -> &mut Self
Modify the write by group bit.
Sourcepub fn execute_by_group(&self) -> bool
pub fn execute_by_group(&self) -> bool
Tests whether execute by group bit is set.
Sourcepub fn set_execute_by_group(&mut self, value: bool) -> &mut Self
pub fn set_execute_by_group(&mut self, value: bool) -> &mut Self
Modify the execute by group bit.
Sourcepub fn read_by_other(&self) -> bool
pub fn read_by_other(&self) -> bool
Tests whether read by other bit is set.
Sourcepub fn set_read_by_other(&mut self, value: bool) -> &mut Self
pub fn set_read_by_other(&mut self, value: bool) -> &mut Self
Modify the read by other bit.
Sourcepub fn write_by_other(&self) -> bool
pub fn write_by_other(&self) -> bool
Tests whether write by other bit is set.
Sourcepub fn set_write_by_other(&mut self, value: bool) -> &mut Self
pub fn set_write_by_other(&mut self, value: bool) -> &mut Self
Modify the write by other bit.
Sourcepub fn execute_by_other(&self) -> bool
pub fn execute_by_other(&self) -> bool
Tests whether execute by other bit is set.
Sourcepub fn set_execute_by_other(&mut self, value: bool) -> &mut Self
pub fn set_execute_by_other(&mut self, value: bool) -> &mut Self
Modify the execute by other bit.
Sourcepub fn readonly(&self) -> bool
pub fn readonly(&self) -> bool
Returns true
if these permissions describe an unwritable file
that no one can write to.
Sourcepub fn set_readonly(&mut self, readonly: bool)
pub fn set_readonly(&mut self, readonly: bool)
Modifies the readonly flag for this set of permissions.
If the readonly argument is true, it will remove write permissions from all parties.
Conversely, if it’s false, it will permit writing from all parties.
This operation does not modify the filesystem.
To modify the filesystem use the super::fs::Fs::set_permissions
or
the super::file::File::set_permissions
function.
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
Source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Permissions
impl Debug for Permissions
Source§impl Default for Permissions
impl Default for Permissions
Source§impl From<u16> for Permissions
impl From<u16> for Permissions
Source§fn from(octet: u16) -> Self
fn from(octet: u16) -> Self
Converts numeric file mode bits permission into a Permissions
object.
The numerical file mode bits are defined as follows:
Special mode bits: 4000 Set user ID 2000 Set group ID 1000 Restricted deletion flag or sticky bit
The file’s owner: 400 Read 200 Write 100 Execute/search
Other users in the file’s group: 40 Read 20 Write 10 Execute/search
Other users not in the file’s group: 4 Read 2 Write 1 Execute/search
Source§impl Hash for Permissions
impl Hash 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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)