Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem: Send + Sync {
    // Required methods
    fn canonicalize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_beneath<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        root: &'life1 Path,
        path: &'life2 Path,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncRead + Send + Unpin>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Asynchronous filesystem boundary used by harness tools.

The harness uses this boundary for diagnostic path resolution and descriptor-relative opening, keeping repository containment inside the filesystem operation.

Required Methods§

Source

fn canonicalize<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolves a path to its canonical absolute representation.

§Errors

Returns an I/O error when the path cannot be resolved.

Source

fn open_beneath<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root: &'life1 Path, path: &'life2 Path, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncRead + Send + Unpin>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Opens a repository-relative file without following symlinks beneath root.

§Errors

Returns an I/O error when path is invalid, traverses a symlink, does not name a regular file, or cannot be opened for reading.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§