pub trait Directory<File>: Sized + Clone {
// Required methods
fn open_subdir(
&self,
name: &[u8],
) -> impl Future<Output = Result<Self, FileSystemError>>;
fn list_dir(
&self,
) -> impl Future<Output = Result<Vec<DirEntry>, FileSystemError>>;
fn open_file(
&self,
name: &[u8],
) -> impl Future<Output = Result<File, FileSystemError>>;
}Expand description
A trait for directories and their operations
A simple implementation might just use a std::path::PathBuf. On
platforms which implement directory handles, this should encapsulate the
handle.
Required Methods§
Sourcefn open_subdir(
&self,
name: &[u8],
) -> impl Future<Output = Result<Self, FileSystemError>>
fn open_subdir( &self, name: &[u8], ) -> impl Future<Output = Result<Self, FileSystemError>>
Open a subdirectory of this directory
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Directory<WebFile> for WebDirectory
Available on crate feature
web only.