Struct async_std::fs::Permissions
source · [−]pub struct Permissions { /* private fields */ }
Expand description
A set of permissions on a file or directory.
This type is a re-export of std::fs::Permissions
.
Implementations
sourceimpl Permissions
impl Permissions
sourcepub fn readonly(&self) -> bool
pub fn readonly(&self) -> bool
Returns the read-only flag.
Examples
use async_std::fs;
let perm = fs::metadata("a.txt").await?.permissions();
println!("{:?}", perm.readonly());
sourcepub fn set_readonly(&mut self, readonly: bool)
pub fn set_readonly(&mut self, readonly: bool)
Configures the read-only flag.
Examples
use async_std::fs;
let mut perm = fs::metadata("a.txt").await?.permissions();
perm.set_readonly(true);
fs::set_permissions("a.txt", perm).await?;
Trait Implementations
sourceimpl Clone for Permissions
impl Clone for Permissions
sourcefn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Permissions
impl Debug for Permissions
sourceimpl PartialEq<Permissions> for Permissions
impl PartialEq<Permissions> for Permissions
sourcefn eq(&self, other: &Permissions) -> bool
fn eq(&self, other: &Permissions) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Permissions) -> bool
fn ne(&self, other: &Permissions) -> bool
This method tests for !=
.
impl Eq for Permissions
impl StructuralEq for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more