tinymist_world

Trait ShadowApiExt

Source
pub trait ShadowApiExt {
    // Required methods
    fn with_shadow_file<T>(
        &mut self,
        file_path: &Path,
        content: Bytes,
        f: impl FnOnce(&mut Self) -> SourceResult<T>,
    ) -> SourceResult<T>;
    fn with_shadow_file_by_id<T>(
        &mut self,
        file_id: FileId,
        content: Bytes,
        f: impl FnOnce(&mut Self) -> SourceResult<T>,
    ) -> SourceResult<T>;
}

Required Methods§

Source

fn with_shadow_file<T>( &mut self, file_path: &Path, content: Bytes, f: impl FnOnce(&mut Self) -> SourceResult<T>, ) -> SourceResult<T>

Wrap the driver with a given shadow file and run the inner function.

Source

fn with_shadow_file_by_id<T>( &mut self, file_id: FileId, content: Bytes, f: impl FnOnce(&mut Self) -> SourceResult<T>, ) -> SourceResult<T>

Wrap the driver with a given shadow file and run the inner function by file id. Note: to enable this function, ShadowApi must implement _shadow_map_id.

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§