Skip to main content

ClientStateNoQueue

Enum ClientStateNoQueue 

Source
pub enum ClientStateNoQueue {
    Idle,
    Connecting(RequestedConnectionInfo),
    Connected(ConnectionState),
    Errored,
    Disconnected,
}

Variants§

§

Idle

§

Connecting(RequestedConnectionInfo)

§

Connected(ConnectionState)

§

Errored

§

Disconnected

Implementations§

Trait Implementations§

Source§

impl ClientState for ClientStateNoQueue

Source§

fn waiting_for_responses(&self) -> bool

Returns true when the state indicates we require a response to a sent packet - in this case you must receive packets and provide them to receive until waiting_for_responses returns false. The exception is that it is possible to call disconnect, send_ping or send_message (with a quality of service of 0), while waiting_for_responses is true.
Source§

fn connect<const P: usize, const W: usize>( &mut self, connect: &Connect<'_, P, W>, ) -> Result<(), ClientStateError>

Update state based on a packet used to connect to server Call this after connect packet has been successfully sent.
Source§

fn disconnect<'b>(&mut self) -> Result<Disconnect<'b, 0>, ClientStateError>

Produce a packet to disconnect from server, update state
Source§

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

Produce a packet to publish to a given topic, update state, with properties
Source§

fn subscribe<'b>( &mut self, topic_name: &'b str, maximum_qos: QualityOfService, ) -> Result<Subscribe<'b, 0, 0>, ClientStateError>

Produce a packet to subscribe to a topic by name, update state
Source§

fn unsubscribe<'b>( &mut self, topic_name: &'b str, ) -> Result<Unsubscribe<'b, 0, 0>, ClientStateError>

Produce a packet to unsubscribe from a topic by name, update state
Source§

fn send_ping(&mut self) -> Result<Pingreq, ClientStateError>

Produce a packet to ping the server, update state
Source§

fn receive<'a, 'b, const P: usize, const W: usize, const S: usize>( &mut self, packet: PacketGeneric<'a, P, W, S>, ) -> Result<ClientStateReceiveEvent<'a, 'b, P>, ClientStateError>

Receive a packet This updates the client state, and if anything that might require action by the caller occurs, a ClientStateReceiveEvent is returned. Errors indicate an invalid packet was received, message_target errored, or the received packet was unexpected based on our state
Source§

fn error(&mut self)

Move to errored state, no further operations are possible This must be called if the user of the client state cannot successfully send a packet produced by this ClientState
Source§

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

Produce a packet to publish to a given topic, update state, with no properties
Source§

impl Default for ClientStateNoQueue

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ClientStateNoQueue

Source§

fn eq(&self, other: &ClientStateNoQueue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ClientStateNoQueue

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.