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§
Sourcefn shadow_paths(&self) -> Vec<Arc<Path>>
fn shadow_paths(&self) -> Vec<Arc<Path>>
Get the shadow files.
Sourcefn shadow_ids(&self) -> Vec<FileId>
fn shadow_ids(&self) -> Vec<FileId>
Get the shadow files by file id.
Sourcefn map_shadow(&mut self, path: &Path, content: Bytes) -> FileResult<()>
fn map_shadow(&mut self, path: &Path, content: Bytes) -> FileResult<()>
Add a shadow file to the driver.
Sourcefn unmap_shadow(&mut self, path: &Path) -> FileResult<()>
fn unmap_shadow(&mut self, path: &Path) -> FileResult<()>
Add a shadow file to the driver.
Sourcefn map_shadow_by_id(
&mut self,
file_id: FileId,
content: Bytes,
) -> FileResult<()>
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.
Sourcefn unmap_shadow_by_id(&mut self, file_id: FileId) -> FileResult<()>
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§
Sourcefn reset_shadow(&mut self)
fn reset_shadow(&mut self)
Reset the shadow files.