Skip to main content

rill_core/queues/
error.rs

1//! Queue operation error types.
2
3use thiserror::Error;
4
5/// Result type alias for queue operations.
6pub type QueueResult<T> = Result<T, QueueError>;
7
8/// Errors that can occur during queue operations.
9#[derive(Error, Debug, PartialEq)]
10pub enum QueueError {
11    /// The queue is full and cannot accept more elements.
12    #[error("Queue is full")]
13    QueueFull,
14    /// The queue is empty and has no elements to pop.
15    #[error("Queue is empty")]
16    QueueEmpty,
17    /// The channel has been disconnected (all senders/receivers dropped).
18    #[error("Channel disconnected")]
19    ChannelDisconnected,
20    /// A queue operation timed out.
21    #[error("Operation timed out")]
22    Timeout,
23    /// The requested operation is not supported by this queue type.
24    #[error("Operation not supported: {0}")]
25    Unsupported(String),
26    /// Failed to send data through the queue.
27    #[error("Send failed: {0}")]
28    SendFailed(String),
29    /// Failed to receive data from the queue.
30    #[error("Receive failed: {0}")]
31    ReceiveFailed(String),
32}