Trait kcl_lib::fs::FileSystem
source · pub trait FileSystem: Clone {
// Required methods
fn read<'life0, 'async_trait, P>(
&'life0 self,
path: P,
source_range: SourceRange
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KclError>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait;
fn exists<'life0, 'async_trait, P>(
&'life0 self,
path: P,
source_range: SourceRange
) -> Pin<Box<dyn Future<Output = Result<bool, KclError>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait;
fn get_all_files<'life0, 'async_trait, P>(
&'life0 self,
path: P,
source_range: SourceRange
) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>, KclError>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
sourcefn read<'life0, 'async_trait, P>(
&'life0 self,
path: P,
source_range: SourceRange
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KclError>> + Send + 'async_trait>>
fn read<'life0, 'async_trait, P>( &'life0 self, path: P, source_range: SourceRange ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KclError>> + Send + 'async_trait>>
Read a file from the local file system.
sourcefn exists<'life0, 'async_trait, P>(
&'life0 self,
path: P,
source_range: SourceRange
) -> Pin<Box<dyn Future<Output = Result<bool, KclError>> + Send + 'async_trait>>
fn exists<'life0, 'async_trait, P>( &'life0 self, path: P, source_range: SourceRange ) -> Pin<Box<dyn Future<Output = Result<bool, KclError>> + Send + 'async_trait>>
Check if a file exists on the local file system.
Object Safety§
This trait is not object safe.