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§
source§impl 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§
source§impl Clone for Permissions
impl Clone for Permissions
source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a copy 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 Permissions
impl Debug for Permissions
source§impl PartialEq for Permissions
impl PartialEq 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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)