use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum BinPackingError {
#[error("invalid input: {0}")]
InvalidInput(String),
#[error("unsupported configuration: {0}")]
Unsupported(String),
#[error("no feasible stock can fit demand `{item}` with length {length}")]
Infeasible1D {
item: String,
length: u32,
},
#[error("no feasible sheet can fit item `{item}` with size {width}x{height}")]
Infeasible2D {
item: String,
width: u32,
height: u32,
},
#[error("no feasible bin can fit item `{item}` with size {width}x{height}x{depth}")]
Infeasible3D {
item: String,
width: u32,
height: u32,
depth: u32,
},
}
pub type Result<T> = std::result::Result<T, BinPackingError>;