BatchFetchExt

Trait BatchFetchExt 

Source
pub trait BatchFetchExt:
    ClientProvider
    + TimeoutProvider
    + RequestSender
    + Clone {
    // Required methods
    fn get_batch(
        &self,
        stream: &str,
        batch: usize,
    ) -> GetBatchBuilder<Self, NoSeq, NoTime>;
    fn get_last_messages_for(
        &self,
        stream: &str,
    ) -> GetLastBuilder<Self, NoSeq, NoTime>;
}
Expand description

Extension trait for batch fetching messages from JetStream streams.

Required Methods§

Source

fn get_batch( &self, stream: &str, batch: usize, ) -> GetBatchBuilder<Self, NoSeq, NoTime>

Create a builder for fetching a batch of messages from a stream.

Uses the DIRECT.GET API to efficiently retrieve multiple messages in a single request. The server sends messages without flow control up to the specified batch size or max_bytes limit.

Source

fn get_last_messages_for( &self, stream: &str, ) -> GetLastBuilder<Self, NoSeq, NoTime>

Create a builder for fetching the last messages for multiple subjects.

Retrieves the most recent message for each of the specified subjects from the stream. Supports consistent point-in-time reads across multiple subjects using up_to_seq or up_to_time options.

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.

Implementors§