[−][src]Struct actix_mqtt_client::MqttClient
The client for connecting to the MQTT server
Methods
impl MqttClient[src]
pub fn new<TReader: AsyncRead + Send + 'static, TWriter: Write + Send + 'static>(
reader: TReader,
writer: TWriter,
client_name: String,
options: MqttOptions,
message_recipient: Recipient<PublishMessage>,
error_recipient: Recipient<ErrorMessage>,
stop_recipient: Option<Recipient<StopMessage>>
) -> Self[src]
reader: TReader,
writer: TWriter,
client_name: String,
options: MqttOptions,
message_recipient: Recipient<PublishMessage>,
error_recipient: Recipient<ErrorMessage>,
stop_recipient: Option<Recipient<StopMessage>>
) -> Self
Create a new MQTT client
pub fn name(&self) -> &str[src]
Returns the name of the client
pub fn connect(&mut self) -> Box<dyn Future<Item = (), Error = IoError>>[src]
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
pub fn subscribe(
&self,
topic: String,
qos: QualityOfService
) -> Box<dyn Future<Item = (), Error = IoError>>[src]
&self,
topic: String,
qos: QualityOfService
) -> Box<dyn Future<Item = (), Error = IoError>>
Subscribe to the server with a topic and QoS
pub fn unsubscribe(
&self,
topic: String
) -> Box<dyn Future<Item = (), Error = IoError>>[src]
&self,
topic: String
) -> Box<dyn Future<Item = (), Error = IoError>>
Unsubscribe from the server
pub fn publish(
&self,
topic: String,
qos: QualityOfService,
payload: Vec<u8>
) -> Box<dyn Future<Item = (), Error = IoError>>[src]
&self,
topic: String,
qos: QualityOfService,
payload: Vec<u8>
) -> Box<dyn Future<Item = (), Error = IoError>>
Publish a message
pub fn disconnect(
&mut self,
force: bool
) -> Box<dyn Future<Item = (), Error = IoError>>[src]
&mut self,
force: bool
) -> Box<dyn Future<Item = (), Error = IoError>>
Disconnect from the server
pub fn is_disconnected(&self) -> bool[src]
Check if the client has been disconnect from the server, useful to check whether disconnect is success
Trait Implementations
impl Clone for MqttClient[src]
fn clone(&self) -> MqttClient[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
impl Send for MqttClient
impl Sync for MqttClient
impl Unpin for MqttClient
impl !UnwindSafe for MqttClient
impl !RefUnwindSafe for MqttClient
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,