VirtDir

Struct VirtDir 

Source
pub struct VirtDir { /* private fields */ }
Available on crate feature virt only.

Trait Implementations§

Source§

impl Default for VirtDir

Source§

fn default() -> Self

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

impl DirHandle for VirtDir

Source§

fn path(&self) -> Self::PathFuture<'_>

Gets the absolute path to this DirHandle.

Source§

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>

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>

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>

Do an operation.

This function performs an operation from the DirOp enum.

Source§

type FileHandle = Seekable<VirtFile, u64>

Source§

type OpenFileFuture<'a> = OpenFileFuture<'a>

Source§

type PathFuture<'a> = Ready<Result<PathBuf, Error>>

Source§

type OpenDirFuture<'a> = Ready<Result<VirtDir, Error>>

Source§

type ReadDir<'a> = ReadDir<'a>

Source§

type ReadDirFuture<'a> = Ready<Result<ReadDir<'a>, Error>>

Source§

type MetadataFuture<'a> = Ready<Result<Metadata, Error>>

Source§

type OpFuture<'a> = OpFuture<'a>

Source§

fn metadata<'a, P: AsRef<Path> + ?Sized>( &'a self, path: &'a P, ) -> Self::MetadataFuture<'a>

Retrieves file metadata. Read more

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> DirHandleExt for T
where T: DirHandle,

Source§

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>

Examples Read more
Source§

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>

Examples Read more
Source§

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>

Examples Read more
Source§

fn rename<'a, P: AsRef<Path> + ?Sized>( &'a self, from: &'a P, to: &'a P, ) -> Self::OpFuture<'a>

Examples Read more
Source§

fn copy<'a, P: AsRef<Path> + ?Sized>( &'a self, from: &'a P, to: &'a P, ) -> Self::OpFuture<'a>

Examples Read more
Examples Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, F> From2<T> for F
where T: Into<F>,

Source§

fn from2(other: T) -> F

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> GenericTypeBounds for T