styrene_mqtt/lib.rs
1//! MQTT 5.0 infrastructure for the Aether event fabric.
2//!
3//! This crate provides the shared MQTT layer used by all Styrene ecosystem
4//! services (Omegon, Scry, Viz, Aether, etc.) to communicate over the
5//! Aether event bus.
6//!
7//! # Topic Schema
8//!
9//! All events are published to topics following the hierarchy:
10//!
11//! ```text
12//! styrene/{operator_id}/{service}/{instance_id}/events/{event_type}
13//! ```
14//!
15//! Use [`TopicBuilder`] to construct publish topics and subscription filters.
16//!
17//! # Broker Ownership
18//!
19//! The MQTT broker is owned by the operator control plane (Auspex), not by
20//! individual services. Services connect as TCP clients. Auspex uses the
21//! `embedded-broker` feature to start an in-process rumqttd instance and
22//! holds an in-process link for its own aggregation pipeline.
23//!
24//! # Feature Gates
25//!
26//! - `embedded-broker` — includes rumqttd for hosting the broker (Auspex only)
27//! - `tls` — TLS support for remote broker connections (future)
28//! - `styrene-identity` — Ed25519 enhanced auth (future)
29
30pub mod client;
31pub mod envelope;
32pub mod error;
33pub mod qos;
34pub mod stream;
35pub mod topic;
36
37#[cfg(feature = "embedded-broker")]
38pub mod broker;
39
40pub use client::{Client, ClientConfig, ConnectionTarget, ServiceIdentity};
41pub use envelope::{Envelope, Message, Metadata};
42pub use error::{MqttError, Result};
43pub use qos::{qos_for_event, QosOverride};
44pub use stream::{RawMessage, Subscription};
45pub use topic::{TopicAddress, TopicBuilder};
46
47#[cfg(feature = "embedded-broker")]
48pub use broker::{BrokerLink, EmbeddedBroker, EmbeddedBrokerBuilder, EmbeddedBrokerConfig};