pub struct ProcessingConfig {
pub indent: u8,
pub width: usize,
pub in_place: bool,
pub dry_run: bool,
pub workers: usize,
pub mmap_threshold: usize,
pub verbose: bool,
}Expand description
Configuration for parallel file processing.
Fields§
§indent: u8Indentation width (2-8 spaces)
width: usizeMaximum line width
in_place: boolEdit files in-place
dry_run: boolShow changes without modifying files (dry-run mode)
workers: usizeNumber of parallel workers (0 = auto-detect)
mmap_threshold: usizeFile size threshold for memory-mapped reading (bytes)
verbose: boolEnable verbose progress output
Implementations§
Source§impl ProcessingConfig
impl ProcessingConfig
Sourcepub const DEFAULT_MMAP_THRESHOLD: usize = 524_288usize
pub const DEFAULT_MMAP_THRESHOLD: usize = 524_288usize
Default memory-map threshold: 512KB
Sourcepub const MIN_INDENT: u8 = 2u8
pub const MIN_INDENT: u8 = 2u8
Minimum indentation width
Sourcepub const MAX_INDENT: u8 = 8u8
pub const MAX_INDENT: u8 = 8u8
Maximum indentation width
Sourcepub fn effective_workers(&self) -> usize
pub fn effective_workers(&self) -> usize
Returns the effective number of workers to use. If workers is 0, returns the number of logical CPU cores.
Sourcepub fn with_indent(self, indent: u8) -> Self
pub fn with_indent(self, indent: u8) -> Self
Sets the indentation width (clamped to MIN_INDENT..=MAX_INDENT)
Sourcepub const fn with_width(self, width: usize) -> Self
pub const fn with_width(self, width: usize) -> Self
Sets the maximum line width
Sourcepub const fn with_in_place(self, in_place: bool) -> Self
pub const fn with_in_place(self, in_place: bool) -> Self
Enables in-place file editing
Sourcepub const fn with_dry_run(self, dry_run: bool) -> Self
pub const fn with_dry_run(self, dry_run: bool) -> Self
Enables dry-run mode (show changes without modifying files)
Sourcepub const fn with_workers(self, workers: usize) -> Self
pub const fn with_workers(self, workers: usize) -> Self
Sets the number of parallel workers (0 = auto-detect)
Sourcepub const fn with_mmap_threshold(self, threshold: usize) -> Self
pub const fn with_mmap_threshold(self, threshold: usize) -> Self
Sets the memory-map threshold
Sourcepub const fn with_verbose(self, verbose: bool) -> Self
pub const fn with_verbose(self, verbose: bool) -> Self
Enables verbose progress output
Trait Implementations§
Source§impl Clone for ProcessingConfig
impl Clone for ProcessingConfig
Source§fn clone(&self) -> ProcessingConfig
fn clone(&self) -> ProcessingConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessingConfig
impl Debug for ProcessingConfig
Auto Trait Implementations§
impl Freeze for ProcessingConfig
impl RefUnwindSafe for ProcessingConfig
impl Send for ProcessingConfig
impl Sync for ProcessingConfig
impl Unpin for ProcessingConfig
impl UnwindSafe for ProcessingConfig
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
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>
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