pub struct PageAssembler { /* private fields */ }Expand description
Accumulates RECORDs into pages and attaches the latest STATE as the page bookmark, per the v0 single-stream rules.
Implementations§
Source§impl PageAssembler
impl PageAssembler
Sourcepub fn new(
target_stream: impl Into<String>,
batch_size: usize,
flush_on_state: bool,
) -> Self
pub fn new( target_stream: impl Into<String>, batch_size: usize, flush_on_state: bool, ) -> Self
batch_size == 0 disables size-based flushing (flush only on STATE/EOF).
Sourcepub fn on_record(&mut self, stream: &str, record: Value) -> Option<StreamPage>
pub fn on_record(&mut self, stream: &str, record: Value) -> Option<StreamPage>
Feed a RECORD. Records for a different stream are ignored (single-stream
v0). Returns a page when the batch_size threshold is reached.
Sourcepub fn on_state(&mut self, value: Value) -> Option<StreamPage>
pub fn on_state(&mut self, value: Value) -> Option<StreamPage>
Feed a STATE. Always becomes the pending checkpoint; flushes immediately
when flush_on_state (yielding a page — possibly empty — that carries
the STATE as its bookmark).
Sourcepub fn on_eof(&mut self) -> Option<StreamPage>
pub fn on_eof(&mut self) -> Option<StreamPage>
Flush any trailing buffer + pending checkpoint at end-of-stream. Returns
None when there is nothing to emit.
Auto Trait Implementations§
impl Freeze for PageAssembler
impl RefUnwindSafe for PageAssembler
impl Send for PageAssembler
impl Sync for PageAssembler
impl Unpin for PageAssembler
impl UnsafeUnpin for PageAssembler
impl UnwindSafe for PageAssembler
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