Struct hcklib::field_range::FieldRange
source · [−]Expand description
Represent a range of columns to keep.
Fields
low: usizehigh: usizepos: usizeImplementations
sourceimpl 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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn exclude(
fields: Vec<FieldRange>,
exclude: Vec<FieldRange>
) -> Vec<FieldRange>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Remove ranges in exclude from fields.
This assumes both fields and exclude are in ascending order by low value.
Trait Implementations
sourceimpl Clone for FieldRange
impl Clone for FieldRange
sourcefn clone(&self) -> FieldRange
fn clone(&self) -> FieldRange
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for FieldRange
impl Debug for FieldRange
sourceimpl FromStr for FieldRange
impl FromStr for FieldRange
sourcefn 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.
sourceimpl Ord for FieldRange
impl Ord for FieldRange
sourceimpl PartialEq<FieldRange> for FieldRange
impl PartialEq<FieldRange> for FieldRange
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &FieldRange) -> bool
fn ne(&self, other: &FieldRange) -> bool
This method tests for !=.
sourceimpl PartialOrd<FieldRange> for FieldRange
impl PartialOrd<FieldRange> for FieldRange
sourcefn partial_cmp(&self, other: &FieldRange) -> Option<Ordering>
fn partial_cmp(&self, other: &FieldRange) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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
impl Copy for FieldRange
impl Eq for FieldRange
impl StructuralEq for FieldRange
impl StructuralPartialEq for FieldRange
Auto Trait Implementations
impl RefUnwindSafe for FieldRange
impl Send for FieldRange
impl Sync for FieldRange
impl Unpin for FieldRange
impl UnwindSafe for FieldRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more