pub struct PdfGrep { /* private fields */ }Expand description
Configured pattern matcher. Construct via PdfGrepBuilder.
Implementations§
Source§impl PdfGrep
impl PdfGrep
Sourcepub fn search_file<'a>(&'a self, path: &Path) -> PageIterator<'a> ⓘ
pub fn search_file<'a>(&'a self, path: &Path) -> PageIterator<'a> ⓘ
Search a single PDF file. Returns an iterator yielding matches lazily,
one page of extraction work per .next() call (FR-042).
Peak memory is bounded by O(one page of text + match buffer) —
never O(whole document).
Sourcepub fn search_file_collected(
&self,
path: &Path,
) -> Result<Vec<Match>, PdfGrepError>
pub fn search_file_collected( &self, path: &Path, ) -> Result<Vec<Match>, PdfGrepError>
Convenience: run search_file and collect into a
Vec<Match>. Eager; for large documents, prefer the iterator.
Sourcepub fn invert_match(&self) -> bool
pub fn invert_match(&self) -> bool
True when -v/--invert-match is active.
Sourcepub fn only_matching(&self) -> bool
pub fn only_matching(&self) -> bool
True when -o/--only-matching is active.
Sourcepub fn page_range(&self) -> Option<(u32, u32)>
pub fn page_range(&self) -> Option<(u32, u32)>
Configured --page-range N-M.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PdfGrep
impl RefUnwindSafe for PdfGrep
impl Send for PdfGrep
impl Sync for PdfGrep
impl Unpin for PdfGrep
impl UnsafeUnpin for PdfGrep
impl UnwindSafe for PdfGrep
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