pub enum AlphError {
EmptyPayload,
DimensionsOverflow {
width: u32,
height: u32,
},
RawLengthMismatch {
expected: usize,
actual: usize,
},
UnsupportedCompression(u8),
Vp8l(DecodeError),
}Expand description
Errors raised by the §2.7.1.2 ALPH info-byte parser and the
decode_alpha bitstream decoder.
Variants§
EmptyPayload
The ALPH payload is empty — at minimum one info byte is required per §2.7.1.2 Figure 10, even if the alpha bitstream itself is zero-length (which §2.7.1.2 does not forbid).
DimensionsOverflow
width * height overflowed usize (or u32), so the plane
cannot be addressed on this platform.
Fields
RawLengthMismatch
Compression method 0 (raw) but the alpha bitstream length does
not equal width * height (§2.7.1.2: “a byte sequence of
length = width * height”).
Fields
UnsupportedCompression(u8)
Compression method C was 2 or 3 — undefined by §2.7.1.2.
Vp8l(DecodeError)
The compression-method-1 §3 VP8L image-stream failed to decode.
Trait Implementations§
impl Eq for AlphError
Source§impl Error for AlphError
impl Error for AlphError
1.30.0 · 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()
Source§impl From<DecodeError> for AlphError
impl From<DecodeError> for AlphError
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for AlphError
Auto Trait Implementations§
impl Freeze for AlphError
impl RefUnwindSafe for AlphError
impl Send for AlphError
impl Sync for AlphError
impl Unpin for AlphError
impl UnsafeUnpin for AlphError
impl UnwindSafe for AlphError
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