pub struct EspAsyncMqttClient(/* private fields */);
Implementations§
Source§impl EspAsyncMqttClient
impl EspAsyncMqttClient
Sourcepub fn new(
url: &str,
conf: &MqttClientConfiguration<'_>,
) -> Result<(Self, EspAsyncMqttConnection), EspError>
pub fn new( url: &str, conf: &MqttClientConfiguration<'_>, ) -> Result<(Self, EspAsyncMqttConnection), EspError>
Create a new MQTT client with a given URL and configuration.
Sourcepub fn new_with_caps(
url: &str,
conf: &MqttClientConfiguration<'_>,
caps: Option<(usize, usize, usize)>,
) -> Result<(Self, EspAsyncMqttConnection), EspError>
pub fn new_with_caps( url: &str, conf: &MqttClientConfiguration<'_>, caps: Option<(usize, usize, usize)>, ) -> Result<(Self, EspAsyncMqttConnection), EspError>
Create a new MQTT client with a given URL, configuration and caps.
The caps tuple contains the initial capacity of the topic, payload and broker URI buffers. Useful to avoid constant re-allocations with large payloads.
Sourcepub fn wrap(client: EspMqttClient<'static>) -> Result<Self, EspError>
pub fn wrap(client: EspMqttClient<'static>) -> Result<Self, EspError>
Wrap an existing MQTT client with an async interface.
Sourcepub fn wrap_with_caps(
client: EspMqttClient<'static>,
caps: Option<(usize, usize, usize)>,
) -> Result<Self, EspError>
pub fn wrap_with_caps( client: EspMqttClient<'static>, caps: Option<(usize, usize, usize)>, ) -> Result<Self, EspError>
Wrap an existing MQTT client with an async interface.
The caps tuple contains the initial capacity of the topic, payload and broker URI buffers. Useful to avoid constant re-allocations with large payloads.