pub struct KeyOpts {
pub numeric: bool,
pub general_numeric: bool,
pub human_numeric: bool,
pub month: bool,
pub version: bool,
pub random: bool,
pub reverse: bool,
pub ignore_leading_blanks: bool,
pub dictionary_order: bool,
pub ignore_case: bool,
pub ignore_nonprinting: bool,
}Expand description
Key definition parsing and field extraction for sort -k.
KEYDEF format: FIELD[.CHAR][OPTS],[FIELD[.CHAR][OPTS]] Fields and characters are 1-indexed. Per-key ordering options that can override global options.
Fields§
§numeric: bool§general_numeric: bool§human_numeric: bool§month: bool§version: bool§random: bool§reverse: bool§ignore_leading_blanks: bool§dictionary_order: bool§ignore_case: bool§ignore_nonprinting: boolImplementations§
Source§impl KeyOpts
impl KeyOpts
Sourcepub fn has_sort_type(&self) -> bool
pub fn has_sort_type(&self) -> bool
Returns true if any sort-type option is set.
Sourcepub fn has_any_option(&self) -> bool
pub fn has_any_option(&self) -> bool
Returns true if any option at all is set (for key inheritance logic).
Sourcepub fn parse_flags(&mut self, flags: &str)
pub fn parse_flags(&mut self, flags: &str)
Parse single-letter option flags from a string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyOpts
impl RefUnwindSafe for KeyOpts
impl Send for KeyOpts
impl Sync for KeyOpts
impl Unpin for KeyOpts
impl UnwindSafe for KeyOpts
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