pub struct RowParseError {
pub row: u64,
pub column: Option<String>,
pub raw_sample: String,
pub message: String,
}Expand description
Structured per-record parse failure. Carries the user-visible row
number, an optional column attribution (CSV cell parses), a
truncated sample of the raw bytes that failed, and the underlying
message. Boxed into std::io::Error via row_parse_io_error
so it travels through the standard feed / finish return type;
recoverable via downcast_row_parse_error.
Fields§
§row: u641-indexed record number. For CSV the header is record 0 and the first data row is record 1; for JSONL/JSON-array the first object is record 1. Records that fail mid-parse still take a slot in this sequence.
column: Option<String>Column name when the failure is attributable to a single
cell (CSV typed cell). None for whole-record failures and
JSON-based formats.
raw_sample: StringTruncated raw bytes (or characters) from the offending record. Capped to keep error payloads bounded.
message: StringHuman-readable description of what went wrong.
Implementations§
Source§impl RowParseError
impl RowParseError
Sourcepub fn make_sample(raw: &str) -> String
pub fn make_sample(raw: &str) -> String
Build a raw_sample from the offending text, replacing any
non-printable control characters with · (middle dot) and
truncating at RAW_SAMPLE_MAX_CHARS with a trailing ….
Sourcepub fn make_sample_from_bytes(raw: &[u8]) -> String
pub fn make_sample_from_bytes(raw: &[u8]) -> String
Build a sample from a byte slice, treating non-UTF-8 bytes with the lossy replacement char.
Trait Implementations§
Source§impl Clone for RowParseError
impl Clone for RowParseError
Source§impl Debug for RowParseError
impl Debug for RowParseError
Source§impl Display for RowParseError
impl Display for RowParseError
Source§impl Error for RowParseError
impl Error for RowParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()