pub enum ContainerError {
TooShortForHeader {
got: usize,
},
NotRiff {
got: FourCc,
},
NotWebp {
got: FourCc,
},
RiffSizeOverflowsBuffer {
declared: u32,
buffer_len: usize,
},
TruncatedChunkHeader {
offset: usize,
},
ChunkPayloadOverflowsRiff {
offset: usize,
declared: u32,
available: usize,
},
MissingPadByte {
offset: usize,
},
}Expand description
Errors raised by the RIFF/WEBP walker. The walker reports the first structural problem it sees and stops — it is not a recovery layer.
Variants§
TooShortForHeader
The buffer is shorter than the 12-byte §2.4 file header.
NotRiff
Bytes 0..4 are not the ASCII tag RIFF.
NotWebp
Bytes 8..12 are not the ASCII tag WEBP.
RiffSizeOverflowsBuffer
The §2.4 File Size field says the payload extends past the
end of the buffer. The header File Size counts the
WEBP FourCC plus everything after it.
Fields
TruncatedChunkHeader
A chunk header was truncated — the 8 bytes required to read
FourCC + Size do not fit in what remains of the RIFF
payload at offset.
Fields
ChunkPayloadOverflowsRiff
A chunk’s declared Size value runs past the end of the RIFF
payload — i.e. payload Size bytes would extend beyond the
region delimited by the outer §2.4 file header.
Fields
MissingPadByte
A chunk’s declared Size value is odd, and the §2.3 padding
byte that would follow it is missing because there are no
further bytes in the RIFF payload.
Trait Implementations§
Source§impl Clone for ContainerError
impl Clone for ContainerError
Source§fn clone(&self) -> ContainerError
fn clone(&self) -> ContainerError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerError
impl Debug for ContainerError
Source§impl Display for ContainerError
impl Display for ContainerError
impl Eq for ContainerError
Source§impl Error for ContainerError
impl Error for ContainerError
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()
Source§impl From<ContainerError> for Error
impl From<ContainerError> for Error
Source§fn from(e: ContainerError) -> Self
fn from(e: ContainerError) -> Self
Source§impl PartialEq for ContainerError
impl PartialEq for ContainerError
Source§fn eq(&self, other: &ContainerError) -> bool
fn eq(&self, other: &ContainerError) -> bool
self and other values to be equal, and is used by ==.