Struct mqttrust_core::Client
source · [−]pub struct Client<'a, 'b, const L: usize> { /* private fields */ }
Expand description
MQTT Client
This client is meerly a convenience wrapper around a
heapless::spsc::Producer
, making it easier to send certain MQTT packet
types, and maintaining a common reference to a client id. Also it implements
the Mqtt
trait.
Lifetimes:
- ’a: The lifetime of the queue exhanging packets between the client and the event loop. This must have the same lifetime as the corresponding Consumer. Usually ’static.
- ’b: The lifetime of client id str
Generics:
- L: The length of the queue, exhanging packets between the client and the event loop. Length in number of request packets
Implementations
Trait Implementations
sourceimpl<'a, 'b, const L: usize> Mqtt for Client<'a, 'b, L>
impl<'a, 'b, const L: usize> Mqtt for Client<'a, 'b, L>
fn client_id(&self) -> &str
fn send(&self, packet: Packet<'_>) -> Result<(), MqttError>
fn publish(
&self,
topic_name: &str,
payload: &[u8],
qos: QoS
) -> Result<(), MqttError>
fn subscribe(&self, topics: &[SubscribeTopic<'_>]) -> Result<(), MqttError>
fn unsubscribe(&self, topics: &[&str]) -> Result<(), MqttError>
Auto Trait Implementations
impl<'a, 'b, const L: usize> !RefUnwindSafe for Client<'a, 'b, L>
impl<'a, 'b, const L: usize> Send for Client<'a, 'b, L>
impl<'a, 'b, const L: usize> !Sync for Client<'a, 'b, L>
impl<'a, 'b, const L: usize> Unpin for Client<'a, 'b, L>
impl<'a, 'b, const L: usize> !UnwindSafe for Client<'a, 'b, L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more