[][src]Struct aws_iot_device_sdk_rust::client::AWSIoTClient

pub struct AWSIoTClient {
    pub aws_iot_client: MqttClient,
    // some fields omitted
}

Fields

aws_iot_client: MqttClient

Methods

impl AWSIoTClient[src]

pub fn new(
    client_id: &str,
    ca_path: &str,
    client_cert_path: &str,
    client_key_path: &str,
    aws_iot_endpoint: &str
) -> Result<Self, ConnectError>
[src]

Returns an AWSIoTClient struct with the instantiated MQTT client ready to be used.

pub fn add_callback(
    &self,
    topic_name: String,
    callback: fn(_: String)
) -> Option<fn(_: String)>
[src]

Associates a callback function with a topic name.

pub fn remove_callback(&self, topic_name: String) -> Option<fn(_: String)>[src]

Remove the callback function associated with a topic name.

pub fn start_listening(&mut self)[src]

When called it will spawn a thread that checks if the HashMap in the AWSIoTClient contain a callback function associated with the incoming topics.

pub fn subscribe(&mut self, topic_name: String, qos: QoS)[src]

Subscribe to any topic.

pub fn publish(&mut self, topic_name: String, qos: QoS, payload: &str)[src]

Publish to any topic.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.