fn handle_incoming_puback(
        &mut self,
        pid: Pid,
    ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
        if self.outgoing_pub.contains_key(&pid.get()) {
            let _publish = self.outgoing_pub.remove(&pid.get());

            let request = None;
            let notification = Some(Notification::Puback(pid));
            Ok((notification, request))
        } else {
            mqtt_log!(error, "Unsolicited puback packet: {:?}", pid.get());
            // Err(StateError::Unsolicited)
            Ok((None, None))
        }
    }
/// Iterates through the list of stored publishes and removes the publish
/// with the matching packet identifier. Removal is now a O(n) operation.
/// This should be usually ok in case of acks due to ack ordering in normal
/// conditions. But in cases where the broker doesn't guarantee the order of
/// acks, the performance won't be optimal
Iterates through the list of stored publishes and removes the publish
with the matching packet identifier. Removal is now a O(n) operation.
This should be usually ok in case of acks due to ack ordering in normal
conditions. But in cases where the broker doesn't guarantee the order of
acks, the performance won't be optimal
Iterates through the list of stored publishes and removes the publish with the matching packet identifier . Removal is now a O ( n ) operation . This should be usually ok in case of acks due to ack ordering in normal conditions . But in cases where the broker doesn ' t guarantee the order of acks the performance won ' t be optimal
fn handle_incoming_puback(
        &mut self,
        pid: Pid,
    ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
        if self.outgoing_pub.contains_key(&pid.get()) {
            let _publish = self.outgoing_pub.remove(&pid.get());
            let request = None;
            let notification = Some(Notification::Puback(pid));
            Ok((notification, request))
        } else {
            mqtt_log!(error, "Unsolicited puback packet: {:?}", pid.get());
            // Err(StateError::Unsolicited)
            Ok((None, None))
        }
    }
fn handle_incoming_puback ( & mut self , pid : Pid , ) -> Result < ( Option < Notification > , Option < Packet < ' static > > ) , StateError > { if self . outgoing_pub . contains_key ( & pid . get ( ) ) { let _publish = self . outgoing_pub . remove ( & pid . get ( ) ) ; let request = None ; let notification = Some ( Notification :: Puback ( pid ) ) ; Ok ( ( notification , request ) ) } else { mqtt_log ! ( error " " pid get ( ) ) ; // Err(StateError::Unsolicited) Ok ( ( None , None ) ) } }
Iterates through the list of stored publishes and removes the publish
with the matching packet identifier.
Iterates through the list of stored publishes and removes the publish with the matching packet identifier .
&mut self
pid
Pid
&mut self
pid
Pid