[−][src]Struct aws_iot_device_sdk_rust::client::AWSIoTClient
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]
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(
&self,
topic_name: String,
callback: fn(_: String)
) -> Option<fn(_: String)>
[src]
&self,
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
impl !RefUnwindSafe for AWSIoTClient
impl Send for AWSIoTClient
impl Sync for AWSIoTClient
impl Unpin for AWSIoTClient
impl !UnwindSafe for AWSIoTClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,