sim_lib_discrete_comb/error.rs
1//! Error type for discrete combinatorics.
2
3/// Errors raised by combinatorial counts, enumerators, and ordinals.
4#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
5pub enum CombError {
6 /// An explicit enumeration limit was exceeded.
7 #[error("limit exceeded: {0}")]
8 LimitExceeded(String),
9 /// An ordinal or index fell outside the valid range of its family.
10 #[error("out of range: {value} >= bound {bound}")]
11 OutOfRange {
12 /// The offending value.
13 value: String,
14 /// The exclusive upper bound.
15 bound: String,
16 },
17 /// The supplied parameters do not describe a valid combinatorial family.
18 #[error("invalid parameters: {0}")]
19 InvalidParameters(String),
20}