use rustix::io::Errno;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DumbError {
#[error("invalid dumb buffer configuration: {reason}")]
InvalidConfig {
reason: &'static str,
},
#[error("format {fourcc:#010x} is not a supported semi-planar layout")]
UnsupportedFormat {
fourcc: u32,
},
#[error("dumb buffer geometry overflows a 32-bit kernel field: {what}")]
TooLarge {
what: &'static str,
},
#[error("dumb buffer operation failed: {0}")]
Io(#[from] Errno),
}
pub type Result<T> = std::result::Result<T, DumbError>;