Struct hcklib::field_range::FieldRange
source · Expand description
Represent a range of columns to keep.
Fields§
§low: usize
§high: usize
§pos: usize
Implementations§
source§impl FieldRange
impl FieldRange
pub const fn default() -> Self
sourcepub fn from_list(list: &str) -> Result<Vec<FieldRange>, FieldError>
pub fn from_list(list: &str) -> Result<Vec<FieldRange>, FieldError>
Parse a comma separated list of fields and merge any overlaps
sourcepub fn from_header_list(
list: &[Regex],
header: &[u8],
delim: &RegexOrString,
header_is_regex: bool,
allow_missing: bool
) -> Result<Vec<FieldRange>, FieldError>
pub fn from_header_list(
list: &[Regex],
header: &[u8],
delim: &RegexOrString,
header_is_regex: bool,
allow_missing: bool
) -> Result<Vec<FieldRange>, FieldError>
Get the indices of the headers that match any of the provided regex’s.
sourcepub fn post_process_ranges(ranges: &mut Vec<FieldRange>)
pub fn post_process_ranges(ranges: &mut Vec<FieldRange>)
Sort and merge overlaps in a set of Vec<FieldRange>
.
sourcepub fn exclude(
fields: Vec<FieldRange>,
exclude: Vec<FieldRange>
) -> Vec<FieldRange> ⓘ
pub fn exclude(
fields: Vec<FieldRange>,
exclude: Vec<FieldRange>
) -> Vec<FieldRange> ⓘ
Remove ranges in exclude from fields.
This assumes both fields and exclude are in ascending order by low
value.
Trait Implementations§
source§impl Clone for FieldRange
impl Clone for FieldRange
source§fn clone(&self) -> FieldRange
fn clone(&self) -> FieldRange
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FieldRange
impl Debug for FieldRange
source§impl FromStr for FieldRange
impl FromStr for FieldRange
source§fn from_str(s: &str) -> Result<FieldRange, FieldError>
fn from_str(s: &str) -> Result<FieldRange, FieldError>
Convert a str
into a FieldRange
§type Err = FieldError
type Err = FieldError
The associated error which can be returned from parsing.
source§impl Ord for FieldRange
impl Ord for FieldRange
source§fn cmp(&self, other: &FieldRange) -> Ordering
fn cmp(&self, other: &FieldRange) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<FieldRange> for FieldRange
impl PartialEq<FieldRange> for FieldRange
source§fn eq(&self, other: &FieldRange) -> bool
fn eq(&self, other: &FieldRange) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<FieldRange> for FieldRange
impl PartialOrd<FieldRange> for FieldRange
source§fn partial_cmp(&self, other: &FieldRange) -> Option<Ordering>
fn partial_cmp(&self, other: &FieldRange) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more