Skip to main content

ClientNoQueue

Struct ClientNoQueue 

Source
pub struct ClientNoQueue<'a, C, D, F, const P: usize>
where C: Connection, D: Delay, F: EventHandler<P>,
{ /* private fields */ }

Implementations§

Source§

impl<'a, C, D, F, const P: usize> ClientNoQueue<'a, C, D, F, P>
where C: Connection, D: Delay, F: EventHandler<P>,

Source

pub fn new( connection: C, buf: &'a mut [u8], delay: D, timeout_millis: u32, event_handler: F, ) -> Self

Trait Implementations§

Source§

impl<'a, C, D, F, const P: usize> Client<'a> for ClientNoQueue<'a, C, D, F, P>
where C: Connection, D: Delay, F: EventHandler<P>,

Source§

async fn connect_with_will<const W: usize>( &mut self, settings: &ConnectionSettings<'_>, will: Option<Will<'_, W>>, ) -> Result<(), ClientError>

Connect to server with a will
Source§

async fn connect( &mut self, settings: &ConnectionSettings<'_>, ) -> Result<(), ClientError>

Connect to server
Source§

async fn disconnect(&mut self) -> Result<(), ClientError>

Disconnect from server
Source§

async fn publish_with_properties<'b, const PP: usize>( &'b mut self, topic_name: &'b str, payload: &'b [u8], qos: QualityOfService, retain: bool, properties: Vec<PublishProperty<'b>, PP>, ) -> Result<(), ClientError>

Publish a message with given payload to a given topic, with properties
Source§

async fn subscribe<'b>( &'b mut self, topic_name: &'b str, maximum_qos: QualityOfService, ) -> Result<(), ClientError>

Subscribe to a topic
Source§

async fn unsubscribe<'b>( &'b mut self, topic_name: &'b str, ) -> Result<(), ClientError>

Unsubscribe from a topic
Source§

async fn send_ping(&mut self) -> Result<(), ClientError>

Send a ping message to broker
Source§

async fn poll(&mut self, wait: bool) -> Result<bool, ClientError>

Poll for and handle at most one event This updates the state of the client, and calls the event_handler if a message is received If wait is true, this will wait until an event is received, or the comms are disconnected. Otherwise an event will only be waited for if at least one byte of data is already available, indicating a packet should be available soon. On success, returns true if an event was handled, false if none was received Errors indicate an invalid packet was received, message_target errored, the received packet was unexpected based on our state, or the comms are disconnected.
Source§

async fn perform<'b, const PP: usize>( &'b mut self, action: ClientAction<'b, PP>, ) -> Result<(), ClientError>

Perform an action (this replicates the functionality of Client::subscribe, Client::unsubscribe and Client::publish) but using an enum to represent the action.
Source§

async fn publish<'b>( &'b mut self, topic_name: &'b str, payload: &'b [u8], qos: QualityOfService, retain: bool, ) -> Result<(), ClientError>

Publish a message with given payload to a given topic, with no properties

Auto Trait Implementations§

§

impl<'a, C, D, F, const P: usize> Freeze for ClientNoQueue<'a, C, D, F, P>
where D: Freeze, F: Freeze, C: Freeze,

§

impl<'a, C, D, F, const P: usize> RefUnwindSafe for ClientNoQueue<'a, C, D, F, P>

§

impl<'a, C, D, F, const P: usize> Send for ClientNoQueue<'a, C, D, F, P>
where D: Send, F: Send, C: Send,

§

impl<'a, C, D, F, const P: usize> Sync for ClientNoQueue<'a, C, D, F, P>
where D: Sync, F: Sync, C: Sync,

§

impl<'a, C, D, F, const P: usize> Unpin for ClientNoQueue<'a, C, D, F, P>
where D: Unpin, F: Unpin, C: Unpin,

§

impl<'a, C, D, F, const P: usize> UnsafeUnpin for ClientNoQueue<'a, C, D, F, P>

§

impl<'a, C, D, F, const P: usize> !UnwindSafe for ClientNoQueue<'a, C, D, F, P>

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.