pub trait StoreDirectory {
type Entry;
type Reader: StoreDirectoryReader<Self::Entry>;
// Required methods
fn path(&self) -> &Path;
fn exists(&self) -> impl Future<Output = Result<bool>>;
fn read(&self) -> impl Future<Output = Result<Self::Reader>>;
fn delete(&self) -> impl Future<Output = Result<()>>;
fn delete_recursive(&self) -> impl Future<Output = Result<()>>;
// Provided method
fn name(&self) -> Option<Cow<'_, str>> { ... }
}
Expand description
Trait representing a directory in the storage system.
Required Associated Types§
Sourcetype Reader: StoreDirectoryReader<Self::Entry>
type Reader: StoreDirectoryReader<Self::Entry>
Associated type for the reader that iterates over the directory’s entries.
Required Methods§
Sourcefn exists(&self) -> impl Future<Output = Result<bool>>
fn exists(&self) -> impl Future<Output = Result<bool>>
Checks if the directory exists.
Returns a future that resolves to true
if the directory exists,
otherwise false
.
Sourcefn read(&self) -> impl Future<Output = Result<Self::Reader>>
fn read(&self) -> impl Future<Output = Result<Self::Reader>>
Reads the contents of the directory.
Returns a future that resolves to a reader for the directory’s entries.
Sourcefn delete(&self) -> impl Future<Output = Result<()>>
fn delete(&self) -> impl Future<Output = Result<()>>
Deletes a directory if empty
Should return an error if not empty
Sourcefn delete_recursive(&self) -> impl Future<Output = Result<()>>
fn delete_recursive(&self) -> impl Future<Output = Result<()>>
Deletes a directory and its content
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.