Struct AWSIoTAsyncClient

Source
pub struct AWSIoTAsyncClient { /* private fields */ }

Implementations§

Source§

impl AWSIoTAsyncClient

Source

pub async fn new( settings: AWSIoTSettings, ) -> Result<(AWSIoTAsyncClient, (EventLoop, Sender<Incoming>)), AWSIoTError>

Create new AWSIoTAsyncClient. Input argument should be the AWSIoTSettings. Returns a tuple where the first element is the AWSIoTAsyncClient, and the second element is a new tuple with the eventloop and incoming event sender. This tuple should be sent as an argument to the async_event_loop_listener.

Source

pub async fn subscribe<S: Into<String>>( &self, topic: S, qos: QoS, ) -> Result<(), ClientError>

Subscribe to a topic.

Source

pub async fn publish<S, V>( &self, topic: S, qos: QoS, payload: V, ) -> Result<(), ClientError>
where S: Into<String>, V: Into<Vec<u8>>,

Publish to topic.

Source

pub async fn get_receiver(&self) -> Receiver<Incoming>

Get a receiver of the incoming messages. Send this to any function that wants to read the incoming messages from IoT Core.

Source

pub async fn get_client(self) -> AsyncClient

If you want to use the Rumqttc AsyncClient and EventLoop manually, this method can be used to get the AsyncClient.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.