pub struct IoValidator { /* private fields */ }Expand description
IO validator for file operations
Implementations§
Source§impl IoValidator
impl IoValidator
Sourcepub fn with_permissions(permission_model: PermissionModel) -> Self
pub fn with_permissions(permission_model: PermissionModel) -> Self
Create an IO validator with custom permission model
Sourcepub fn validate_read(&self, path: &Path) -> Result<()>
pub fn validate_read(&self, path: &Path) -> Result<()>
Validate a read operation
Checks:
- File exists
- Read permissions
- Path traversal prevention
Sourcepub fn validate_write(&self, path: &Path) -> Result<()>
pub fn validate_write(&self, path: &Path) -> Result<()>
Validate a write operation
Checks:
- Parent directory exists
- Write permissions
- Path traversal prevention
Sourcepub fn validate_reads(&self, paths: &[&Path]) -> Result<Vec<PathValidation>>
pub fn validate_reads(&self, paths: &[&Path]) -> Result<Vec<PathValidation>>
Validate multiple read operations
Sourcepub fn validate_writes(&self, paths: &[&Path]) -> Result<Vec<PathValidation>>
pub fn validate_writes(&self, paths: &[&Path]) -> Result<Vec<PathValidation>>
Validate multiple write operations
Trait Implementations§
Source§impl Debug for IoValidator
impl Debug for IoValidator
Auto Trait Implementations§
impl Freeze for IoValidator
impl RefUnwindSafe for IoValidator
impl Send for IoValidator
impl Sync for IoValidator
impl Unpin for IoValidator
impl UnwindSafe for IoValidator
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