pub struct Special { /* private fields */ }
Expand description
Special bits set on a file.
Implementations§
Source§impl Special
impl Special
pub fn empty() -> Special
Sourcepub fn from_mode_user(mode: &Mode, user: User) -> Special
pub fn from_mode_user(mode: &Mode, user: User) -> Special
Constructs Special representing User-specific special bits set on the file described by Mode.
- For User::Owner the SpecialBit::SetId bit will represent the
set-user-ID
mode bit. - For User::Group the SpecialBit::SetId bit will represent the
set-group-ID
mode bit.
Sourcepub fn is_set_id_set(&self) -> bool
pub fn is_set_id_set(&self) -> bool
Returns true if set ID bit is set.
- For User::Owner the bit will represent the
set-user-ID
mode bit. - For User::Group the bit will represent the
set-group-ID
mode bit.
Sourcepub fn is_sticky_set(&self) -> bool
pub fn is_sticky_set(&self) -> bool
Returns true if sticky bit is set.
Sourcepub fn with_set(self, bit: SpecialBit) -> Special
pub fn with_set(self, bit: SpecialBit) -> Special
Returns self with given SpecialBit set.
Sourcepub fn with_cleared(self, bit: SpecialBit) -> Special
pub fn with_cleared(self, bit: SpecialBit) -> Special
Returns self with given SpecialBit cleared.
Sourcepub fn with_forgotten(self, bit: SpecialBit) -> Special
pub fn with_forgotten(self, bit: SpecialBit) -> Special
Returns self with given SpecialBit value forgotten.
Sourcepub fn set(&mut self, bit: SpecialBit)
pub fn set(&mut self, bit: SpecialBit)
Sets given SpecialBit.
Sourcepub fn clear(&mut self, bit: SpecialBit)
pub fn clear(&mut self, bit: SpecialBit)
Clears given SpecialBit.
Sourcepub fn forget(&mut self, bit: SpecialBit)
pub fn forget(&mut self, bit: SpecialBit)
Forgets the value of given SpecialBit.
Sourcepub fn for_user(&self, user: User) -> Mode
pub fn for_user(&self, user: User) -> Mode
Constructs Mode with special bits set according to User.
- For User::Owner the SpecialBit::SetId bit will represent the
set-user-ID
mode bit. - For User::Group the SpecialBit::SetId bit will represent the
set-group-ID
mode bit.
Trait Implementations§
Source§impl From<SpecialBit> for Special
impl From<SpecialBit> for Special
Source§fn from(bit: SpecialBit) -> Special
fn from(bit: SpecialBit) -> Special
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Special
impl RefUnwindSafe for Special
impl Send for Special
impl Sync for Special
impl Unpin for Special
impl UnwindSafe for Special
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