Struct LoopState
struct LoopState<'a> {
client: &'a mut Client<JournaledSession>,
cmd_rx: &'a mut Receiver<Command>,
cmds_open: &'a mut bool,
shutdown_rx: &'a mut Receiver<()>,
msg_tx: &'a Sender<Message>,
store: &'a mut Persistence,
queued_commands: &'a mut VecDeque<Command>,
offline_pending: &'a mut HashMap<PacketId, PendingPublish>,
offline_acks: &'a mut HashMap<PacketId, PendingAck>,
queued_waiting: &'a mut Vec<Sender<Result<(), Error>>>,
status_tx: &'a Sender<ConnectionStatus>,
}Expand description
Mutable state that persists across reconnection attempts.
Fields§
§client: &'a mut Client<JournaledSession>§cmd_rx: &'a mut Receiver<Command>§cmds_open: &'a mut boolfalse once every client handle is dropped and cmd_rx is drained;
the selects then stop polling the closed channel.
shutdown_rx: &'a mut Receiver<()>§msg_tx: &'a Sender<Message>§store: &'a mut Persistence§queued_commands: &'a mut VecDeque<Command>§offline_pending: &'a mut HashMap<PacketId, PendingPublish>Completion futures for QoS >= 1 publishes accepted while offline,
adopted into this connection’s Pending once it is established.
offline_acks: &'a mut HashMap<PacketId, PendingAck>Completion futures for SUBSCRIBE/UNSUBSCRIBE accepted while offline or
left in flight across a reconnect, adopted into this connection’s
Pending once it is established.
queued_waiting: &'a mut Vec<Sender<Result<(), Error>>>queued() futures awaiting the persist that covers their session
mutation; resolved by persist_and_ack, carried across connections.
status_tx: &'a Sender<ConnectionStatus>Auto Trait Implementations§
impl<'a> Freeze for LoopState<'a>
impl<'a> !RefUnwindSafe for LoopState<'a>
impl<'a> Send for LoopState<'a>
impl<'a> Sync for LoopState<'a>
impl<'a> Unpin for LoopState<'a>
impl<'a> !UnwindSafe for LoopState<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more