liminal-server 0.23.1

Standalone server for the liminal messaging bus
Documentation
//! Where the console's records go.

use super::error::ConsoleError;

/// The server's own publish path for console records (SRV-012 R3: the
/// publish with a server origin), and the roster removal of a tap channel
/// whose last subscriber left (R6).
pub trait ServerPublisher {
    /// Publishes `payload` on `subject` as the server.
    ///
    /// # Errors
    /// Returns [`ConsoleError`] when the publish fails; the hub keeps the
    /// record and offers it first on the next pump. The payload is borrowed
    /// so that a failed record is still the hub's to keep.
    fn publish_console(&self, subject: &str, payload: &[u8]) -> Result<(), ConsoleError>;

    /// Removes the `console.tap.<target>` channel `subject` from the roster.
    ///
    /// # Errors
    /// Returns [`ConsoleError`] when the roster refuses.
    fn retire_console_channel(&self, subject: &str) -> Result<(), ConsoleError>;
}