pub enum ReadRefusal {
OutsideRoot {
path: PathBuf,
root: PathBuf,
},
NotRegularFile {
path: PathBuf,
},
TooLarge {
path: PathBuf,
max_bytes: u64,
},
Io {
path: PathBuf,
source: Error,
},
}Expand description
The reason that a bounded read refused a file.
The Display text names the path and the reason. It never contains
content of the file.
Variants§
OutsideRoot
The path, after symlinks are resolved, is outside the root.
Fields
NotRegularFile
The path is not a regular file, for example a directory or a device.
TooLarge
The file is larger than the limit.
Io
The path or the root does not resolve, or the read failed.
Implementations§
Source§impl ReadRefusal
impl ReadRefusal
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
True when the file does not exist. A link on the path that does not
resolve gives ReadRefusal::OutsideRoot, not this state, so a
dangling link and a link to a file outside the root look the same.
Trait Implementations§
Source§impl Debug for ReadRefusal
impl Debug for ReadRefusal
Source§impl Display for ReadRefusal
impl Display for ReadRefusal
Source§impl Error for ReadRefusal
impl Error for ReadRefusal
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 ReadRefusal
impl !UnwindSafe for ReadRefusal
impl Forget for ReadRefusal
impl Freeze for ReadRefusal
impl Move for ReadRefusal
impl Send for ReadRefusal
impl Sync for ReadRefusal
impl Unpin for ReadRefusal
impl UnsafeUnpin for ReadRefusal
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
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more