Skip to main content

spatialrust_distribute/
error.rs

1//! Distributed execution errors.
2
3/// Result type for distribute operations.
4pub type DistributeResult<T> = Result<T, DistributeError>;
5
6/// Failures in partition graphs and transfers.
7#[derive(Debug, thiserror::Error)]
8pub enum DistributeError {
9    /// Invalid configuration.
10    #[error("invalid distribute configuration: {0}")]
11    InvalidConfiguration(String),
12    /// Missing node or transfer.
13    #[error("missing `{0}`")]
14    Missing(String),
15    /// Partition graph contains a cycle.
16    #[error("partition graph contains a cycle")]
17    CycleDetected,
18    /// Transfer queue reached its hard backpressure limit.
19    #[error("transfer queue `{queue}` at capacity: depth {depth} >= hard_limit {hard_limit}")]
20    CapacityExceeded {
21        /// Queue / transfer name used for diagnostics.
22        queue: String,
23        /// Observed depth.
24        depth: usize,
25        /// Configured hard limit.
26        hard_limit: usize,
27    },
28}