/// Pops a message from the next queue. If this was not the last message in
/// that queue, the queue is moved to the back of the iteration order.
Pops a message from the next queue. If this was not the last message in
that queue, the queue is moved to the back of the iteration order.
Pops a message from the next queue . If this was not the last message in that queue the queue is moved to the back of the iteration order .
pub fn pop(&mut self) -> Option<(QueueId, QueueIndex, RequestOrResponse)> {
        if let Some((receiver, queue)) = self.queues.pop_front() {
            let (queue_index, msg) = queue.pop().expect("Empty queue in iterator");
            let queue_id = QueueId {
                src_canister: self.owner,
                dst_canister: *receiver,
                session_id: SessionId::new(0),
            };
            if queue.num_messages() > 0 {
                self.queues.push_back((receiver, queue));
            }
            *self.stats -= MemoryUsageStats::stats_delta(QueueOp::Pop, &msg);
            self.size -= 1;
            debug_assert_eq!(Self::compute_size(&self.queues), self.size);
            return Some((queue_id, queue_index, msg));
        }
        None
    }
pub fn pop ( & mut self ) -> Option < ( QueueId , QueueIndex , RequestOrResponse ) > { if let Some ( ( receiver , queue ) ) = self . queues . pop_front ( ) { let ( queue_index , msg ) = queue . pop ( ) . expect ( " " ) ; let queue_id = QueueId { src_canister : self . owner , dst_canister : * receiver , session_id : SessionId :: new ( 0 ) , } ; if queue . num_messages ( ) > 0 { self . queues . push_back ( ( receiver , queue ) ) ; } * self . stats -= MemoryUsageStats :: stats_delta ( QueueOp :: Pop , & msg ) ; self . size -= 1 ; debug_assert_eq ! ( Self compute_size ( self queues ) self size ) ; return Some ( ( queue_id , queue_index , msg ) ) ; } None }
Pops a message from the next queue.
Pops a message from the next queue .
&mut self