pub struct MqttPlugin { /* private fields */ }Implementations§
Source§impl MqttPlugin
impl MqttPlugin
pub fn new(config: MqttConfig) -> MqttPlugin
pub async fn connect(&mut self) -> Result<(), MqttError>
pub async fn disconnect(&mut self) -> Result<(), MqttError>
pub fn is_connected(&self) -> bool
pub async fn publish( &self, topic: &str, payload: Vec<u8>, qos: QoS, ) -> Result<(), MqttError>
pub async fn publish_retain( &self, topic: &str, payload: Vec<u8>, qos: QoS, ) -> Result<(), MqttError>
pub async fn subscribe(&self, topic: &str, qos: QoS) -> Result<(), MqttError>
pub async fn unsubscribe(&self, topic: &str) -> Result<(), MqttError>
pub fn topic_matches(&self, topic: &str, filter: &str) -> bool
pub async fn message_count(&self) -> usize
pub async fn messages_for(&self, topic: &str) -> Vec<MqttMessage>
pub async fn messages_matching(&self, filter: &str) -> Vec<MqttMessage>
pub async fn subscription_count(&self) -> usize
pub async fn is_subscribed(&self, topic: &str) -> bool
pub async fn subscription_qos(&self, topic: &str) -> Option<QoS>
pub async fn retained_count(&self) -> usize
pub async fn retained_get(&self, topic: &str) -> Option<MqttMessage>
pub async fn clear_messages(&self)
Auto Trait Implementations§
impl !RefUnwindSafe for MqttPlugin
impl !UnwindSafe for MqttPlugin
impl Freeze for MqttPlugin
impl Send for MqttPlugin
impl Sync for MqttPlugin
impl Unpin for MqttPlugin
impl UnsafeUnpin for MqttPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more