Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem: Send + Sync {
    // Required methods
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 TypedPath,
        source_range: SourceRange,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KclError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_to_string<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 TypedPath,
        source_range: SourceRange,
    ) -> Pin<Box<dyn Future<Output = Result<String, KclError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 TypedPath,
        source_range: SourceRange,
    ) -> Pin<Box<dyn Future<Output = Result<bool, KclError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_all_files<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 TypedPath,
        source_range: SourceRange,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TypedPath>, KclError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 TypedPath, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read a file from the local file system.

Source

fn read_to_string<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 TypedPath, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<String, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read a file from the local file system.

Source

fn exists<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 TypedPath, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<bool, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a file exists on the local file system.

Source

fn get_all_files<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 TypedPath, source_range: SourceRange, ) -> Pin<Box<dyn Future<Output = Result<Vec<TypedPath>, KclError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all the files in a directory recursively.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§