hyperi-rustlib 2.8.6

There's plenty of sage advice out there about how to run Rust services in production at scale — config cascades, structured logging, masking secrets, multi-backend secrets management, Prometheus, OpenTelemetry, Kafka transports, tiered disk-spillover sinks, adaptive worker pools, graceful shutdown — but almost none of it as code you can just install and use. This is that code. Opinionated, drop-in, working out of the box. The patterns from blog posts, watercooler chats and beers with your Google mates as actual library — not a framework you assemble from twenty crates and 8 weeks of munging.
Documentation
// Project:   hyperi-rustlib
// File:      src/spool/error.rs
// Purpose:   Spool error types
// Language:  Rust
//
// License:   BUSL-1.1
// Copyright: (c) 2026 HYPERI PTY LIMITED

//! Spool error types.

use std::io;
use thiserror::Error;

/// Errors that can occur during spool operations.
#[derive(Debug, Error)]
pub enum SpoolError {
    /// Failed to open or create the queue file.
    #[error("failed to open spool at {path}: {message}")]
    Open { path: String, message: String },

    /// Queue file operation error.
    #[error("spool queue error: {0}")]
    Queue(String),

    /// I/O error during queue operations.
    #[error("spool I/O error: {0}")]
    Io(#[from] io::Error),

    /// Queue has reached its maximum item count.
    #[error("spool is full: maximum {max} items reached")]
    MaxItemsReached { max: usize },

    /// Queue has reached its maximum size.
    #[error("spool is full: maximum size {max_bytes} bytes reached")]
    MaxSizeReached { max_bytes: u64 },

    /// Compression error.
    #[error("compression error: {0}")]
    Compression(String),

    /// Decompression error.
    #[error("decompression error: {0}")]
    Decompression(String),

    /// Queue file is corrupted.
    #[error("spool file is corrupted: {0}")]
    Corrupted(String),
}