rocketmq_client_v4/protocols/body/
message_queue.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
4#[allow(non_snake_case)]
5pub struct MessageQueue {
6    pub topic: String,
7    pub brokerName: String,
8    pub queueId: i32,
9}
10
11impl MessageQueue {
12    pub fn new(topic: String, broker_name: String, queue_id: i32) -> Self {
13        Self {
14            topic,
15            brokerName: broker_name,
16            queueId: queue_id,
17        }
18    }
19
20    pub fn new_from_ref(ref_mq: &MessageQueue) -> Self {
21        Self {
22            topic: ref_mq.topic.clone(),
23            brokerName: ref_mq.brokerName.clone(),
24            queueId: ref_mq.queueId,
25        }
26    }
27}