pub struct MmapBatch { /* private fields */ }Available on non-crate feature
mmap only.Expand description
Fallback batch implementation
Implementations§
Source§impl MmapBatch
impl MmapBatch
Sourcepub fn from_jsonl_file(path: &Path) -> Result<Self>
pub fn from_jsonl_file(path: &Path) -> Result<Self>
Create a batch from a JSONL file
Sourcepub fn iter(&self) -> impl Iterator<Item = (&Arc<MessageId>, &[u8])> + '_
pub fn iter(&self) -> impl Iterator<Item = (&Arc<MessageId>, &[u8])> + '_
Iterate over all messages in the batch
Sourcepub async fn from_jsonl_file_async(path: &Path) -> Result<Self>
pub async fn from_jsonl_file_async(path: &Path) -> Result<Self>
Create a batch from a JSONL file (ASYNC - Non-blocking fallback!)
This is the async version of from_jsonl_file for the non-mmap fallback
that uses tokio::task::spawn_blocking to avoid blocking the async runtime.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MmapBatch
impl RefUnwindSafe for MmapBatch
impl Send for MmapBatch
impl Sync for MmapBatch
impl Unpin for MmapBatch
impl UnwindSafe for MmapBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more