SortConfig

Struct SortConfig 

Source
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: SortMode

Primary sort mode

§reverse: bool

Sort order (normal or reverse)

§unique: bool

Output only unique lines

§stable: bool

Use stable sort algorithm

§check: bool

Check if input is already sorted

§merge: bool

Merge already sorted files

§zero_terminated: bool

Use zero bytes as line terminators instead of newlines

§ignore_case: bool

Ignore case differences

§dictionary_order: bool

Consider only dictionary order (alphanumeric and blanks)

§ignore_leading_blanks: bool

Ignore leading blanks

§ignore_nonprinting: bool

Ignore 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: bool

Debug mode (for troubleshooting)

§compress_temp: bool

Compress temporary files

§temp_dir: Option<String>

Temporary directory for external sorting

Implementations§

Source§

impl SortConfig

Source

pub fn new() -> Self

Create a new configuration with default values

Source

pub fn with_mode(self, mode: SortMode) -> Self

Set the sort mode

Source

pub fn with_reverse(self, reverse: bool) -> Self

Enable reverse sorting

Source

pub fn with_unique(self, unique: bool) -> Self

Enable unique output

Source

pub fn with_stable(self, stable: bool) -> Self

Enable stable sorting

Source

pub fn with_check(self, check: bool) -> Self

Enable check mode

Source

pub fn with_merge(self, merge: bool) -> Self

Enable merge mode

Source

pub fn with_zero_terminated(self, zero_terminated: bool) -> Self

Enable zero-terminated lines

Source

pub fn with_field_separator(self, separator: Option<char>) -> Self

Set field separator

Source

pub fn add_key(self, key: SortKey) -> Self

Add a sort key

Source

pub fn with_output_file(self, output_file: Option<String>) -> Self

Set output file

Source

pub fn with_buffer_size(self, buffer_size: Option<usize>) -> Self

Set buffer size

Source

pub fn with_parallel_threads(self, threads: Option<usize>) -> Self

Set parallel threads

Source

pub fn with_input_files(self, files: Vec<String>) -> Self

Set input files

Source

pub fn with_debug(self, debug: bool) -> Self

Enable debug mode

Source

pub fn set_buffer_size_from_string(&mut self, size_str: &str) -> SortResult<()>

Parse buffer size from string (simplified)

Source

pub fn validate(&self) -> SortResult<()>

Validate configuration for consistency

Source

pub fn sort_order(&self) -> SortOrder

Get the effective sort order

Source

pub fn random_sort(&self) -> bool

Check if random sort is enabled

Source

pub fn numeric_sort(&self) -> bool

Check if numeric sort mode is enabled

Source

pub fn has_typed_keys(&self) -> bool

Check if any keys have specific sort types

Source

pub fn input_file_count(&self) -> usize

Get the number of input files (0 means stdin)

Source

pub fn reading_from_stdin(&self) -> bool

Check if reading from stdin

Source

pub fn writing_to_stdout(&self) -> bool

Check if writing to stdout

Source

pub fn effective_buffer_size(&self) -> usize

Get effective buffer size (with default)

Source

pub fn effective_thread_count(&self) -> usize

Get effective thread count

Source

pub fn for_merge(&self) -> Self

Create a configuration for merge operations

Source

pub fn for_check(&self) -> Self

Create a configuration for check operations

Trait Implementations§

Source§

impl Clone for SortConfig

Source§

fn clone(&self) -> SortConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SortConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SortConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V