pub struct Config { /* private fields */ }Expand description
Configuration for PDF text extraction.
Use the builder pattern to customize extraction behavior.
§Example
use pdfvec::Config;
// Default configuration
let config = Config::default();
// Custom configuration
let config = Config::default()
.with_page_separator("\n\n---\n\n")
.with_parallel(true);Implementations§
Source§impl Config
impl Config
Sourcepub fn with_page_separator(self, separator: impl Into<String>) -> Self
pub fn with_page_separator(self, separator: impl Into<String>) -> Self
Sets the string inserted between pages in extracted text.
§Example
use pdfvec::Config;
let config = Config::default().with_page_separator("\n---\n");Sourcepub fn with_parallel(self, parallel: bool) -> Self
pub fn with_parallel(self, parallel: bool) -> Self
Enables or disables parallel page processing.
When enabled, pages are extracted concurrently using rayon. Disable for deterministic output order or when running in environments with limited threading support.
Default: true
§Example
use pdfvec::Config;
let config = Config::default().with_parallel(false);Sourcepub fn with_normalize_whitespace(self, normalize: bool) -> Self
pub fn with_normalize_whitespace(self, normalize: bool) -> Self
Enables or disables whitespace normalization.
When enabled, consecutive whitespace characters are collapsed to a single space and leading/trailing whitespace is trimmed.
Default: true
§Example
use pdfvec::Config;
let config = Config::default().with_normalize_whitespace(false);Sourcepub fn page_separator(&self) -> &str
pub fn page_separator(&self) -> &str
Returns the page separator string.
Sourcepub fn normalize_whitespace(&self) -> bool
pub fn normalize_whitespace(&self) -> bool
Returns whether whitespace normalization is enabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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