pub struct Headers { /* private fields */ }
Expand description
The headers of a CSV file
Implementations§
Source§impl Headers
impl Headers
pub fn new() -> Self
Sourcepub fn rename(&mut self, from: &str, to: &str) -> Result<(), RenameError>
pub fn rename(&mut self, from: &str, to: &str) -> Result<(), RenameError>
Returns Error::MissingColumn
if from
is non-existant or Error::DuplicateColumn
the new name already exists
Sourcepub fn push_field(&mut self, name: &str) -> bool
pub fn push_field(&mut self, name: &str) -> bool
Returns false if the field already exists
pub fn contains(&self, name: &str) -> bool
pub fn get_field<'a>(&self, row: &'a Row, name: &str) -> Option<&'a str>
pub fn get_index(&self, name: &str) -> Option<usize>
pub fn get_row(&self) -> &Row
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Headers
impl<'a> IntoIterator for &'a Headers
impl StructuralPartialEq for Headers
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
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