kcl_lib::fs

Trait 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 read_to_string<'life0, 'async_trait, P>(
        &'life0 self,
        path: P,
        source_range: SourceRange,
    ) -> Pin<Box<dyn Future<Output = Result<String, 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 read_to_string<'life0, 'async_trait, P>( &'life0 self, path: P, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<String, 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.

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§