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

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


aws_iot_client: MqttClient


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>

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

pub fn add_callback(
    topic_name: String,
    callback: fn(_: String)
) -> Option<fn(_: String)>

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.