Skip to main content

FileProvider

Trait FileProvider 

Source
pub trait FileProvider {
Show 28 methods // Required methods fn read_bytes(&self, path: &str) -> Result<Vec<u8>, FileError>; fn write_bytes( &self, path: &str, bytes: Vec<u8>, options: WriteOptions, ) -> Result<String, FileError>; fn exists_value(&self, path: &str) -> Result<bool, FileError>; fn stat_entry(&self, path: &str) -> Result<FileEntry, FileError>; fn entries_values(&self, path: &str) -> Result<Vec<FileEntry>, FileError>; fn mkdir_path( &self, path: &str, options: MkdirOptions, ) -> Result<String, FileError>; fn delete_path( &self, path: &str, options: DeleteOptions, ) -> Result<String, FileError>; fn copy_path( &self, source: &str, target: &str, options: CopyOptions, ) -> Result<String, FileError>; fn move_path( &self, source: &str, target: &str, options: MoveOptions, ) -> Result<String, FileError>; fn temp_file_path( &self, parent: &str, options: TempFileOptions, ) -> Result<String, FileError>; fn temp_directory_path( &self, parent: &str, options: TempDirectoryOptions, ) -> Result<String, FileError>; // Provided methods fn resolve(&self, root: &str, path: &str) -> Result<String, FileError> { ... } fn read(&self, path: &str) -> Result<Promise, FileError> { ... } fn write(&self, path: &str, bytes: Vec<u8>) -> Result<Promise, FileError> { ... } fn write_with_options( &self, path: &str, bytes: Vec<u8>, options: WriteOptions, ) -> Result<Promise, FileError> { ... } fn exists(&self, path: &str) -> Result<Promise, FileError> { ... } fn stat(&self, path: &str) -> Result<Promise, FileError> { ... } fn entries(&self, path: &str) -> Result<Promise, FileError> { ... } fn list(&self, path: &str) -> Result<Promise, FileError> { ... } fn walk(&self, path: &str) -> Result<Promise, FileError> { ... } fn mkdir(&self, path: &str) -> Result<Promise, FileError> { ... } fn mkdir_with_options( &self, path: &str, options: MkdirOptions, ) -> Result<Promise, FileError> { ... } fn delete(&self, path: &str) -> Result<Promise, FileError> { ... } fn delete_with_options( &self, path: &str, options: DeleteOptions, ) -> Result<Promise, FileError> { ... } fn copy( &self, source: &str, target: &str, options: CopyOptions, ) -> Result<Promise, FileError> { ... } fn move_entry( &self, source: &str, target: &str, options: MoveOptions, ) -> Result<Promise, FileError> { ... } fn temp_file( &self, parent: &str, options: TempFileOptions, ) -> Result<Promise, FileError> { ... } fn temp_directory( &self, parent: &str, options: TempDirectoryOptions, ) -> Result<Promise, FileError> { ... }
}

Required Methods§

Source

fn read_bytes(&self, path: &str) -> Result<Vec<u8>, FileError>

Source

fn write_bytes( &self, path: &str, bytes: Vec<u8>, options: WriteOptions, ) -> Result<String, FileError>

Source

fn exists_value(&self, path: &str) -> Result<bool, FileError>

Source

fn stat_entry(&self, path: &str) -> Result<FileEntry, FileError>

Source

fn entries_values(&self, path: &str) -> Result<Vec<FileEntry>, FileError>

Source

fn mkdir_path( &self, path: &str, options: MkdirOptions, ) -> Result<String, FileError>

Source

fn delete_path( &self, path: &str, options: DeleteOptions, ) -> Result<String, FileError>

Source

fn copy_path( &self, source: &str, target: &str, options: CopyOptions, ) -> Result<String, FileError>

Source

fn move_path( &self, source: &str, target: &str, options: MoveOptions, ) -> Result<String, FileError>

Source

fn temp_file_path( &self, parent: &str, options: TempFileOptions, ) -> Result<String, FileError>

Source

fn temp_directory_path( &self, parent: &str, options: TempDirectoryOptions, ) -> Result<String, FileError>

Provided Methods§

Source

fn resolve(&self, root: &str, path: &str) -> Result<String, FileError>

Source

fn read(&self, path: &str) -> Result<Promise, FileError>

Source

fn write(&self, path: &str, bytes: Vec<u8>) -> Result<Promise, FileError>

Source

fn write_with_options( &self, path: &str, bytes: Vec<u8>, options: WriteOptions, ) -> Result<Promise, FileError>

Source

fn exists(&self, path: &str) -> Result<Promise, FileError>

Source

fn stat(&self, path: &str) -> Result<Promise, FileError>

Source

fn entries(&self, path: &str) -> Result<Promise, FileError>

Source

fn list(&self, path: &str) -> Result<Promise, FileError>

Source

fn walk(&self, path: &str) -> Result<Promise, FileError>

Source

fn mkdir(&self, path: &str) -> Result<Promise, FileError>

Source

fn mkdir_with_options( &self, path: &str, options: MkdirOptions, ) -> Result<Promise, FileError>

Source

fn delete(&self, path: &str) -> Result<Promise, FileError>

Source

fn delete_with_options( &self, path: &str, options: DeleteOptions, ) -> Result<Promise, FileError>

Source

fn copy( &self, source: &str, target: &str, options: CopyOptions, ) -> Result<Promise, FileError>

Source

fn move_entry( &self, source: &str, target: &str, options: MoveOptions, ) -> Result<Promise, FileError>

Source

fn temp_file( &self, parent: &str, options: TempFileOptions, ) -> Result<Promise, FileError>

Source

fn temp_directory( &self, parent: &str, options: TempDirectoryOptions, ) -> Result<Promise, FileError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§