pub struct StdDiskit;
Expand description

Stdlib passthrough diskit

This diskit passes all requests directly to the corresponding standard functions through. This is useful if you normally want to access the disk (then you can use this diskit), but sometimes redirect your requests somewhere else (then you should use the appropriate other diskit), or as a last element in a diskit chain (like in LogDiskit<StdDiskit>).

Thanks to special optimizations of this library this diskit is (nearly) overhead-free.

Trait Implementations§

source§

impl Clone for StdDiskit

source§

fn clone(&self) -> StdDiskit

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for StdDiskit

source§

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

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

impl Default for StdDiskit

source§

fn default() -> Self

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

impl Diskit for StdDiskit

source§

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

Changes the current working directory Read more
source§

fn get_pwd(&self) -> Result<PathBuf, Error>

Retrieves the current working directory Read more
source§

fn open_inner(&self, path: &Path) -> Result<File<Self>, Error>

Opens an exisitent file Read more
source§

fn create_inner(&self, path: &Path) -> Result<File<Self>, Error>

Creates a new file or truncates it Read more
source§

fn open_with_options_inner( &self, path: &Path, options: OpenOptions ) -> Result<File<Self>, Error>

Opens a file with custom options Read more
source§

fn read_inner(&self, file: &FileInner, buf: &mut [u8]) -> Result<usize, Error>

Reads as much as possible into the provided buffer Read more
source§

fn read_to_end_inner( &self, file: &mut FileInner, buf: &mut Vec<u8> ) -> Result<usize, Error>

Reads the complete file into the provided buffer Read more
source§

fn read_to_string_inner( &self, file: &mut FileInner, buf: &mut String ) -> Result<usize, Error>

Reads the complete file into the provided string Read more
source§

fn write_inner(&self, file: &mut FileInner, buf: &[u8]) -> Result<usize, Error>

Writes as much as possible from the provided buffer Read more
source§

fn write_all_inner(&self, file: &mut FileInner, buf: &[u8]) -> Result<(), Error>

Writes the complete provided buufer into the file Read more
source§

fn flush_inner(&self, file: &mut FileInner) -> Result<(), Error>

Flushes all writes of the file Read more
source§

fn metadata_inner(&self, file: &FileInner) -> Result<Metadata, Error>

Retrieves the metadata of the file Read more
source§

fn seek_inner(&self, file: &mut FileInner, pos: SeekFrom) -> Result<u64, Error>

Repositions the file’s cursor Read more
source§

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

Creates a directory Read more
source§

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

Creates a directory and all above if necessary Read more
source§

fn close_inner(&self, _: FileInner) -> Result<(), Error>

Closes the file Read more
source§

fn walkdir_inner(&self, path: &Path) -> WalkDir<Self>

Creates a Walkdir from a path Read more
source§

fn walkdir_next_inner( &self, inner: &mut WalkdirIteratorInner ) -> Option<Result<DirEntry, Error>>

Gets the next file in a WalkDir Read more
source§

fn into_walkdir_iterator(&self, walkdir: WalkDir<Self>) -> WalkdirIterator<Self>

Converts a walkdir builder to an iterator Read more
source§

impl Copy for StdDiskit

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> DiskitExt for T
where T: Diskit,

source§

fn set_pwd<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>

Changes the current working directory Read more
source§

fn open<P: AsRef<Path>>(&self, path: P) -> Result<File<Self>, Error>

Changes the current working directory Read more
source§

fn create<P: AsRef<Path>>(&self, path: P) -> Result<File<Self>, Error>

Creates a new file or truncates it Read more
source§

fn open_with_options<P: AsRef<Path>>( &self, path: P, options: OpenOptions ) -> Result<File<Self>, Error>

Opens a file with custom options Read more
source§

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

Creates a directory Read more
source§

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

Creates a directory and all above if necessary Read more
source§

fn walkdir<P: AsRef<Path>>(&self, path: P) -> WalkDir<Self>

Creates a Walkdir from a path Read more
source§

fn read_to_end<P: AsRef<Path>>(&self, path: P) -> Result<Vec<u8>, Error>

Reads file to end Read more
source§

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

Reads file to end in string 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.