pub trait ShadowApi {
// Required methods
fn shadow_paths(&self) -> Vec<Arc<Path>>;
fn map_shadow(&mut self, path: &Path, content: Bytes) -> FileResult<()>;
fn unmap_shadow(&mut self, path: &Path) -> FileResult<()>;
// Provided methods
fn _shadow_map_id(&self, _file_id: FileId) -> FileResult<PathBuf> { ... }
fn reset_shadow(&mut self) { ... }
fn map_shadow_by_id(
&mut self,
file_id: FileId,
content: Bytes,
) -> FileResult<()> { ... }
fn unmap_shadow_by_id(&mut self, file_id: FileId) -> FileResult<()> { ... }
}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 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.
Provided Methods§
fn _shadow_map_id(&self, _file_id: FileId) -> FileResult<PathBuf>
Sourcefn reset_shadow(&mut self)
fn reset_shadow(&mut self)
Reset the shadow files.
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: to enable this function, ShadowApi must implement
_shadow_map_id.
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: to enable this function, ShadowApi must implement
_shadow_map_id.