pub struct PathAllowlist {
pub read: HashSet<PathBuf>,
pub write: HashSet<PathBuf>,
pub deny: HashSet<PathBuf>,
}Expand description
Allowlist for filesystem paths.
Fields§
§read: HashSet<PathBuf>Allowed paths for reading.
write: HashSet<PathBuf>Allowed paths for writing.
deny: HashSet<PathBuf>Denied paths (overrides allowlist).
Implementations§
Source§impl PathAllowlist
impl PathAllowlist
Sourcepub fn allow_read(self, path: impl Into<PathBuf>) -> Self
pub fn allow_read(self, path: impl Into<PathBuf>) -> Self
Add a path for reading.
Sourcepub fn allow_write(self, path: impl Into<PathBuf>) -> Self
pub fn allow_write(self, path: impl Into<PathBuf>) -> Self
Add a path for writing.
Sourcepub fn check_read(&self, path: &Path) -> Result<()>
pub fn check_read(&self, path: &Path) -> Result<()>
Check read permission, returning error if denied.
Sourcepub fn check_write(&self, path: &Path) -> Result<()>
pub fn check_write(&self, path: &Path) -> Result<()>
Check write permission, returning error if denied.
Trait Implementations§
Source§impl Clone for PathAllowlist
impl Clone for PathAllowlist
Source§fn clone(&self) -> PathAllowlist
fn clone(&self) -> PathAllowlist
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 PathAllowlist
impl Debug for PathAllowlist
Source§impl Default for PathAllowlist
impl Default for PathAllowlist
Source§fn default() -> PathAllowlist
fn default() -> PathAllowlist
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathAllowlist
impl RefUnwindSafe for PathAllowlist
impl Send for PathAllowlist
impl Sync for PathAllowlist
impl Unpin for PathAllowlist
impl UnwindSafe for PathAllowlist
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