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§fn clone(&self) -> RowParseError
fn clone(&self) -> RowParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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()
Auto Trait Implementations§
impl Freeze for RowParseError
impl RefUnwindSafe for RowParseError
impl Send for RowParseError
impl Sync for RowParseError
impl Unpin for RowParseError
impl UnsafeUnpin for RowParseError
impl UnwindSafe for RowParseError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more