Struct csv::Position
[−]
[src]
pub struct Position { /* fields omitted */ }
A position in CSV data.
A position is used to report errors in CSV data. All positions include the byte offset, line number and record index at which the error occurred.
Byte offsets and record indices start at 0
. Line numbers start at 1
.
A CSV reader will automatically assign the position of each record.
Methods
impl Position
[src]
fn new() -> Position
[src]
Returns a new position initialized to the start value.
fn byte(&self) -> u64
[src]
The byte offset, starting at 0
, of this position.
fn line(&self) -> u64
[src]
The line number, starting at 1
, of this position.
fn record(&self) -> u64
[src]
The record index, starting with the first record at 0
.
fn set_byte(&mut self, byte: u64) -> &mut Position
[src]
Set the byte offset of this position.
fn set_line(&mut self, line: u64) -> &mut Position
[src]
Set the line number of this position.
If the line number is less than 1
, then this method panics.
fn set_record(&mut self, record: u64) -> &mut Position
[src]
Set the record index of this position.
Trait Implementations
impl Clone for Position
[src]
fn clone(&self) -> Position
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more