pub enum PathSecurityError {
EmptyPath,
InteriorNul,
ParentTraversal(PathBuf),
OutsideBase {
path: PathBuf,
base: PathBuf,
},
SymlinkDenied(PathBuf),
NotRegularFile(PathBuf),
TooLarge {
size: u64,
limit: u64,
},
Io {
path: PathBuf,
source: Error,
},
}Expand description
Errors that can occur while securely resolving and opening an input path.
Variants§
EmptyPath
The supplied path was empty.
InteriorNul
The supplied path contained an interior NUL byte.
ParentTraversal(PathBuf)
A .. component was present while a base directory was configured.
OutsideBase
The resolved path lay outside the configured base directory.
Fields
SymlinkDenied(PathBuf)
A symbolic link was encountered while symlinks were disallowed.
NotRegularFile(PathBuf)
The path resolved to something other than a regular file.
TooLarge
The input exceeded the configured byte limit.
Fields
Io
An underlying I/O error occurred while accessing the path.
Trait Implementations§
Source§impl Debug for PathSecurityError
impl Debug for PathSecurityError
Source§impl Display for PathSecurityError
impl Display for PathSecurityError
Source§impl Error for PathSecurityError
impl Error for PathSecurityError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PathSecurityError
impl !UnwindSafe for PathSecurityError
impl Freeze for PathSecurityError
impl Send for PathSecurityError
impl Sync for PathSecurityError
impl Unpin for PathSecurityError
impl UnsafeUnpin for PathSecurityError
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