adapter
ModuleContents
Traits
AdapterAn MQTT transport: `Tokio`(crate::Tokio) on the network, `Memory`(crate::Memory) in process. `Server`(crate::Server) drives one.OutboundThe way back to the clients: write bytes to a connection, or close it. Every `Adapter` is one; a `Connection`(crate::Connection) keeps one to deliver.TimerKeep-alive deadlines by connection: a connection scheduled with a keep-alive interval is reaped (the tick hook gets its id) once it has been silent for longer than the interval allows.Type aliases
ConnectionHookCalled with a connection id when it opens or closes.ReceiveHookCalled with a connection id and one whole MQTT packet it sent.StartHookCalled once the adapter is listening.TimerHookCalled with the id a `Timer` reaps or clears.WorkerHookCalled with each worker id as its worker starts.use utopia_mqtt::Adapter;Rust
pub trait Adapter: Outbound + Clone + 'staticuse utopia_mqtt::Outbound;Rust
pub trait Outbound: Send + SyncThe way back to the clients: write bytes to a connection, or close it.
Every Adapter is one; a Connection keeps one to
deliver.
use utopia_mqtt::Timer;Rust
pub trait Timer: Send + SyncKeep-alive deadlines by connection: a connection scheduled with a keep-alive interval is reaped (the tick hook gets its id) once it has been silent for longer than the interval allows.
Implemented byNoTimerTimingWheel
Rust
pub type ConnectionHook = Arc<dyn Fn(i64) -> Result<(), Error> + Send + Sync>Called with a connection id when it opens or closes.
Rust
pub type ReceiveHook = Arc<dyn Fn(i64, &[u8]) -> Result<(), Error> + Send + Sync>Called with a connection id and one whole MQTT packet it sent.
Rust
pub type StartHook = Arc<dyn Fn() + Send + Sync>Called once the adapter is listening.
Rust
pub type TimerHook = Arc<dyn Fn(i64) + Send + Sync>Called with the id a Timer reaps or clears.
Rust
pub type WorkerHook = Arc<dyn Fn(i64) + Send + Sync>Called with each worker id as its worker starts.