AsyncClient

Trait AsyncClient 

Source
pub trait AsyncClient: Send + Sync {
Show 19 methods // Required methods fn take_event_channel(&mut self) -> Option<Receiver<Arc<FrameData>>>; fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn zc_send<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, header: Cow<'async_trait>, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn send_broadcast<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn publish<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn subscribe<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn unsubscribe<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn subscribe_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn unsubscribe_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn exclude<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn unexclude<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn exclude_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn unexclude_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn ping<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn is_connected(&self) -> bool; fn get_connected_beacon(&self) -> Option<Arc<AtomicBool>>; fn get_timeout(&self) -> Option<Duration>; fn get_name(&self) -> &str; // Provided method fn publish_for<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topic: &'life1 str, receiver: &'life2 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait { ... }
}

Required Methods§

Source

fn take_event_channel(&mut self) -> Option<Receiver<Arc<FrameData>>>

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn zc_send<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, header: Cow<'async_trait>, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn send_broadcast<'life0, 'life1, 'async_trait>( &'life0 mut self, target: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn publish<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn subscribe<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn unsubscribe<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn subscribe_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn unsubscribe_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn exclude<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

exclude a topic. it is highly recommended to exclude topics first, then call subscribe operations to avoid receiving unwanted messages. excluding topics is also an additional heavy operation so use it only when there is no other way.

Source

fn unexclude<'life0, 'life1, 'async_trait>( &'life0 mut self, topic: &'life1 str, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

unexclude a topic (include back but not subscribe)

Source

fn exclude_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

exclude multiple topics

Source

fn unexclude_bulk<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topics: &'life1 [&'life2 str], qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

unexclude multiple topics (include back but not subscribe)

Source

fn ping<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn is_connected(&self) -> bool

Source

fn get_connected_beacon(&self) -> Option<Arc<AtomicBool>>

Source

fn get_timeout(&self) -> Option<Duration>

Source

fn get_name(&self) -> &str

Provided Methods§

Source

fn publish_for<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, topic: &'life1 str, receiver: &'life2 str, payload: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Implementors§