pub struct LogParser { /* private fields */ }Implementations§
Source§impl LogParser
impl LogParser
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, ParseError>
pub fn iter(&self) -> LogIterator<'_> ⓘ
Sourcepub fn index(&self) -> RecordIndex
pub fn index(&self) -> RecordIndex
两阶段扫描第一阶段:构建记录起始字节偏移索引。
单线程扫描整个文件,返回的 RecordIndex 可直接用于并行处理阶段。
Sourcepub fn par_iter(
&self,
) -> impl ParallelIterator<Item = Result<Sqllog<'_>, ParseError>> + '_
pub fn par_iter( &self, ) -> impl ParallelIterator<Item = Result<Sqllog<'_>, ParseError>> + '_
Returns a Rayon parallel iterator over all log records.
Large files (≥ PAR_THRESHOLD = 32 MB) are split into N byte-aligned chunks
at record boundaries — O(threads) overhead, not O(records). Small files use a
single partition so Rayon executes single-threaded without scheduling cost
(PAR-03 semantics). index() is intentionally not called here: a full
sequential pre-scan would double I/O on mmap’d, I/O-bound workloads.
Auto Trait Implementations§
impl Freeze for LogParser
impl RefUnwindSafe for LogParser
impl Send for LogParser
impl Sync for LogParser
impl Unpin for LogParser
impl UnsafeUnpin for LogParser
impl UnwindSafe for LogParser
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
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>
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 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>
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