pub struct StreamingWalReader<R: Read> { /* private fields */ }Expand description
Concrete WalStreamReader impl over an arbitrary std::io::Read.
Typical instantiations:
StreamingWalReader<std::fs::File>— on-disk archive readerStreamingWalReader<&[u8]>— in-memory test fixture (the common case in this module’s own test suite)
Implementations§
Source§impl<R: Read> StreamingWalReader<R>
impl<R: Read> StreamingWalReader<R>
Sourcepub fn open_v1(reader: R) -> Result<Self, WalExportError>
pub fn open_v1(reader: R) -> Result<Self, WalExportError>
Open a reader by consuming + dispatching the 8-byte stream header magic.
Fail-fast posture: the 8-byte header is read into a stack
array; an unrecognised magic yields
WalExportError::UnsupportedStreamVersion with no heap
allocation pre-rejection. A truncated header (fewer than 8
bytes) yields InvalidFramingReason::HeaderMissing.
Sourcepub fn magic(&self) -> StreamMagic
pub fn magic(&self) -> StreamMagic
Recognised stream magic version. Currently always
StreamMagic::V1.
Trait Implementations§
Source§impl<R: Read> WalStreamReader for StreamingWalReader<R>
impl<R: Read> WalStreamReader for StreamingWalReader<R>
Source§fn next_record(&mut self) -> Result<Option<&[u8]>, WalExportError>
fn next_record(&mut self) -> Result<Option<&[u8]>, WalExportError>
Read the next record’s payload bytes. Read more
Source§fn cumulative_position(&self) -> u64
fn cumulative_position(&self) -> u64
Cumulative byte count consumed from the underlying reader,
including the 8-byte stream header magic + each record’s
[8 byte length prefix][payload] frame. Useful for forensic
“where did the parse fail” reporting and for operator metrics
(bytes-processed throughput).Auto Trait Implementations§
impl<R> Freeze for StreamingWalReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for StreamingWalReader<R>where
R: RefUnwindSafe,
impl<R> Send for StreamingWalReader<R>where
R: Send,
impl<R> Sync for StreamingWalReader<R>where
R: Sync,
impl<R> Unpin for StreamingWalReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for StreamingWalReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for StreamingWalReader<R>where
R: UnwindSafe,
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