#[non_exhaustive]pub enum UnsafePathError {
ParentDir,
Absolute,
ReservedName,
EscapesRoot,
}Available on crate feature
std only.Expand description
Error returned when a path is rejected as unsafe.
Converts into an std::io::Error with
std::io::ErrorKind::InvalidInput.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ParentDir
The path contained a parent-directory (..) component, which can be
used to escape the intended directory (“dot-dot” traversal).
Absolute
An absolute path (or one carrying a root/drive/UNC prefix) was supplied where only a relative path is permitted (e.g. when confined to a root).
ReservedName
A component matched a reserved device name (e.g. Windows CON, NUL,
COM1), which has special and surprising filesystem semantics.
EscapesRoot
The fully resolved path escaped the configured root directory, e.g. through a symbolic link pointing outside of it.
Trait Implementations§
Source§impl Clone for UnsafePathError
impl Clone for UnsafePathError
Source§impl Debug for UnsafePathError
impl Debug for UnsafePathError
Source§impl Display for UnsafePathError
impl Display for UnsafePathError
impl Eq for UnsafePathError
Source§impl Error for UnsafePathError
impl Error for UnsafePathError
1.30.0 · 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()
Source§impl From<UnsafePathError> for Error
impl From<UnsafePathError> for Error
Source§fn from(err: UnsafePathError) -> Self
fn from(err: UnsafePathError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UnsafePathError
impl PartialEq for UnsafePathError
impl StructuralPartialEq for UnsafePathError
Auto Trait Implementations§
impl Freeze for UnsafePathError
impl RefUnwindSafe for UnsafePathError
impl Send for UnsafePathError
impl Sync for UnsafePathError
impl Unpin for UnsafePathError
impl UnsafeUnpin for UnsafePathError
impl UnwindSafe for UnsafePathError
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