pub trait FileSystemReader:
Environment
+ Send
+ Sync {
// Required methods
fn ReadFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn StatFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<FileSystemStatDTO, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn ReadDirectory<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, FileTypeDTO)>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
An abstract service contract for an environment component that can perform read-only filesystem operations.
This trait is implemented by MountainEnvironment and typically uses
tokio::fs to fulfill the contract. Separating read operations from write
operations allows for more granular and secure dependency injection, as
some parts of the application may only need read access.
Required Methods§
Sourcefn ReadFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ReadFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn StatFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<FileSystemStatDTO, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn StatFile<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<FileSystemStatDTO, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn ReadDirectory<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, FileTypeDTO)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ReadDirectory<'life0, 'life1, 'async_trait>(
&'life0 self,
Path: &'life1 PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, FileTypeDTO)>, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".