pub struct VirtDir { /* private fields */ }Available on crate feature
virt only.Trait Implementations§
Source§impl DirHandle for VirtDir
impl DirHandle for VirtDir
Source§fn path(&self) -> Self::PathFuture<'_>
fn path(&self) -> Self::PathFuture<'_>
Gets the absolute path to this DirHandle.
Source§fn read_dir(&self) -> Self::ReadDirFuture<'_>
fn read_dir(&self) -> Self::ReadDirFuture<'_>
Reads the directory contents.
Iterating directories has the complexity of O(n log(n)), because we are not maintaining
the cursor to the directory.
TODO: do not go back for entries after every iteration, instead, cache up a few entries.
Source§fn open_file<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
options: OpenOptions,
) -> Self::OpenFileFuture<'a>
fn open_file<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, options: OpenOptions, ) -> Self::OpenFileFuture<'a>
Opens a file.
This function accepts an absolute or relative path to a file for reading. If the path is
relative, it is opened relative to this DirHandle.
Source§fn open_dir<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpenDirFuture<'a>
fn open_dir<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpenDirFuture<'a>
Opens a directory.
This function accepts an absolute or relative path to a directory for reading. If the path
is relative, it is opened relative to this DirHandle.
Source§fn do_op<'a, P: AsRef<Path> + ?Sized>(
&'a self,
operation: DirOp<&'a P>,
) -> Self::OpFuture<'a>
fn do_op<'a, P: AsRef<Path> + ?Sized>( &'a self, operation: DirOp<&'a P>, ) -> Self::OpFuture<'a>
Do an operation.
This function performs an operation from the DirOp enum.
type FileHandle = Seekable<VirtFile, u64>
type OpenFileFuture<'a> = OpenFileFuture<'a>
type PathFuture<'a> = Ready<Result<PathBuf, Error>>
type OpenDirFuture<'a> = Ready<Result<VirtDir, Error>>
type ReadDir<'a> = ReadDir<'a>
type ReadDirFuture<'a> = Ready<Result<ReadDir<'a>, Error>>
type MetadataFuture<'a> = Ready<Result<Metadata, Error>>
type OpFuture<'a> = OpFuture<'a>
Auto Trait Implementations§
impl Freeze for VirtDir
impl !RefUnwindSafe for VirtDir
impl Send for VirtDir
impl Sync for VirtDir
impl Unpin for VirtDir
impl !UnwindSafe for VirtDir
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> DirHandleExt for Twhere
T: DirHandle,
impl<T> DirHandleExt for Twhere
T: DirHandle,
Source§fn set_permissions<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
permissions: Permissions,
) -> Self::OpFuture<'a>
fn set_permissions<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, permissions: Permissions, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn remove_dir<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpFuture<'a>
fn remove_dir<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn remove_dir_all<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpFuture<'a>
fn remove_dir_all<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn create_dir<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpFuture<'a>
fn create_dir<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn create_dir_all<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpFuture<'a>
fn create_dir_all<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn remove_file<'a, P: AsRef<Path> + ?Sized>(
&'a self,
path: &'a P,
) -> Self::OpFuture<'a>
fn remove_file<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::OpFuture<'a>
Examples Read more
Source§fn rename<'a, P: AsRef<Path> + ?Sized>(
&'a self,
from: &'a P,
to: &'a P,
) -> Self::OpFuture<'a>
fn rename<'a, P: AsRef<Path> + ?Sized>( &'a self, from: &'a P, to: &'a P, ) -> Self::OpFuture<'a>
Examples Read more