use thiserror::Error;
pub type Result<T> = std::result::Result<T, Dijkstra3dError>;
#[derive(Error, Debug, Clone, PartialEq, Eq)]
pub enum Dijkstra3dError {
#[error("voxel index {idx} out of bounds for volume of size {volume_size}")]
OutOfBounds {
idx: u64,
volume_size: u64,
},
#[error("invalid connectivity {got}; expected one of {{4, 8, 6, 18, 26}}")]
InvalidConnectivity {
got: u32,
},
#[error("target unreachable from source")]
Unreachable,
#[error("anisotropy length {got} does not match volume dimensionality {expected}")]
AnisotropyDimMismatch {
got: usize,
expected: usize,
},
#[error("sources length {sources} != max_distances length {max_distances}")]
LengthMismatch {
sources: usize,
max_distances: usize,
},
#[error("invalid input: {0}")]
InvalidInput(String),
}