| 402 | |
| 403 | impl<'a> RawIterator<'a> { |
| 404 | pub fn next(&mut self) -> Option<Result<Option<&[u8]>, io::Error>> { |
| 405 | if self.current_column > self.num_columns { |
| 406 | return None; |
| 407 | } |
| 408 | |
| 409 | if self.current_column == self.num_columns { |
| 410 | if !self.truncate { |
| 411 | if let Some(err) = self.parser.expect_end_of_line().err() { |
| 412 | return Some(Err(err)); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | return None; |
| 417 | } |
| 418 | |
| 419 | if self.current_column > 0 { |
| 420 | if let Some(err) = self.parser.expect_column_delimiter().err() { |
| 421 | return Some(Err(err)); |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | self.current_column += 1; |
| 426 | Some(self.parser.consume_raw_value()) |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)] |