Struct actix_mqtt_client::MqttClient [−][src]
pub struct MqttClient { /* fields omitted */ }Expand description
The client for connecting to the MQTT server
Implementations
pub fn new<TReader: AsyncRead + Send + 'static + Unpin, TWriter: AsyncWrite + Send + 'static + Unpin>(
reader: TReader,
writer: TWriter,
client_name: String,
options: MqttOptions,
message_recipient: Recipient<PublishMessage>,
error_recipient: Recipient<ErrorMessage>,
stop_recipient: Option<Recipient<StopMessage>>
) -> Self[src]
pub fn new<TReader: AsyncRead + Send + 'static + Unpin, TWriter: AsyncWrite + Send + 'static + Unpin>(
reader: TReader,
writer: TWriter,
client_name: String,
options: MqttOptions,
message_recipient: Recipient<PublishMessage>,
error_recipient: Recipient<ErrorMessage>,
stop_recipient: Option<Recipient<StopMessage>>
) -> Self[src]Create a new MQTT client
Perform the connect operation to the remote MQTT server
Note: This function can only be called once for each client, calling it the second time will return an error Note: The successful return of this function DOES NOT mean that the MQTT connection is successful, if anything wrong happens the error actor will receive an error Note: Please use is_connected() to check whether the MQTT connection is successful or not
Check whether the client has connected to the server successfully
Subscribe to the server with a topic and QoS
Unsubscribe from the server
Publish a message
Disconnect from the server
Check if the client has been disconnected from the server, useful to check whether disconnection is completed
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for MqttClientimpl Send for MqttClientimpl Sync for MqttClientimpl Unpin for MqttClientimpl !UnwindSafe for MqttClientBlanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V