fundamentum_sdk_mqtt/
publisher.rs1use std::error::Error;
2
3use crate::{PublishOptions, Publishable};
4
5pub trait Publisher: Clone {
7 type Error: Error;
9
10 fn publish<P>(&self, publishable: P) -> impl Future<Output = Result<(), Self::Error>> + Send
12 where
13 P: Publishable + Send + 'static,
14 {
15 self.publish_with(publishable, PublishOptions::default())
16 }
17
18 fn publish_with<P>(
22 &self,
23 publishable: P,
24 options: PublishOptions,
25 ) -> impl Future<Output = Result<(), Self::Error>> + Send
26 where
27 P: Publishable + Send + 'static;
28}