tinymist_world

Trait ShadowApi

Source
pub trait ShadowApi {
    // Required methods
    fn shadow_paths(&self) -> Vec<Arc<Path>>;
    fn shadow_ids(&self) -> Vec<FileId>;
    fn map_shadow(&mut self, path: &Path, content: Bytes) -> FileResult<()>;
    fn unmap_shadow(&mut self, path: &Path) -> FileResult<()>;
    fn map_shadow_by_id(
        &mut self,
        file_id: FileId,
        content: Bytes,
    ) -> FileResult<()>;
    fn unmap_shadow_by_id(&mut self, file_id: FileId) -> FileResult<()>;

    // Provided method
    fn reset_shadow(&mut self) { ... }
}
Expand description

Latest version of the shadow api, which is in beta.

Required Methods§

Source

fn shadow_paths(&self) -> Vec<Arc<Path>>

Get the shadow files.

Source

fn shadow_ids(&self) -> Vec<FileId>

Get the shadow files by file id.

Source

fn map_shadow(&mut self, path: &Path, content: Bytes) -> FileResult<()>

Add a shadow file to the driver.

Source

fn unmap_shadow(&mut self, path: &Path) -> FileResult<()>

Add a shadow file to the driver.

Source

fn map_shadow_by_id( &mut self, file_id: FileId, content: Bytes, ) -> FileResult<()>

Add a shadow file to the driver by file id. Note: If a path is both shadowed by id and by path, the shadow by id will be used.

Source

fn unmap_shadow_by_id(&mut self, file_id: FileId) -> FileResult<()>

Add a shadow file to the driver by file id. Note: If a path is both shadowed by id and by path, the shadow by id will be used.

Provided Methods§

Source

fn reset_shadow(&mut self)

Reset the shadow files.

Implementors§