pub struct AWSIoTAsyncClient { /* private fields */ }
Implementations§
Source§impl AWSIoTAsyncClient
impl AWSIoTAsyncClient
Sourcepub async fn new(
settings: AWSIoTSettings,
) -> Result<(AWSIoTAsyncClient, (EventLoop, Sender<Incoming>)), AWSIoTError>
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.
Sourcepub async fn subscribe<S: Into<String>>(
&self,
topic: S,
qos: QoS,
) -> Result<(), ClientError>
pub async fn subscribe<S: Into<String>>( &self, topic: S, qos: QoS, ) -> Result<(), ClientError>
Subscribe to a topic.
Sourcepub async fn publish<S, V>(
&self,
topic: S,
qos: QoS,
payload: V,
) -> Result<(), ClientError>
pub async fn publish<S, V>( &self, topic: S, qos: QoS, payload: V, ) -> Result<(), ClientError>
Publish to topic.
Sourcepub async fn get_receiver(&self) -> Receiver<Incoming>
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.
Sourcepub async fn get_client(self) -> AsyncClient
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§
impl Freeze for AWSIoTAsyncClient
impl RefUnwindSafe for AWSIoTAsyncClient
impl Send for AWSIoTAsyncClient
impl Sync for AWSIoTAsyncClient
impl Unpin for AWSIoTAsyncClient
impl UnwindSafe for AWSIoTAsyncClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more