Skip to main content

OsFs

Struct OsFs 

Source
pub struct OsFs;
Expand description

Real filesystem adapter that delegates to std::fs.

Trait Implementations§

Source§

impl Fs for OsFs

Source§

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

Create path and all missing ancestors, like mkdir -p.
Source§

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

Return true if path exists (file or directory).
Source§

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

Read the entire contents of the file at path.
Source§

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

Write data to path, replacing any existing content. Read more
Source§

fn append(&self, path: &Path, data: &[u8]) -> Result<(), SessionError>

Append data to the file at path, creating it if absent. Like write, it errors if the parent directory does not exist.
Source§

fn read_dir(&self, path: &Path) -> Result<Vec<PathBuf>, SessionError>

List immediate children (files and directories) of path, sorted for deterministic iteration.
Source§

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

Rename / move from to to.
Source§

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

Remove a file or directory tree at path. Read more

Auto Trait Implementations§

§

impl Freeze for OsFs

§

impl RefUnwindSafe for OsFs

§

impl Send for OsFs

§

impl Sync for OsFs

§

impl Unpin for OsFs

§

impl UnsafeUnpin for OsFs

§

impl UnwindSafe for OsFs

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> Same for T

Source§

type Output = T

Should always be Self
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.