pub enum ClientStateNoQueue {
Idle,
Connecting(RequestedConnectionInfo),
Connected(ConnectionState),
Errored,
Disconnected,
}Variants§
Implementations§
Trait Implementations§
Source§impl ClientState for ClientStateNoQueue
impl ClientState for ClientStateNoQueue
Source§fn waiting_for_responses(&self) -> bool
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>
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>
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>
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>
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>
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>
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>
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)
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>
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
impl Default for ClientStateNoQueue
Source§impl PartialEq for ClientStateNoQueue
impl PartialEq for ClientStateNoQueue
Source§fn eq(&self, other: &ClientStateNoQueue) -> bool
fn eq(&self, other: &ClientStateNoQueue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClientStateNoQueue
Auto Trait Implementations§
impl Freeze for ClientStateNoQueue
impl RefUnwindSafe for ClientStateNoQueue
impl Send for ClientStateNoQueue
impl Sync for ClientStateNoQueue
impl Unpin for ClientStateNoQueue
impl UnsafeUnpin for ClientStateNoQueue
impl UnwindSafe for ClientStateNoQueue
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