pub struct PrefixRule {
pub pattern: PrefixPattern,
pub decision: Decision,
pub justification: Option<String>,
pub rule_type: RuleType,
pub allowed_directories: Option<Vec<String>>,
pub restrict_to_directories: bool,
}Expand description
Prefix rule for command execution
Fields§
§pattern: PrefixPattern§decision: Decision§justification: Option<String>§rule_type: RuleType§allowed_directories: Option<Vec<String>>Optional: restrict to specific working directories
restrict_to_directories: boolOptional: deny if command tries to access paths outside allowed directories
Implementations§
Source§impl PrefixRule
impl PrefixRule
Sourcepub fn new(
pattern: PrefixPattern,
decision: Decision,
justification: Option<String>,
) -> Self
pub fn new( pattern: PrefixPattern, decision: Decision, justification: Option<String>, ) -> Self
Create a new prefix rule with default settings
Sourcepub fn with_rule_type(self, rule_type: RuleType) -> Self
pub fn with_rule_type(self, rule_type: RuleType) -> Self
Set the rule type
Sourcepub fn with_allowed_directories(self, dirs: Vec<String>) -> Self
pub fn with_allowed_directories(self, dirs: Vec<String>) -> Self
Set allowed directories for this rule
Sourcepub fn with_directory_restriction(self) -> Self
pub fn with_directory_restriction(self) -> Self
Enable directory restriction (block bypass attempts)
Trait Implementations§
Source§impl Clone for PrefixRule
impl Clone for PrefixRule
Source§fn clone(&self) -> PrefixRule
fn clone(&self) -> PrefixRule
Returns a duplicate of the value. Read more
1.0.0 · 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 PrefixRule
impl Debug for PrefixRule
Auto Trait Implementations§
impl Freeze for PrefixRule
impl RefUnwindSafe for PrefixRule
impl Send for PrefixRule
impl Sync for PrefixRule
impl Unpin for PrefixRule
impl UnsafeUnpin for PrefixRule
impl UnwindSafe for PrefixRule
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