Struct virtual_fs::ScopedDirectoryFileSystem
source · pub struct ScopedDirectoryFileSystem { /* private fields */ }
Available on crate feature
host-fs
only.Expand description
A FileSystem
implementation that is scoped to a specific directory on
the host.
Implementations§
source§impl ScopedDirectoryFileSystem
impl ScopedDirectoryFileSystem
pub fn new(root: impl Into<PathBuf>, inner: FileSystem) -> Self
sourcepub fn new_with_default_runtime(root: impl Into<PathBuf>) -> Self
pub fn new_with_default_runtime(root: impl Into<PathBuf>) -> Self
Create a new ScopedDirectoryFileSystem
using the current
tokio::runtime::Handle
.
§Panics
This will panic if called outside of a tokio
context.
Trait Implementations§
source§impl Clone for ScopedDirectoryFileSystem
impl Clone for ScopedDirectoryFileSystem
source§fn clone(&self) -> ScopedDirectoryFileSystem
fn clone(&self) -> ScopedDirectoryFileSystem
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 ScopedDirectoryFileSystem
impl Debug for ScopedDirectoryFileSystem
source§impl FileSystem for ScopedDirectoryFileSystem
impl FileSystem for ScopedDirectoryFileSystem
fn read_dir(&self, path: &Path) -> Result<ReadDir, FsError>
fn create_dir(&self, path: &Path) -> Result<(), FsError>
fn remove_dir(&self, path: &Path) -> Result<(), FsError>
fn rename<'a>( &'a self, from: &'a Path, to: &'a Path ) -> BoxFuture<'a, Result<(), FsError>>
fn metadata(&self, path: &Path) -> Result<Metadata, FsError>
fn remove_file(&self, path: &Path) -> Result<(), FsError>
fn new_open_options(&self) -> OpenOptions<'_>
Auto Trait Implementations§
impl Freeze for ScopedDirectoryFileSystem
impl !RefUnwindSafe for ScopedDirectoryFileSystem
impl Send for ScopedDirectoryFileSystem
impl Sync for ScopedDirectoryFileSystem
impl Unpin for ScopedDirectoryFileSystem
impl !UnwindSafe for ScopedDirectoryFileSystem
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