Struct Permissions

Source
pub struct Permissions(/* private fields */);
Expand description

Representation of the various permissions on a file.

Implementations§

Source§

impl Permissions

Source

pub fn readonly(&self) -> bool

Returns true if these permissions describe a readonly (unwritable) file.

Source

pub fn set_readonly(&mut self, readonly: bool)

Set the readonly flag for this set of permissions.

This will not change the file’s permissions, only the in-memory representation. Same with the std::fs, if you want to change the file’s permissions, you should use monoio::fs::set_permissions(currently not support) or std::fs::set_permissions.

Trait Implementations§

Source§

impl Debug for Permissions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PermissionsExt for Permissions

Source§

fn mode(&self) -> u32

Returns the underlying raw mode_t bits that are used by the OS.

Source§

fn set_mode(&mut self, mode: u32)

Set the mode bits for this set of permissions.

This will not change the file’s permissions, only the in-memory representation. Same with the std::fs, if you want to change the file’s permissions, you should use monoio::fs::set_permissions(currently not support) or std::fs::set_permissions.

Source§

fn from_mode(mode: u32) -> Self

Create a new instance of Permissions from the given mode bits.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.