Skip to main content

liminal_server/console/
publisher.rs

1//! Where the console's records go.
2
3use super::error::ConsoleError;
4
5/// The server's own publish path for console records (SRV-012 R3: the
6/// publish with a server origin), and the roster removal of a tap channel
7/// whose last subscriber left (R6).
8pub trait ServerPublisher {
9    /// Publishes `payload` on `subject` as the server.
10    ///
11    /// # Errors
12    /// Returns [`ConsoleError`] when the publish fails; the hub keeps the
13    /// record and offers it first on the next pump. The payload is borrowed
14    /// so that a failed record is still the hub's to keep.
15    fn publish_console(&self, subject: &str, payload: &[u8]) -> Result<(), ConsoleError>;
16
17    /// Removes the `console.tap.<target>` channel `subject` from the roster.
18    ///
19    /// # Errors
20    /// Returns [`ConsoleError`] when the roster refuses.
21    fn retire_console_channel(&self, subject: &str) -> Result<(), ConsoleError>;
22}