pub trait FsPermissions: Send + Sync {
// Required methods
fn check_open<'a>(
&mut self,
resolved: bool,
read: bool,
write: bool,
path: &'a Path,
api_name: &str
) -> Result<Cow<'a, Path>, FsError>;
fn check_read(
&mut self,
path: &Path,
api_name: &str
) -> Result<(), AnyError>;
fn check_read_all(&mut self, api_name: &str) -> Result<(), AnyError>;
fn check_read_blind(
&mut self,
p: &Path,
display: &str,
api_name: &str
) -> Result<(), AnyError>;
fn check_write(
&mut self,
path: &Path,
api_name: &str
) -> Result<(), AnyError>;
fn check_write_partial(
&mut self,
path: &Path,
api_name: &str
) -> Result<(), AnyError>;
fn check_write_all(&mut self, api_name: &str) -> Result<(), AnyError>;
fn check_write_blind(
&mut self,
p: &Path,
display: &str,
api_name: &str
) -> Result<(), AnyError>;
// Provided method
fn check<'a>(
&mut self,
resolved: bool,
open_options: &OpenOptions,
path: &'a Path,
api_name: &str
) -> Result<Cow<'a, Path>, FsError> { ... }
}