pub struct IngestBatch { /* private fields */ }Expand description
A batch of files staged for ingest. Holds file data in memory; plugin borrows it (zero-copy) before compression begins.
Implementations§
Source§impl IngestBatch
impl IngestBatch
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
Sourcepub fn push(&mut self, path: String, data: Vec<u8>)
pub fn push(&mut self, path: String, data: Vec<u8>)
Stage a file. Data is moved in (caller gives up ownership).
No copy — the Vec
pub fn total_bytes(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn extract_metadata(&mut self, plugin: &dyn ArchiveTypePlugin)
pub fn extract_metadata(&mut self, plugin: &dyn ArchiveTypePlugin)
Run the plugin’s batch extraction on all staged files (zero-copy). After this call, each StagedFile.metadata is populated.
Sourcepub fn drain(&mut self) -> impl Iterator<Item = StagedFile> + '_
pub fn drain(&mut self) -> impl Iterator<Item = StagedFile> + '_
Drain files for compression. Caller gets ownership of (path, data, metadata). After this, the batch is empty and ready for reuse.
Sourcepub fn iter(&self) -> impl Iterator<Item = &StagedFile>
pub fn iter(&self) -> impl Iterator<Item = &StagedFile>
Iterate staged files (for inspection before drain)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IngestBatch
impl RefUnwindSafe for IngestBatch
impl Send for IngestBatch
impl Sync for IngestBatch
impl Unpin for IngestBatch
impl UnsafeUnpin for IngestBatch
impl UnwindSafe for IngestBatch
Blanket Implementations§
impl<T> Allocation for T
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