Enum csv::NextField
[−]
[src]
pub enum NextField<'a, T: ?Sized + 'a> { Data(&'a T), Error(Error), EndOfRecord, EndOfCsv, }
NextField is the result of parsing a single CSV field.
This is only useful if you're using the low level next_bytes
method.
Variants
Data | A single CSV field as a borrowed slice of the parser's internal buffer. |
Error | A CSV error found during parsing. When an error is found, it is
first returned. All subsequent calls of In general, once |
EndOfRecord | Indicates the end of a record. |
EndOfCsv | Indicates the end of the CSV data. Once this state is entered, the parser can never leave it. |
Methods
impl<'a, T: ?Sized + Debug> NextField<'a, T>
fn into_iter_result(self) -> Option<Result<&'a T>>
Transform NextField into an iterator result.
fn is_end(&self) -> bool
Returns true if and only if the end of CSV data has been reached.
fn unwrap(self) -> &'a T
Returns the underlying field data.
If NextField
is an error or an end of record/CSV marker, this will
panic.