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>;
}Expand description
The extension trait for the shadow api.
Required Methods§
Sourcefn with_shadow_file<T>(
    &mut self,
    file_path: &Path,
    content: Bytes,
    f: impl FnOnce(&mut Self) -> SourceResult<T>,
) -> SourceResult<T>
 
fn with_shadow_file<T>( &mut self, file_path: &Path, content: Bytes, f: impl FnOnce(&mut Self) -> SourceResult<T>, ) -> SourceResult<T>
Wraps the universe or world with a given shadow file and runs the inner function.
Sourcefn with_shadow_file_by_id<T>(
    &mut self,
    file_id: FileId,
    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>
Wraps the universe or world with a given shadow file and runs 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.