pub struct StreamingLogicalLogReader {
pub offset: usize,
/* private fields */
}Fields§
§offset: usizeOffset to read from file
Implementations§
Source§impl StreamingLogicalLogReader
impl StreamingLogicalLogReader
pub fn new( file: Arc<dyn File>, encryption_ctx: Option<EncryptionContext>, ) -> Self
Sourcepub fn last_valid_offset(&self) -> usize
pub fn last_valid_offset(&self) -> usize
Returns the byte offset just past the last fully validated transaction frame. After recovery, the log writer should resume from this offset so any torn-tail bytes beyond it are overwritten by the next append.
Sourcepub fn running_crc(&self) -> u32
pub fn running_crc(&self) -> u32
Returns the running CRC state after all validated frames. Used during recovery to hand off the chain state to the writer so it can continue appending.
pub fn read_header(&mut self, io: &Arc<dyn IO>) -> Result<()>
Sourcepub fn next_portable_change_frame(
&mut self,
) -> Result<IOResult<Option<PortableChangeFrame>>>
pub fn next_portable_change_frame( &mut self, ) -> Result<IOResult<Option<PortableChangeFrame>>>
Reads the next transaction frame and returns its portable logical-change payload. This validates the LML3 frame envelope and chained CRC while treating the recovery payload as opaque bytes.
Empty payloads are returned because internal-only commits still advance the logical-log offset even though clients have no operation to apply.
Sourcepub fn next_portable_changes(
&mut self,
) -> Result<IOResult<Option<PortableChangeFrame>>>
pub fn next_portable_changes( &mut self, ) -> Result<IOResult<Option<PortableChangeFrame>>>
Reads the next portable logical-change payload, skipping internal-only frames.
Empty payloads are valid: internal-only commits still need recovery log frames, but they do not produce client-visible logical operations.
pub fn is_eof(&self) -> bool
Sourcepub fn read_more_data(&mut self, need: usize) -> Result<IOResult<()>>
pub fn read_more_data(&mut self, need: usize) -> Result<IOResult<()>>
Read at least need bytes from the logical log, issuing multiple
reads if necessary. If at any point 0 bytes are read, that indicates
corruption.
Non-blocking: a pread in flight is tracked in self.in_flight_read
and the method yields its completion until done. Re-entry picks up
where it left off without re-issuing the read.
Auto Trait Implementations§
impl !RefUnwindSafe for StreamingLogicalLogReader
impl !UnwindSafe for StreamingLogicalLogReader
impl Freeze for StreamingLogicalLogReader
impl Send for StreamingLogicalLogReader
impl Sync for StreamingLogicalLogReader
impl Unpin for StreamingLogicalLogReader
impl UnsafeUnpin for StreamingLogicalLogReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more