Struct WalScanner
pub struct WalScanner { /* private fields */ }Expand description
Follows the chain through one segment from a growing prefix of its
bytes, like crate::segment::SegmentScanner.
Implementations§
§impl WalScanner
impl WalScanner
pub fn start(bytes: &[u8], complete: bool) -> Result<Option<Self>, WalError>
pub fn start(bytes: &[u8], complete: bool) -> Result<Option<Self>, WalError>
Starts at the segment’s base. expect is the chain position the
previous segment ended at (None for the first segment read, which
must start at or before the position recovery needs). Ok(None) for a
never-activated segment.
pub fn header(&self) -> &WalHeader
pub fn advance(
&mut self,
bytes: &[u8],
complete: bool,
segment_len: usize,
visit: &mut dyn FnMut(&BatchView<'_>),
) -> Progress
pub fn advance( &mut self, bytes: &[u8], complete: bool, segment_len: usize, visit: &mut dyn FnMut(&BatchView<'_>), ) -> Progress
Continues over bytes, the segment’s first bytes.len() bytes;
segment_len is the file’s length (batches never extend past it).
Accepted batches are visited once each, in order.
Auto Trait Implementations§
impl Freeze for WalScanner
impl RefUnwindSafe for WalScanner
impl Send for WalScanner
impl Sync for WalScanner
impl Unpin for WalScanner
impl UnsafeUnpin for WalScanner
impl UnwindSafe for WalScanner
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