pub trait FileExt {
// Required methods
fn create_new_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
where Self: Sized;
fn create_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
where Self: Sized;
fn open_if_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
where Self: Sized;
fn with_permissions(&self, perm: Permissions) -> Result<&Self>;
fn with_permissions_readonly(&self, readonly: bool) -> Result<&Self>;
fn with_permissions_mode(&self, mode: u32) -> Result<&Self>;
fn add_permissions_mode(&self, mode: u32) -> Result<&Self>;
fn remove_permissions_mode(&self, mode: u32) -> Result<&Self>;
fn chown(&self, uid: Option<u32>, gid: Option<u32>) -> Result<&Self>;
}Required Methods§
fn create_new_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>where
Self: Sized,
fn create_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>where
Self: Sized,
fn open_if_exists(path: impl AsRef<Path>) -> Result<Option<Self>>where
Self: Sized,
fn with_permissions(&self, perm: Permissions) -> Result<&Self>
fn with_permissions_readonly(&self, readonly: bool) -> Result<&Self>
fn with_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.
fn add_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.
fn remove_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.
fn chown(&self, uid: Option<u32>, gid: Option<u32>) -> Result<&Self>
Available on Unix only.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FileExt for File
impl FileExt for File
fn create_new_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
fn create_if_not_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
fn open_if_exists(path: impl AsRef<Path>) -> Result<Option<Self>>
fn with_permissions(&self, perm: Permissions) -> Result<&Self>
fn with_permissions_readonly(&self, readonly: bool) -> Result<&Self>
Source§fn with_permissions_mode(&self, mode: u32) -> Result<&Self>
fn with_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.
Source§fn add_permissions_mode(&self, mode: u32) -> Result<&Self>
fn add_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.
Source§fn remove_permissions_mode(&self, mode: u32) -> Result<&Self>
fn remove_permissions_mode(&self, mode: u32) -> Result<&Self>
Available on Unix only.