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§
Required Methods§
sourcefn current_dir(&self) -> &Self::DirHandle<'_>
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§
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.