pub trait LitePullConsumer: Sync + Send {
Show 30 methods
// Required methods
fn start(&self) -> impl Future<Output = RocketMQResult<()>> + Send;
fn shutdown(&self) -> impl Future<Output = ()> + Send;
fn is_running(&self) -> impl Future<Output = bool> + Send;
fn subscribe(
&self,
topic: &str,
) -> impl Future<Output = RocketMQResult<()>> + Send;
fn subscribe_with_expression(
&self,
topic: &str,
sub_expression: &str,
) -> impl Future<Output = RocketMQResult<()>> + Send;
fn subscribe_with_listener<MQL>(
&self,
topic: &str,
sub_expression: &str,
listener: MQL,
) -> impl Future<Output = RocketMQResult<()>> + Send
where MQL: MessageQueueListener;
fn subscribe_with_selector(
&self,
topic: &str,
selector: Option<MessageSelector>,
) -> impl Future<Output = RocketMQResult<()>> + Send;
fn unsubscribe(&self, topic: &str) -> impl Future<Output = ()> + Send;
fn assignment(
&self,
) -> impl Future<Output = RocketMQResult<HashSet<MessageQueue>>> + Send;
fn assign(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send;
fn set_sub_expression_for_assign(
&self,
topic: &str,
sub_expression: &str,
) -> impl Future<Output = ()> + Send;
fn poll(&self) -> impl Future<Output = Vec<MessageExt>> + Send;
fn poll_with_timeout(
&self,
timeout: u64,
) -> impl Future<Output = Vec<MessageExt>> + Send;
fn seek(
&self,
message_queue: &MessageQueue,
offset: i64,
) -> impl Future<Output = RocketMQResult<()>> + Send;
fn pause(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send;
fn resume(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send;
fn is_auto_commit(&self) -> impl Future<Output = bool> + Send;
fn set_auto_commit(
&self,
auto_commit: bool,
) -> impl Future<Output = ()> + Send;
fn fetch_message_queues(
&self,
topic: &str,
) -> impl Future<Output = RocketMQResult<Vec<MessageQueue>>> + Send;
fn offset_for_timestamp(
&self,
message_queue: &MessageQueue,
timestamp: u64,
) -> impl Future<Output = RocketMQResult<i64>> + Send;
fn commit_sync(&self) -> impl Future<Output = ()> + Send;
fn commit_sync_with_map(
&self,
offset_map: HashMap<MessageQueue, i64>,
persist: bool,
) -> impl Future<Output = ()> + Send;
fn commit(&self) -> impl Future<Output = ()> + Send;
fn commit_with_map(
&self,
offset_map: HashMap<MessageQueue, i64>,
persist: bool,
) -> impl Future<Output = ()> + Send;
fn commit_with_set(
&self,
message_queues: HashSet<MessageQueue>,
persist: bool,
) -> impl Future<Output = ()> + Send;
fn committed(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<i64>> + Send;
fn register_topic_message_queue_change_listener<TL>(
&self,
topic: &str,
listener: TL,
) -> impl Future<Output = RocketMQResult<()>> + Send
where TL: TopicMessageQueueChangeListener;
fn update_name_server_address(
&self,
name_server_address: &str,
) -> impl Future<Output = ()> + Send;
fn seek_to_begin(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<()>> + Send;
fn seek_to_end(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<()>> + Send;
}
Required Methods§
Sourcefn start(&self) -> impl Future<Output = RocketMQResult<()>> + Send
fn start(&self) -> impl Future<Output = RocketMQResult<()>> + Send
Starts the LitePullConsumer.
§Returns
rocketmq_error::RocketMQResult<()>
- An empty result indicating success or failure.
Sourcefn is_running(&self) -> impl Future<Output = bool> + Send
fn is_running(&self) -> impl Future<Output = bool> + Send
Checks if the LitePullConsumer is running.
§Returns
bool
-true
if the consumer is running,false
otherwise.
Sourcefn subscribe_with_expression(
&self,
topic: &str,
sub_expression: &str,
) -> impl Future<Output = RocketMQResult<()>> + Send
fn subscribe_with_expression( &self, topic: &str, sub_expression: &str, ) -> impl Future<Output = RocketMQResult<()>> + Send
Sourcefn subscribe_with_listener<MQL>(
&self,
topic: &str,
sub_expression: &str,
listener: MQL,
) -> impl Future<Output = RocketMQResult<()>> + Sendwhere
MQL: MessageQueueListener,
fn subscribe_with_listener<MQL>(
&self,
topic: &str,
sub_expression: &str,
listener: MQL,
) -> impl Future<Output = RocketMQResult<()>> + Sendwhere
MQL: MessageQueueListener,
Subscribes to a topic with a subscription expression and a message queue listener.
§Arguments
topic
- The name of the topic to subscribe to.sub_expression
- The subscription expression.listener
- The message queue listener.
§Returns
rocketmq_error::RocketMQResult<()>
- An empty result indicating success or failure.
Sourcefn subscribe_with_selector(
&self,
topic: &str,
selector: Option<MessageSelector>,
) -> impl Future<Output = RocketMQResult<()>> + Send
fn subscribe_with_selector( &self, topic: &str, selector: Option<MessageSelector>, ) -> impl Future<Output = RocketMQResult<()>> + Send
Sourcefn assignment(
&self,
) -> impl Future<Output = RocketMQResult<HashSet<MessageQueue>>> + Send
fn assignment( &self, ) -> impl Future<Output = RocketMQResult<HashSet<MessageQueue>>> + Send
Retrieves the current assignment of message queues.
§Returns
rocketmq_error::RocketMQResult<HashSet<MessageQueue>>
- A set of assigned message queues or an error.
Sourcefn assign(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send
fn assign( &self, message_queues: Vec<MessageQueue>, ) -> impl Future<Output = ()> + Send
Assigns a list of message queues to the consumer.
§Arguments
message_queues
- A vector ofMessageQueue
instances to assign.
Sourcefn set_sub_expression_for_assign(
&self,
topic: &str,
sub_expression: &str,
) -> impl Future<Output = ()> + Send
fn set_sub_expression_for_assign( &self, topic: &str, sub_expression: &str, ) -> impl Future<Output = ()> + Send
Sets the subscription expression for an assigned topic.
§Arguments
topic
- The name of the topic.sub_expression
- The subscription expression.
Sourcefn poll_with_timeout(
&self,
timeout: u64,
) -> impl Future<Output = Vec<MessageExt>> + Send
fn poll_with_timeout( &self, timeout: u64, ) -> impl Future<Output = Vec<MessageExt>> + Send
Sourcefn seek(
&self,
message_queue: &MessageQueue,
offset: i64,
) -> impl Future<Output = RocketMQResult<()>> + Send
fn seek( &self, message_queue: &MessageQueue, offset: i64, ) -> impl Future<Output = RocketMQResult<()>> + Send
Sourcefn pause(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send
fn pause( &self, message_queues: Vec<MessageQueue>, ) -> impl Future<Output = ()> + Send
Pauses message consumption for the specified message queues.
§Arguments
message_queues
- A vector ofMessageQueue
instances to pause.
Sourcefn resume(
&self,
message_queues: Vec<MessageQueue>,
) -> impl Future<Output = ()> + Send
fn resume( &self, message_queues: Vec<MessageQueue>, ) -> impl Future<Output = ()> + Send
Resumes message consumption for the specified message queues.
§Arguments
message_queues
- A vector ofMessageQueue
instances to resume.
Sourcefn is_auto_commit(&self) -> impl Future<Output = bool> + Send
fn is_auto_commit(&self) -> impl Future<Output = bool> + Send
Sourcefn set_auto_commit(&self, auto_commit: bool) -> impl Future<Output = ()> + Send
fn set_auto_commit(&self, auto_commit: bool) -> impl Future<Output = ()> + Send
Sets the auto-commit mode.
§Arguments
auto_commit
-true
to enable auto-commit,false
to disable it.
Sourcefn fetch_message_queues(
&self,
topic: &str,
) -> impl Future<Output = RocketMQResult<Vec<MessageQueue>>> + Send
fn fetch_message_queues( &self, topic: &str, ) -> impl Future<Output = RocketMQResult<Vec<MessageQueue>>> + Send
Sourcefn offset_for_timestamp(
&self,
message_queue: &MessageQueue,
timestamp: u64,
) -> impl Future<Output = RocketMQResult<i64>> + Send
fn offset_for_timestamp( &self, message_queue: &MessageQueue, timestamp: u64, ) -> impl Future<Output = RocketMQResult<i64>> + Send
Sourcefn commit_sync(&self) -> impl Future<Output = ()> + Send
fn commit_sync(&self) -> impl Future<Output = ()> + Send
Commits the current offsets synchronously.
Sourcefn commit_sync_with_map(
&self,
offset_map: HashMap<MessageQueue, i64>,
persist: bool,
) -> impl Future<Output = ()> + Send
fn commit_sync_with_map( &self, offset_map: HashMap<MessageQueue, i64>, persist: bool, ) -> impl Future<Output = ()> + Send
Commits the provided offsets synchronously.
§Arguments
offset_map
- A map of message queues to offsets.persist
- Whether to persist the offsets.
Sourcefn commit_with_map(
&self,
offset_map: HashMap<MessageQueue, i64>,
persist: bool,
) -> impl Future<Output = ()> + Send
fn commit_with_map( &self, offset_map: HashMap<MessageQueue, i64>, persist: bool, ) -> impl Future<Output = ()> + Send
Commits the provided offsets.
§Arguments
offset_map
- A map of message queues to offsets.persist
- Whether to persist the offsets.
Sourcefn commit_with_set(
&self,
message_queues: HashSet<MessageQueue>,
persist: bool,
) -> impl Future<Output = ()> + Send
fn commit_with_set( &self, message_queues: HashSet<MessageQueue>, persist: bool, ) -> impl Future<Output = ()> + Send
Commits the offsets for the provided message queues.
§Arguments
message_queues
- A set of message queues to commit offsets for.persist
- Whether to persist the offsets.
Sourcefn committed(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<i64>> + Send
fn committed( &self, message_queue: &MessageQueue, ) -> impl Future<Output = RocketMQResult<i64>> + Send
Sourcefn register_topic_message_queue_change_listener<TL>(
&self,
topic: &str,
listener: TL,
) -> impl Future<Output = RocketMQResult<()>> + Sendwhere
TL: TopicMessageQueueChangeListener,
fn register_topic_message_queue_change_listener<TL>(
&self,
topic: &str,
listener: TL,
) -> impl Future<Output = RocketMQResult<()>> + Sendwhere
TL: TopicMessageQueueChangeListener,
Sourcefn update_name_server_address(
&self,
name_server_address: &str,
) -> impl Future<Output = ()> + Send
fn update_name_server_address( &self, name_server_address: &str, ) -> impl Future<Output = ()> + Send
Sourcefn seek_to_begin(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<()>> + Send
fn seek_to_begin( &self, message_queue: &MessageQueue, ) -> impl Future<Output = RocketMQResult<()>> + Send
Sourcefn seek_to_end(
&self,
message_queue: &MessageQueue,
) -> impl Future<Output = RocketMQResult<()>> + Send
fn seek_to_end( &self, message_queue: &MessageQueue, ) -> impl Future<Output = RocketMQResult<()>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.