pub trait ProjectedFileSystemSource {
// Required methods
fn list_directory(&self, path: &Path) -> Vec<DirectoryEntry>;
fn stream_file_content(
&self,
path: &Path,
byte_offset: usize,
length: usize,
) -> Result<Box<dyn Read>>;
// Provided methods
fn get_directory_entry(&self, path: &Path) -> Option<DirectoryEntry> { ... }
fn handle_notification(
&self,
_notification: &Notification,
) -> ControlFlow<()> { ... }
}
Expand description
Implementation for the data source of the projected file system.
Required Methods§
Sourcefn list_directory(&self, path: &Path) -> Vec<DirectoryEntry>
fn list_directory(&self, path: &Path) -> Vec<DirectoryEntry>
Return a list of directory entries contained at that specific path. Return an empty list to indicate that the directory is empty or does not exists.
Provided Methods§
Sourcefn get_directory_entry(&self, path: &Path) -> Option<DirectoryEntry>
fn get_directory_entry(&self, path: &Path) -> Option<DirectoryEntry>
Return information about the target path.
The path can be any of the previously returned DirectoryEntry
s.
If the target entry does not exists, return None
.
Note:
The default implementation is for convinience and should be overridden as
looping trough all directory entries might come with a performance penalty.
Sourcefn handle_notification(&self, _notification: &Notification) -> ControlFlow<()>
fn handle_notification(&self, _notification: &Notification) -> ControlFlow<()>
Handle file system notifications. All pre-notifications can be cancelled.