Skip to main content

EnvironmentLogScanner

Struct EnvironmentLogScanner 

Source
pub struct EnvironmentLogScanner { /* private fields */ }
Expand description

LogScanner implementation backed by the live EnvironmentImpl.

Scans the log forward from an LSN cursor, returning entries that carry a VLSN >= from_vlsn. On each call to next_entry the scanner advances its internal file/offset position one entry at a time; when it reaches the current end of the log it returns None (the FeederRunner will call again after a brief poll interval).

Implementations§

Source§

impl EnvironmentLogScanner

Source

pub fn new(env: &EnvironmentImpl, start_lsn: Option<Lsn>) -> Option<Self>

Create a scanner that starts at start_lsn.

If start_lsn is NULL_LSN the scanner begins at the very first log entry in file 0. The correct first-entry offset is resolved from file 0’s log_version (32 for v2, 36 for v3). If file 0 does not exist yet (empty log) the current-version default (36) is used.

Obtain the FileManager from EnvironmentImpl::get_log_manager()LogManager is not directly accessible, but EnvironmentImpl exposes a get_log_manager() returning Option<Arc<LogManager>>. For the scanner we need the FileManager underneath it; the simplest approach is to construct the scanner directly from a FileManager Arc.

Trait Implementations§

Source§

impl LogScanner for EnvironmentLogScanner

Source§

fn next_entry(&mut self, from_vlsn: u64) -> Option<(u64, u8, Vec<u8>)>

Return the next entry with VLSN >= from_vlsn, advancing the cursor.

Scans forward one entry at a time. Returns None when the cursor reaches the end of the currently-written log. The feeder will sleep briefly and call again.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V