Struct diskit::virtual_diskit::VirtualDiskit
source · pub struct VirtualDiskit { /* private fields */ }
Expand description
Virtual file system emulation diskit
This diskit emulates a virtual file system, no requests are passed through to the disk.
This is by far the most complex of all the four predefined diskits and as such has the highest potential for bugs and lacking features. Notably a permission system and symlinks are missing, although symlinks and – in part – permissions are supported by the rest of this library. If you want to fix this, feel free to submit a pull request (in an earlier version I wanted to add a permission system and already had implemented a bit before I abandoned it. If you want to try to add it I can send you my code – but beware it’s quality is horrible and the library had a couple redesigns since then).
Trait Implementations§
source§impl Clone for VirtualDiskit
impl Clone for VirtualDiskit
source§fn clone(&self) -> VirtualDiskit
fn clone(&self) -> VirtualDiskit
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 VirtualDiskit
impl Debug for VirtualDiskit
source§impl Default for VirtualDiskit
impl Default for VirtualDiskit
source§impl Diskit for VirtualDiskit
impl Diskit for VirtualDiskit
source§fn set_pwd_inner(&self, new_pwd: &Path) -> Result<(), Error>
fn set_pwd_inner(&self, new_pwd: &Path) -> Result<(), Error>
Changes the current working directory Read more
source§fn open_inner(&self, path: &Path) -> Result<File<Self>, Error>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn seek_inner(&self, file: &mut FileInner, pos: SeekFrom) -> Result<u64, Error>
Repositions the file’s cursor Read more
source§fn create_dir_all_inner(&self, path: &Path) -> Result<(), Error>
fn create_dir_all_inner(&self, path: &Path) -> Result<(), Error>
Creates a directory and all above if necessary Read more
source§fn into_walkdir_iterator(&self, walkdir: WalkDir<Self>) -> WalkdirIterator<Self> ⓘ
fn into_walkdir_iterator(&self, walkdir: WalkDir<Self>) -> WalkdirIterator<Self> ⓘ
Converts a walkdir builder to an iterator Read more
source§fn walkdir_next_inner(
&self,
inner: &mut WalkdirIteratorInner
) -> Option<Result<DirEntry, Error>>
fn walkdir_next_inner( &self, inner: &mut WalkdirIteratorInner ) -> Option<Result<DirEntry, Error>>
Auto Trait Implementations§
impl RefUnwindSafe for VirtualDiskit
impl Send for VirtualDiskit
impl Sync for VirtualDiskit
impl Unpin for VirtualDiskit
impl UnwindSafe for VirtualDiskit
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> DiskitExt for Twhere
T: Diskit,
impl<T> DiskitExt for Twhere
T: Diskit,
source§fn set_pwd<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
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>
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>
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>
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>
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>
fn create_dir_all<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
Creates a directory and all above if necessary Read more