pub trait CommandTrustContext {
// Required methods
fn trust_mode(&self) -> bool;
fn trusted_paths(&self) -> Vec<PathBuf>;
fn add_trusted_path(&mut self, raw: &str) -> Result<PathBuf, TrustPathError>;
fn remove_trusted_path(
&mut self,
raw: &str,
) -> Result<(PathBuf, bool), TrustPathError>;
fn usage_label(&self) -> String;
}Expand description
Workspace trust and the per-path allow-list for /trust.
Required Methods§
fn trust_mode(&self) -> bool
fn trusted_paths(&self) -> Vec<PathBuf>
Sourcefn add_trusted_path(&mut self, raw: &str) -> Result<PathBuf, TrustPathError>
fn add_trusted_path(&mut self, raw: &str) -> Result<PathBuf, TrustPathError>
Add a path (the host expands ~ and validates existence).
Sourcefn remove_trusted_path(
&mut self,
raw: &str,
) -> Result<(PathBuf, bool), TrustPathError>
fn remove_trusted_path( &mut self, raw: &str, ) -> Result<(PathBuf, bool), TrustPathError>
Returns the resolved path and whether it was removed.
Sourcefn usage_label(&self) -> String
fn usage_label(&self) -> String
The localized Usage: label used by the /trust on|off usage error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".