pub struct HeaderSpec { /* private fields */ }Expand description
Validated header format: field names, stratified fields and fill value.
Implementations§
Source§impl HeaderSpec
impl HeaderSpec
Sourcepub fn new(
format: &[String],
metadata_fields: Option<&[String]>,
fill: &str,
) -> Result<Self>
pub fn new( format: &[String], metadata_fields: Option<&[String]>, fill: &str, ) -> Result<Self>
Validates the format, the stratified subset and the fill value.
§Errors
A usage error naming the offending entry (and the valid names) when a name is empty or repeated, a metadata field is not in the format, or the fill value is empty.
Sourcepub fn stratified(&self) -> &[usize]
pub fn stratified(&self) -> &[usize]
Indices (into HeaderSpec::fields) of the stratified fields, in header order.
Sourcepub fn stratified_names(&self) -> Vec<String>
pub fn stratified_names(&self) -> Vec<String>
Names of the stratified fields, in header order.
Trait Implementations§
Source§impl Clone for HeaderSpec
impl Clone for HeaderSpec
Source§fn clone(&self) -> HeaderSpec
fn clone(&self) -> HeaderSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HeaderSpec
impl Debug for HeaderSpec
impl Eq for HeaderSpec
Source§impl PartialEq for HeaderSpec
impl PartialEq for HeaderSpec
impl StructuralPartialEq for HeaderSpec
Auto Trait Implementations§
impl Freeze for HeaderSpec
impl RefUnwindSafe for HeaderSpec
impl Send for HeaderSpec
impl Sync for HeaderSpec
impl Unpin for HeaderSpec
impl UnsafeUnpin for HeaderSpec
impl UnwindSafe for HeaderSpec
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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