pub struct FileProtectionSystem { /* private fields */ }
Expand description
File protection and constraints system
Implementations§
Source§impl FileProtectionSystem
impl FileProtectionSystem
Sourcepub fn with_config(config: ProtectionConfig) -> Self
pub fn with_config(config: ProtectionConfig) -> Self
Create protection system with custom configuration
Sourcepub fn validate_edit(&self, edit: &ModifiableEdit) -> Result<ProtectionResult>
pub fn validate_edit(&self, edit: &ModifiableEdit) -> Result<ProtectionResult>
Validate edit against all protection constraints
Sourcepub fn add_protection_rule(&mut self, pattern: String, rule: FileProtectionRule)
pub fn add_protection_rule(&mut self, pattern: String, rule: FileProtectionRule)
Add new file protection rule
Sourcepub fn add_function_constraint(
&mut self,
name: String,
constraint: FunctionConstraint,
)
pub fn add_function_constraint( &mut self, name: String, constraint: FunctionConstraint, )
Add function-level constraint
Sourcepub fn config(&self) -> &ProtectionConfig
pub fn config(&self) -> &ProtectionConfig
Get configuration for display purposes
Trait Implementations§
Source§impl Debug for FileProtectionSystem
impl Debug for FileProtectionSystem
Auto Trait Implementations§
impl Freeze for FileProtectionSystem
impl RefUnwindSafe for FileProtectionSystem
impl Send for FileProtectionSystem
impl Sync for FileProtectionSystem
impl Unpin for FileProtectionSystem
impl UnwindSafe for FileProtectionSystem
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