pub struct SortConfig {Show 20 fields
pub mode: SortMode,
pub reverse: bool,
pub unique: bool,
pub stable: bool,
pub check: bool,
pub merge: bool,
pub zero_terminated: bool,
pub ignore_case: bool,
pub dictionary_order: bool,
pub ignore_leading_blanks: bool,
pub ignore_nonprinting: bool,
pub field_separator: Option<char>,
pub keys: Vec<SortKey>,
pub output_file: Option<String>,
pub buffer_size: Option<usize>,
pub parallel_threads: Option<usize>,
pub input_files: Vec<String>,
pub debug: bool,
pub compress_temp: bool,
pub temp_dir: Option<String>,
}Expand description
Main configuration structure for sort operations
Fields§
§mode: SortModePrimary sort mode
reverse: boolSort order (normal or reverse)
unique: boolOutput only unique lines
stable: boolUse stable sort algorithm
check: boolCheck if input is already sorted
merge: boolMerge already sorted files
zero_terminated: boolUse zero bytes as line terminators instead of newlines
ignore_case: boolIgnore case differences
dictionary_order: boolConsider only dictionary order (alphanumeric and blanks)
ignore_leading_blanks: boolIgnore leading blanks
ignore_nonprinting: boolIgnore non-printing characters
field_separator: Option<char>Field separator character
keys: Vec<SortKey>Sort keys (field specifications)
output_file: Option<String>Output file path
buffer_size: Option<usize>Buffer size for I/O operations
parallel_threads: Option<usize>Number of parallel threads to use
input_files: Vec<String>Files to read from (if not specified, use stdin)
debug: boolDebug mode (for troubleshooting)
compress_temp: boolCompress temporary files
temp_dir: Option<String>Temporary directory for external sorting
Implementations§
Source§impl SortConfig
impl SortConfig
Sourcepub fn with_reverse(self, reverse: bool) -> Self
pub fn with_reverse(self, reverse: bool) -> Self
Enable reverse sorting
Sourcepub fn with_unique(self, unique: bool) -> Self
pub fn with_unique(self, unique: bool) -> Self
Enable unique output
Sourcepub fn with_stable(self, stable: bool) -> Self
pub fn with_stable(self, stable: bool) -> Self
Enable stable sorting
Sourcepub fn with_check(self, check: bool) -> Self
pub fn with_check(self, check: bool) -> Self
Enable check mode
Sourcepub fn with_merge(self, merge: bool) -> Self
pub fn with_merge(self, merge: bool) -> Self
Enable merge mode
Sourcepub fn with_zero_terminated(self, zero_terminated: bool) -> Self
pub fn with_zero_terminated(self, zero_terminated: bool) -> Self
Enable zero-terminated lines
Sourcepub fn with_field_separator(self, separator: Option<char>) -> Self
pub fn with_field_separator(self, separator: Option<char>) -> Self
Set field separator
Sourcepub fn with_output_file(self, output_file: Option<String>) -> Self
pub fn with_output_file(self, output_file: Option<String>) -> Self
Set output file
Sourcepub fn with_buffer_size(self, buffer_size: Option<usize>) -> Self
pub fn with_buffer_size(self, buffer_size: Option<usize>) -> Self
Set buffer size
Sourcepub fn with_parallel_threads(self, threads: Option<usize>) -> Self
pub fn with_parallel_threads(self, threads: Option<usize>) -> Self
Set parallel threads
Sourcepub fn with_input_files(self, files: Vec<String>) -> Self
pub fn with_input_files(self, files: Vec<String>) -> Self
Set input files
Sourcepub fn with_debug(self, debug: bool) -> Self
pub fn with_debug(self, debug: bool) -> Self
Enable debug mode
Sourcepub fn set_buffer_size_from_string(&mut self, size_str: &str) -> SortResult<()>
pub fn set_buffer_size_from_string(&mut self, size_str: &str) -> SortResult<()>
Parse buffer size from string (simplified)
Sourcepub fn validate(&self) -> SortResult<()>
pub fn validate(&self) -> SortResult<()>
Validate configuration for consistency
Sourcepub fn sort_order(&self) -> SortOrder
pub fn sort_order(&self) -> SortOrder
Get the effective sort order
Sourcepub fn random_sort(&self) -> bool
pub fn random_sort(&self) -> bool
Check if random sort is enabled
Sourcepub fn numeric_sort(&self) -> bool
pub fn numeric_sort(&self) -> bool
Check if numeric sort mode is enabled
Sourcepub fn has_typed_keys(&self) -> bool
pub fn has_typed_keys(&self) -> bool
Check if any keys have specific sort types
Sourcepub fn input_file_count(&self) -> usize
pub fn input_file_count(&self) -> usize
Get the number of input files (0 means stdin)
Sourcepub fn reading_from_stdin(&self) -> bool
pub fn reading_from_stdin(&self) -> bool
Check if reading from stdin
Sourcepub fn writing_to_stdout(&self) -> bool
pub fn writing_to_stdout(&self) -> bool
Check if writing to stdout
Sourcepub fn effective_buffer_size(&self) -> usize
pub fn effective_buffer_size(&self) -> usize
Get effective buffer size (with default)
Sourcepub fn effective_thread_count(&self) -> usize
pub fn effective_thread_count(&self) -> usize
Get effective thread count
Trait Implementations§
Source§impl Clone for SortConfig
impl Clone for SortConfig
Source§fn clone(&self) -> SortConfig
fn clone(&self) -> SortConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SortConfig
impl Debug for SortConfig
Auto Trait Implementations§
impl Freeze for SortConfig
impl RefUnwindSafe for SortConfig
impl Send for SortConfig
impl Sync for SortConfig
impl Unpin for SortConfig
impl UnwindSafe for SortConfig
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