use core::{error::Error, fmt::Display};
pub use ixy::HasSize;
pub type Pos = ixy::Pos<usize>;
pub type Rect = ixy::Rect<usize>;
pub type Size = ixy::Size;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub enum GridError {
OutOfBounds {
pos: Pos,
},
}
impl Display for GridError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::OutOfBounds { pos } => write!(f, "Position out of bounds: {pos}"),
}
}
}
impl Error for GridError {}