liminal-server 0.23.1

Standalone server for the liminal messaging bus
Documentation
//! What a console stream operation can fail with.

use crate::ServerError;
use crate::tap::TapError;

/// A console stream operation's failure.
#[derive(Debug, thiserror::Error)]
pub enum ConsoleError {
    /// A tap or feed lock was poisoned.
    #[error(transparent)]
    Tap(#[from] TapError),
    /// Building the topology or publishing a record failed.
    #[error("console {subject}: {source}")]
    Server {
        /// The subject being built or published.
        subject: String,
        /// The server's error.
        #[source]
        source: ServerError,
    },
    /// A record could not be serialised.
    #[error("console {record} record could not be encoded: {source}")]
    Encode {
        /// Which record (`topology` or `tap.batch`).
        record: &'static str,
        /// The serialiser's error.
        #[source]
        source: serde_json::Error,
    },
    /// The wall clock could not give the console a time.
    #[error("console clock: {reason}")]
    Clock {
        /// What was wrong with the reading.
        reason: String,
    },
    /// A new tap would pass the live-tap limit (`CONSOLE_TAP_LIMIT_REFUSED`).
    #[error("console tap {subject} refused: {limit} taps are live")]
    TapLimit {
        /// The `console.tap.<target>` subject.
        subject: String,
        /// The limit.
        limit: usize,
    },
    /// The topology feed cannot assign another ordered revision.
    #[error("console topology revision overflow")]
    TopologyRevisionOverflow,
    /// The device name is empty, so `liminal.<device>` would be meaningless.
    #[error("console device name is empty")]
    EmptyDevice,
}