use std::path::{Path, PathBuf};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ExternalWriteKind {
Create,
Update,
Delete,
}
pub trait ExternalTreePolicy: std::fmt::Debug + Send + Sync {
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>;
}