Trait mfio_rt::Fs

source ·
pub trait Fs: IoBackend {
    type DirHandle<'a>: DirHandle + 'a
       where Self: 'a;

    // Required method
    fn current_dir(&self) -> &Self::DirHandle<'_>;

    // Provided method
    fn open<'a>(
        &'a self,
        path: &'a Path,
        options: OpenOptions
    ) -> <Self::DirHandle<'a> as DirHandle>::OpenFileFuture<'a> { ... }
}
Expand description

Primary filesystem trait.

This provides an entrypoint for filesystem operations. However, since operations are typically performed on a directory, this trait only serves as a proxy for retrieving the current directory handle.

Required Associated Types§

source

type DirHandle<'a>: DirHandle + 'a where Self: 'a

Required Methods§

source

fn current_dir(&self) -> &Self::DirHandle<'_>

Gets a directory handle representing current working directory.

Note that implementor is not required to maintain the location of this handle constant as CWD changes. Therefore, the handle may point to different locations as the directory gets changed in this program.

Provided Methods§

source

fn open<'a>( &'a self, path: &'a Path, options: OpenOptions ) -> <Self::DirHandle<'a> as DirHandle>::OpenFileFuture<'a>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Fs for NativeRt

Available on crate feature native only.
source§

impl Fs for VirtRt

Available on crate feature virt only.
§

type DirHandle<'a> = VirtDir