FilesystemClient

Trait FilesystemClient 

Source
pub trait FilesystemClient: PollClient {
Show 14 methods // Provided methods fn debug_dump_store(&mut self) -> ClientResult<'_, DebugDumpStore, Self> { ... } fn read_dir_first( &mut self, location: Location, dir: PathBuf, not_before_filename: Option<PathBuf>, ) -> ClientResult<'_, ReadDirFirst, Self> { ... } fn read_dir_first_alphabetical( &mut self, location: Location, dir: PathBuf, not_before_filename: Option<PathBuf>, ) -> ClientResult<'_, ReadDirFirst, Self> { ... } fn read_dir_next(&mut self) -> ClientResult<'_, ReadDirNext, Self> { ... } fn read_dir_files_first( &mut self, location: Location, dir: PathBuf, user_attribute: Option<UserAttribute>, ) -> ClientResult<'_, ReadDirFilesFirst, Self> { ... } fn read_dir_files_next( &mut self, ) -> ClientResult<'_, ReadDirFilesNext, Self> { ... } fn remove_dir( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveDir, Self> { ... } fn remove_dir_all( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveDirAll, Self> { ... } fn remove_file( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveFile, Self> { ... } fn read_file( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, ReadFile, Self> { ... } fn entry_metadata( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, Metadata, Self> { ... } fn rename( &mut self, location: Location, from: PathBuf, to: PathBuf, ) -> ClientResult<'_, Rename, Self> { ... } fn locate_file( &mut self, location: Location, dir: Option<PathBuf>, filename: PathBuf, ) -> ClientResult<'_, LocateFile, Self> { ... } fn write_file( &mut self, location: Location, path: PathBuf, data: Message, user_attribute: Option<UserAttribute>, ) -> ClientResult<'_, WriteFile, Self> { ... }
}
Available on crate feature filesystem-client only.
Expand description

Read/Write/Delete files, iterate over directories.

Provided Methods§

Source

fn debug_dump_store(&mut self) -> ClientResult<'_, DebugDumpStore, Self>

Source

fn read_dir_first( &mut self, location: Location, dir: PathBuf, not_before_filename: Option<PathBuf>, ) -> ClientResult<'_, ReadDirFirst, Self>

Open a directory for iteration with read_dir_next

For optimization, not_before_filename can be passed to begin the iteration at that file.

Source

fn read_dir_first_alphabetical( &mut self, location: Location, dir: PathBuf, not_before_filename: Option<PathBuf>, ) -> ClientResult<'_, ReadDirFirst, Self>

Open a directory for iteration with read_dir_next

For optimization, not_before_filename can be passed to begin the iteration after the first file that is “alphabetically” before the original file

The notion used here for "alphabetical" does not correspond to the order of iteration yielded by littlefs. This function should be used with caution. If `not_before_filename` was yielded from a previous use of read_dir, it can lead to entries being repeated.
Source

fn read_dir_next(&mut self) -> ClientResult<'_, ReadDirNext, Self>

Source

fn read_dir_files_first( &mut self, location: Location, dir: PathBuf, user_attribute: Option<UserAttribute>, ) -> ClientResult<'_, ReadDirFilesFirst, Self>

Source

fn read_dir_files_next(&mut self) -> ClientResult<'_, ReadDirFilesNext, Self>

Source

fn remove_dir( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveDir, Self>

Source

fn remove_dir_all( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveDirAll, Self>

Source

fn remove_file( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, RemoveFile, Self>

Source

fn read_file( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, ReadFile, Self>

Source

fn entry_metadata( &mut self, location: Location, path: PathBuf, ) -> ClientResult<'_, Metadata, Self>

Fetch the Metadata for a file or directory

If the file doesn’t exists, return None

Source

fn rename( &mut self, location: Location, from: PathBuf, to: PathBuf, ) -> ClientResult<'_, Rename, Self>

Rename a file or directory.

If to exists, it must be the same type as from (i. e., both must be files or both must be directories). If to is a directory, it must be empty.

Source

fn locate_file( &mut self, location: Location, dir: Option<PathBuf>, filename: PathBuf, ) -> ClientResult<'_, LocateFile, Self>

Source

fn write_file( &mut self, location: Location, path: PathBuf, data: Message, user_attribute: Option<UserAttribute>, ) -> ClientResult<'_, WriteFile, Self>

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.

Implementors§