pub trait MQConsumerInner:
MQConsumerInnerAny
+ Sync
+ 'static
+ Send {
Show 14 methods
// Required methods
fn group_name(&self) -> CheetahString;
fn message_model(&self) -> MessageModel;
fn consume_type(&self) -> ConsumeType;
fn consume_from_where(&self) -> ConsumeFromWhere;
fn subscriptions(&self) -> HashSet<SubscriptionData>;
fn do_rebalance(&self) -> impl Future<Output = ()> + Send;
fn try_rebalance(&self) -> impl Future<Output = ClientResult<bool>> + Send;
fn persist_consumer_offset(&self) -> impl Future<Output = ()> + Send;
fn update_topic_subscribe_info(
&self,
topic: CheetahString,
info: &HashSet<MessageQueue>,
) -> impl Future<Output = ()> + Send;
fn is_subscribe_topic_need_update(
&self,
topic: &str,
) -> impl Future<Output = bool> + Send;
fn is_unit_mode(&self) -> bool;
fn reset_offsets(
&self,
topic: &CheetahString,
offsets: HashMap<MessageQueue, i64>,
) -> impl Future<Output = ()> + Send;
fn consumer_status(
&self,
topic: &CheetahString,
) -> impl Future<Output = HashMap<MessageQueue, i64>> + Send;
fn consumer_running_info(
&self,
) -> impl Future<Output = ConsumerRunningInfo> + Send;
}Expand description
The MQConsumerInnerLocal trait defines the core functionalities required for a local MQ
consumer. It extends the MQConsumerInnerAny trait and requires implementations to be Sync
and 'static.
Required Methods§
Sourcefn group_name(&self) -> CheetahString
fn group_name(&self) -> CheetahString
Returns the group name of the consumer.
Sourcefn message_model(&self) -> MessageModel
fn message_model(&self) -> MessageModel
Returns the message model used by the consumer.
Sourcefn consume_type(&self) -> ConsumeType
fn consume_type(&self) -> ConsumeType
Returns the type of consumption (e.g., push or pull).
Sourcefn consume_from_where(&self) -> ConsumeFromWhere
fn consume_from_where(&self) -> ConsumeFromWhere
Returns the point from where the consumer should start consuming messages.
Sourcefn subscriptions(&self) -> HashSet<SubscriptionData>
fn subscriptions(&self) -> HashSet<SubscriptionData>
Returns the set of subscriptions for the consumer.
Sourcefn do_rebalance(&self) -> impl Future<Output = ()> + Send
fn do_rebalance(&self) -> impl Future<Output = ()> + Send
Performs the rebalancing of the consumer.
Sourcefn try_rebalance(&self) -> impl Future<Output = ClientResult<bool>> + Send
fn try_rebalance(&self) -> impl Future<Output = ClientResult<bool>> + Send
Attempts to perform rebalancing asynchronously and returns a Result indicating success or
failure.
Sourcefn persist_consumer_offset(&self) -> impl Future<Output = ()> + Send
fn persist_consumer_offset(&self) -> impl Future<Output = ()> + Send
Persists the consumer offset asynchronously.
Sourcefn update_topic_subscribe_info(
&self,
topic: CheetahString,
info: &HashSet<MessageQueue>,
) -> impl Future<Output = ()> + Send
fn update_topic_subscribe_info( &self, topic: CheetahString, info: &HashSet<MessageQueue>, ) -> impl Future<Output = ()> + Send
Updates the subscription information for a given topic asynchronously.
§Arguments
topic- A string slice that holds the name of the topic.info- A reference to aHashSetcontainingMessageQueueinformation.
Sourcefn is_unit_mode(&self) -> bool
fn is_unit_mode(&self) -> bool
Returns whether the consumer is in unit mode.
Sourcefn reset_offsets(
&self,
topic: &CheetahString,
offsets: HashMap<MessageQueue, i64>,
) -> impl Future<Output = ()> + Send
fn reset_offsets( &self, topic: &CheetahString, offsets: HashMap<MessageQueue, i64>, ) -> impl Future<Output = ()> + Send
Replaces the in-memory offsets for queues belonging to the given topic.
Sourcefn consumer_status(
&self,
topic: &CheetahString,
) -> impl Future<Output = HashMap<MessageQueue, i64>> + Send
fn consumer_status( &self, topic: &CheetahString, ) -> impl Future<Output = HashMap<MessageQueue, i64>> + Send
Returns a snapshot of the consumer offsets for the given topic.
Sourcefn consumer_running_info(
&self,
) -> impl Future<Output = ConsumerRunningInfo> + Send
fn consumer_running_info( &self, ) -> impl Future<Output = ConsumerRunningInfo> + Send
Returns the running information of the consumer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".