pub struct MockClient { /* private fields */ }
Expand description
Mock implementation of an MQTT client.
Currently always succeeds on all operations.
Implementations§
Source§impl MockClient
impl MockClient
Sourcepub fn mock_controller(&self) -> MockClientController
pub fn mock_controller(&self) -> MockClientController
Return a monitor that tracks the calls to this client (including any of its clones)
Trait Implementations§
Source§impl Clone for MockClient
impl Clone for MockClient
Source§fn clone(&self) -> MockClient
fn clone(&self) -> MockClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl MqttAck for MockClient
impl MqttAck for MockClient
Source§impl MqttClient for MockClient
impl MqttClient for MockClient
Source§impl MqttDisconnect for MockClient
impl MqttDisconnect for MockClient
Source§fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), DisconnectError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), DisconnectError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the MQTT broker.
Source§impl MqttPubSub for MockClient
impl MqttPubSub for MockClient
Source§fn publish<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Publish Read more
Source§fn publish_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
properties: PublishProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
properties: PublishProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Publish Read more
Source§fn subscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Subscribe Read more
Source§fn subscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
properties: SubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
properties: SubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Subscribe Read more
Source§fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Unsubscribe Read more
Source§fn unsubscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
properties: UnsubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
properties: UnsubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Unsubscribe Read more
Auto Trait Implementations§
impl Freeze for MockClient
impl RefUnwindSafe for MockClient
impl Send for MockClient
impl Sync for MockClient
impl Unpin for MockClient
impl UnwindSafe for MockClient
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