pub struct WrapConfig {
pub enabled: bool,
pub mode: WrapMode,
pub commands: HashSet<String>,
pub custom_commands: HashSet<String>,
pub server: String,
pub verbose: bool,
pub log_sessions: bool,
pub log_directory: Option<PathBuf>,
}Expand description
Wrap command configuration
Fields§
§enabled: boolWhether auto-wrapping is enabled
mode: WrapModeProtection mode: “warning” or “blocking”
commands: HashSet<String>List of commands to auto-wrap
custom_commands: HashSet<String>Additional user-defined commands to wrap
server: StringServer URL for threat detection
verbose: boolWhether to show detailed threat information
log_sessions: boolWhether to log wrapped sessions
log_directory: Option<PathBuf>Path to session log directory
Implementations§
Source§impl WrapConfig
impl WrapConfig
Sourcepub fn load_from_path(path: &Path) -> Result<Self>
pub fn load_from_path(path: &Path) -> Result<Self>
Load configuration from a specific path
Sourcepub fn save_to_path(&self, path: &Path) -> Result<()>
pub fn save_to_path(&self, path: &Path) -> Result<()>
Save configuration to a specific path
Sourcepub fn default_config_path() -> Result<PathBuf>
pub fn default_config_path() -> Result<PathBuf>
Get the default configuration file path
Sourcepub fn should_wrap(&self, command: &str) -> bool
pub fn should_wrap(&self, command: &str) -> bool
Check if a command should be wrapped
Sourcepub fn add_command(&mut self, command: String)
pub fn add_command(&mut self, command: String)
Add a custom command to wrap
Sourcepub fn remove_command(&mut self, command: &str) -> bool
pub fn remove_command(&mut self, command: &str) -> bool
Remove a command from the wrap list
Sourcepub fn create_default_config() -> Result<()>
pub fn create_default_config() -> Result<()>
Create a default configuration file with example settings
Sourcepub fn mode_string(&self) -> &'static str
pub fn mode_string(&self) -> &'static str
Get effective mode as a string
Trait Implementations§
Source§impl Clone for WrapConfig
impl Clone for WrapConfig
Source§fn clone(&self) -> WrapConfig
fn clone(&self) -> WrapConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WrapConfig
impl Debug for WrapConfig
Source§impl Default for WrapConfig
impl Default for WrapConfig
Source§impl<'de> Deserialize<'de> for WrapConfig
impl<'de> Deserialize<'de> for WrapConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WrapConfig
impl RefUnwindSafe for WrapConfig
impl Send for WrapConfig
impl Sync for WrapConfig
impl Unpin for WrapConfig
impl UnsafeUnpin for WrapConfig
impl UnwindSafe for WrapConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more