rabbitmq-backup-core 0.1.0

Core engine for RabbitMQ backup and restore operations
Documentation
//! Simple channel ID tracking.
//!
//! For this backup tool, each queue gets its own AMQP connection + channel.
//! This module provides minimal channel ID management.

/// Tracks allocated channel IDs on a connection.
pub struct ChannelPool {
    allocated: Vec<u16>,
}

impl ChannelPool {
    pub fn new() -> Self {
        Self {
            allocated: Vec::new(),
        }
    }

    pub fn track(&mut self, channel_id: u16) {
        self.allocated.push(channel_id);
    }

    pub fn allocated(&self) -> &[u16] {
        &self.allocated
    }
}

impl Default for ChannelPool {
    fn default() -> Self {
        Self::new()
    }
}