1use std::fmt;
4
5#[derive(Debug, Clone, PartialEq, Eq)]
7#[non_exhaustive]
8pub enum Error {
9 InvalidGrid(&'static str),
11 UnsupportedLayout(&'static str),
13 Raster(&'static str),
15}
16
17impl fmt::Display for Error {
18 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19 match self {
20 Self::InvalidGrid(msg) => write!(f, "invalid grid: {msg}"),
21 Self::UnsupportedLayout(name) => write!(f, "unsupported layout: {name}"),
22 Self::Raster(msg) => write!(f, "raster: {msg}"),
23 }
24 }
25}
26
27impl std::error::Error for Error {}