pub trait PathGuard:
Send
+ Sync
+ Debug {
// Required methods
fn restore_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext,
target: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn command_writes(
&self,
globs: &[String],
root: &Path,
) -> (Arc<dyn WriteScope>, Vec<String>);
fn host_writes(&self, globs: &[String], cwd: &Path) -> Arc<dyn WriteScope> ⓘ;
fn reaches_configuration(
&self,
path: &str,
cwd: &Path,
paths: &SensitivePaths,
) -> bool;
fn admits(&self, grant: &Grant) -> Result<(), GrantError>;
}Required Methods§
Sourcefn restore_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext,
target: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn restore_check<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 ToolContext,
target: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Whether a rewind may write target back, judged from ctx:
Ok(true) when it lies outside the session’s writable roots, Err
with why when it must not be written at all.
Sourcefn command_writes(
&self,
globs: &[String],
root: &Path,
) -> (Arc<dyn WriteScope>, Vec<String>)
fn command_writes( &self, globs: &[String], root: &Path, ) -> (Arc<dyn WriteScope>, Vec<String>)
A plugin command’s writes globs below root: the scope kept, and the
globs left out because they reach beyond the project.
Sourcefn host_writes(&self, globs: &[String], cwd: &Path) -> Arc<dyn WriteScope> ⓘ
fn host_writes(&self, globs: &[String], cwd: &Path) -> Arc<dyn WriteScope> ⓘ
A host-started delegate’s writes, every glob kept, a relative one
anchored at cwd.
Sourcefn reaches_configuration(
&self,
path: &str,
cwd: &Path,
paths: &SensitivePaths,
) -> bool
fn reaches_configuration( &self, path: &str, cwd: &Path, paths: &SensitivePaths, ) -> bool
Whether writing path from cwd reaches configuration under any of
its spellings.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".