pub enum AccessError {
Path(String),
Link(String),
Unexpected(String),
TooLarge(String),
Locked,
Io(String, Error),
}Expand description
Why a path beneath the root could not be used.
Variants§
Path(String)
The path has an empty, . or .. component, or a component with
\, : or NUL; or a name has a /.
Link(String)
A symbolic link at this prefix of the path.
Unexpected(String)
The entry is not a regular file or directory, as the access needs.
TooLarge(String)
The file is larger than the limit of the read.
Locked
Another holder has the root’s lock.
Io(String, Error)
Implementations§
Source§impl AccessError
impl AccessError
Sourcepub fn removal_pending(&self) -> bool
pub fn removal_pending(&self) -> bool
Whether this is a removal that took effect but is not finished: on Windows a removed entry stays, on some file systems, until another program closes it, and goes then.
Sourcepub fn already_exists(&self) -> bool
pub fn already_exists(&self) -> bool
Whether this is SourceDirectory::create refusing because
something is already at the name: a file, a directory, a link
(dangling or not, on Windows any reparse point), or any other entry,
which it left as it was. It is an AccessError::Io whose error is
of kind std::io::ErrorKind::AlreadyExists.
Sourcepub fn may_be_left(&self) -> bool
pub fn may_be_left(&self) -> bool
Whether this is SourceDirectory::create failing after it made
its file and not removing it, so that the file, partly written, may
be left at the name: always on Windows, and on Unix where the entry
at the name could not be told to be still that file. It is an
AccessError::Io of the failure’s own kind. When create fails
otherwise, nothing it made is left.
Trait Implementations§
Source§impl Debug for AccessError
impl Debug for AccessError
Source§impl Display for AccessError
impl Display for AccessError
Source§impl Error for AccessError
impl Error for AccessError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()