pub trait ExternalTreePolicy:
Debug
+ Send
+ Sync {
// Required methods
fn root(&self) -> &Path;
fn governs_path(&self, path: &Path) -> bool;
fn on_text_read(&self, path: &Path) -> Result<(), String>;
fn authorize_write(
&self,
kind: ExternalWriteKind,
path: &Path,
byte_len: usize,
) -> Result<(), String>;
fn on_writes_committed(&self, paths: &[PathBuf]) -> Result<(), String>;
}Expand description
Governance and lifecycle hooks for an external writable tree outside the workspace root (for example a durable memory store).
Required Methods§
Sourcefn root(&self) -> &Path
fn root(&self) -> &Path
Returns the canonical or configured root directory of the external tree.
Sourcefn governs_path(&self, path: &Path) -> bool
fn governs_path(&self, path: &Path) -> bool
Returns whether path is governed by this external tree policy.
Sourcefn on_text_read(&self, path: &Path) -> Result<(), String>
fn on_text_read(&self, path: &Path) -> Result<(), String>
Records that path was successfully read as UTF-8 text.
Authorizes a pending write of kind and byte_len bytes to path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".