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§

source

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,

Read a file from the local file system.

source

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,

Check if a file exists on the local file system.

source

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,

Get all the files in a directory recursively.

Object Safety§

This trait is not object safe.

Implementors§