pub struct DirScope { /* private fields */ }Expand description
Restricts filesystem operations to a directory subtree.
Paths are canonicalized before comparison to prevent ../ traversal attacks.
If the target path cannot be canonicalized (e.g., it doesn’t exist yet),
the check fails conservatively.
§Example
let scope = DirScope::new("/tmp").unwrap();
// Note: check will fail if /tmp/data.txt doesn't exist (canonicalization)Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DirScope
impl RefUnwindSafe for DirScope
impl Send for DirScope
impl Sync for DirScope
impl Unpin for DirScope
impl UnsafeUnpin for DirScope
impl UnwindSafe for DirScope
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