Skip to main content

OsFileSystem

Struct OsFileSystem 

Source
pub struct OsFileSystem;

Implementations§

Source§

impl OsFileSystem

Source

pub fn new() -> Arc<dyn FileSystem> ⓘ

Creates a file system backed by the real operating system, returned as a shared Arc trait object.

Trait Implementations§

Source§

impl Clone for OsFileSystem

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OsFileSystem

Source§

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

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

impl Default for OsFileSystem

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FileSystem for OsFileSystem

Source§

fn open_with( &self, path: &Path, options: &OpenOptions, ) -> Result<Box<dyn File + Send + Sync>>

Opens a file with the given options.
Source§

fn canonicalize(&self, path: &Path) -> Result<PathBuf>

Source§

fn copy(&self, from: &Path, to: &Path) -> Result<u64>

Source§

fn create_dir(&self, path: &Path) -> Result<()>

Source§

fn create_dir_all(&self, path: &Path) -> Result<()>

Source§

fn create_dir_with(&self, path: &Path, builder: &DirBuilder) -> Result<()>

Creates a directory using the given builder.
Source§

fn metadata(&self, path: &Path) -> Result<Box<dyn Metadata + Send + Sync>>

Source§

fn read(&self, path: &Path) -> Result<Vec<u8>>

Source§

fn read_dir(&self, path: &Path) -> Result<Box<dyn ReadDir + Send + Sync>>

Source§

fn read_to_string(&self, path: &Path) -> Result<String>

Source§

fn remove_dir(&self, path: &Path) -> Result<()>

Source§

fn remove_dir_all(&self, path: &Path) -> Result<()>

Source§

fn remove_file(&self, path: &Path) -> Result<()>

Source§

fn rename(&self, from: &Path, to: &Path) -> Result<()>

Source§

fn set_permissions(&self, path: &Path, perm: &Permissions) -> Result<()>

Source§

fn set_times(&self, path: &Path, times: &FileTimes) -> Result<()>

Changes the timestamps of the file or directory at the given path.
Source§

fn try_exists(&self, path: &Path) -> Result<bool>

Returns Ok(true) if the path exists.
Source§

fn write(&self, path: &Path, contents: &[u8]) -> Result<()>

Source§

fn open(&self, path: &Path) -> Result<Box<dyn File + Send + Sync>>

Opens a file in read-only mode.
Source§

fn exists(&self, path: &Path) -> bool

Returns true if the path exists, ignoring any errors.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F> FileSystemExt for F
where F: FileSystem + ?Sized,

Source§

fn find_ancestor_file<P, S>( &self, start_dir: P, file_name: S, ) -> Result<Vec<PathBuf>, Error>
where P: AsRef<Path>, S: AsRef<Path>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.