webp_rust/encoder/
error.rs1use std::fmt::{Display, Formatter, Result as FmtResult};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum EncoderError {
6 InvalidParam(&'static str),
8 Bitstream(&'static str),
10}
11
12impl Display for EncoderError {
13 fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
14 match self {
15 Self::InvalidParam(msg) => write!(f, "invalid parameter: {msg}"),
16 Self::Bitstream(msg) => write!(f, "bitstream error: {msg}"),
17 }
18 }
19}
20
21impl std::error::Error for EncoderError {}