/// Pushes an item into a reserved slot, consuming the reservation or
/// returns an error if there is no reservation available.
Pushes an item into a reserved slot, consuming the reservation or
returns an error if there is no reservation available.
Pushes an item into a reserved slot consuming the reservation or returns an error if there is no reservation available .
fn push_into_reserved_slot(&mut self, msg: T) -> Result<(), (StateError, T)> {
        if self.num_slots_reserved > 0 {
            self.num_slots_reserved -= 1;
            self.size_bytes += Self::message_size_bytes(&msg);
            self.queue.push_back(Arc::new(msg));
            debug_assert_eq!(Self::size_bytes(&self.queue), self.size_bytes);
            Ok(())
        } else {
            Err((StateError::QueueFull { capacity: 0 }, msg))
        }
    }
fn push_into_reserved_slot ( & mut self , msg : T ) -> Result < ( ) , ( StateError , T ) > { if self . num_slots_reserved > 0 { self . num_slots_reserved -= 1 ; self . size_bytes += Self :: message_size_bytes ( & msg ) ; self . queue . push_back ( Arc :: new ( msg ) ) ; debug_assert_eq ! ( Self size_bytes ( self queue ) self size_bytes ) ; Ok ( ( ) ) } else { Err ( ( StateError :: QueueFull { capacity : 0 } , msg ) ) } }
Pushes an item into a reserved slot, consuming the reservation or
returns an error if there is no reservation available.
Pushes an item into a reserved slot consuming the reservation or returns an error if there is no reservation available .
&mut self
msg
T