#[non_exhaustive]pub enum Error {
Io(Error),
InvalidSignature([u8; 4]),
InvalidPageTag,
InvalidPageEnd,
InvalidCookieHeaderEnd,
UnexpectedEof,
TooManyPages(u32),
TooManyCookies(u32),
CookieTooLarge {
component: Component,
size: u32,
},
CookieTotalTooLarge(u32),
MalformedOffsets,
}Expand description
Errors produced while decoding a .binarycookies file.
Every malformed input maps to a variant here; the decoder never panics.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
The underlying reader failed; only from_reader / from_path produce this.
InvalidSignature([u8; 4])
The file does not start with the cook magic; carries the four bytes found.
InvalidPageTag
A page does not start with the 00 00 01 00 tag.
InvalidPageEnd
A page header does not end with the 00 00 00 00 marker.
InvalidCookieHeaderEnd
A cookie header does not end with the 00 00 00 00 marker.
UnexpectedEof
The input ended before the structure it declares was fully read.
TooManyPages(u32)
The declared page count exceeds the hardening cap of 65 536.
TooManyCookies(u32)
The declared per-page cookie count exceeds the hardening cap of 1 048 576.
CookieTooLarge
One of the five cookie components is longer than 4096 bytes.
Fields
CookieTotalTooLarge(u32)
The five cookie components together exceed 4096 bytes.
MalformedOffsets
Cookie string offsets are not monotonically increasing.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()