propaga-core 1.1.0

Core types and traits for the Propaga constraint solver
Documentation
use crate::VariableId;
use thiserror::Error;

/// Errors returned by the propagation engine.
#[derive(Debug, Error, PartialEq, Eq)]
pub enum PropagaError {
    /// A variable domain became empty during propagation.
    #[error("domain of variable {0:?} is empty")]
    DomainEmpty(VariableId),

    /// A variable handle does not exist in the engine.
    #[error("unknown variable {0:?}")]
    UnknownVariable(VariableId),

    /// A propagator handle does not exist in the engine.
    #[error("unknown propagator")]
    UnknownPropagator,

    /// A variable was used with the wrong domain type.
    #[error("variable {variable:?} expected {expected} domain")]
    TypeMismatch {
        /// Variable handle.
        variable: VariableId,
        /// Expected domain kind label.
        expected: String,
    },
}