pub trait MQAdmin {
// Required methods
fn create_topic(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
attributes: HashMap<String, String>,
) -> ClientResult<()>;
fn create_topic_with_flag(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
topic_sys_flag: i32,
attributes: HashMap<String, String>,
) -> ClientResult<()>;
fn search_offset(
&self,
mq: &MessageQueue,
timestamp: u64,
) -> ClientResult<i64>;
fn max_offset(&self, mq: &MessageQueue) -> ClientResult<i64>;
fn min_offset(&self, mq: &MessageQueue) -> ClientResult<i64>;
fn earliest_msg_store_time(&self, mq: &MessageQueue) -> ClientResult<u64>;
fn query_message(
&self,
topic: &str,
key: &str,
max_num: i32,
begin: u64,
end: u64,
) -> ClientResult<QueryResult>;
fn view_message(
&self,
topic: &str,
msg_id: &str,
) -> ClientResult<MessageExt>;
}Expand description
Trait defining administrative operations for a Message Queue (MQ).
Required Methods§
Sourcefn create_topic(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
attributes: HashMap<String, String>,
) -> ClientResult<()>
fn create_topic( &self, key: &str, new_topic: &str, queue_num: i32, attributes: HashMap<String, String>, ) -> ClientResult<()>
Sourcefn create_topic_with_flag(
&self,
key: &str,
new_topic: &str,
queue_num: i32,
topic_sys_flag: i32,
attributes: HashMap<String, String>,
) -> ClientResult<()>
fn create_topic_with_flag( &self, key: &str, new_topic: &str, queue_num: i32, topic_sys_flag: i32, attributes: HashMap<String, String>, ) -> ClientResult<()>
Creates a new topic with a system flag.
§Arguments
key- A key used for topic creation.new_topic- The name of the new topic.queue_num- The number of queues for the new topic.topic_sys_flag- The system flag for the new topic.attributes- A map of attributes for the new topic.
§Returns
A Result indicating success or failure.
Sourcefn search_offset(&self, mq: &MessageQueue, timestamp: u64) -> ClientResult<i64>
fn search_offset(&self, mq: &MessageQueue, timestamp: u64) -> ClientResult<i64>
Sourcefn max_offset(&self, mq: &MessageQueue) -> ClientResult<i64>
fn max_offset(&self, mq: &MessageQueue) -> ClientResult<i64>
Sourcefn min_offset(&self, mq: &MessageQueue) -> ClientResult<i64>
fn min_offset(&self, mq: &MessageQueue) -> ClientResult<i64>
Sourcefn earliest_msg_store_time(&self, mq: &MessageQueue) -> ClientResult<u64>
fn earliest_msg_store_time(&self, mq: &MessageQueue) -> ClientResult<u64>
Sourcefn query_message(
&self,
topic: &str,
key: &str,
max_num: i32,
begin: u64,
end: u64,
) -> ClientResult<QueryResult>
fn query_message( &self, topic: &str, key: &str, max_num: i32, begin: u64, end: u64, ) -> ClientResult<QueryResult>
Queries messages in a topic by key within a time range.
§Arguments
topic- The topic to query.key- The key to search for.max_num- The maximum number of messages to return.begin- The start of the time range.end- The end of the time range.
§Returns
A Result containing a QueryResult with the messages, or an error.
Sourcefn view_message(&self, topic: &str, msg_id: &str) -> ClientResult<MessageExt>
fn view_message(&self, topic: &str, msg_id: &str) -> ClientResult<MessageExt>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".