#[non_exhaustive]pub enum Error {
Io(Error),
Truncated {
expected: u64,
},
InlineTooLarge {
size: usize,
max: usize,
},
UnknownChunkType(u8),
FilenameTooLong {
len: usize,
max: usize,
},
InvalidFilename {
reason: &'static str,
},
DirfdIndexOutOfRange {
index: u32,
count: usize,
},
ExternalTooShort {
declared: u64,
actual: u64,
},
}Expand description
Errors that can occur while reading or writing a splitdirfdstream.
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.
Io(Error)
An underlying I/O error.
Truncated
The stream ended in the middle of a chunk.
Fields
§
expected: u64How many bytes were still expected when EOF was encountered.
Semantics depend on where truncation occurred:
- Type byte:
1if EOF arrived after 0 bytes (but that is returned asOk(None); this only fires for 0 < n < expected). - Inline body or FileBackedData header/name: the full declared
size (i.e. the number passed to
read_exact), becauseread_exactdoes not report how many bytes it successfully consumed before EOF.
InlineTooLarge
An inline chunk’s size field exceeds MAX_INLINE_CHUNK_SIZE.
UnknownChunkType(u8)
An unrecognised chunk type byte was encountered.
FilenameTooLong
A filename exceeds MAX_FILENAME_LEN bytes.
InvalidFilename
A filename failed validation.
DirfdIndexOutOfRange
A dirfd index in an external chunk was out of range.
ExternalTooShort
An external file was shorter than declared in the stream.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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