pub struct ParseError {
pub message: String,
pub token_pos: usize,
}Fields§
§message: String§token_pos: usizeIndex into the token stream where parsing tripped. Not a byte offset.
v7.39 (read01 round 95) — the byte/char position is NOT stored here: a
field would grow every Result<_, ParseError> slot on the deeply
recursive parse stack and tip the nesting-budget frame cliff. PG’s
1-based char position is recovered on the cold error path by
syntax_error_position, which re-tokenizes to map this token index.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
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 ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
v7.39 (round 322/V24) — the message ALONE. It used to be prefixed
with parse error at token #N: , which PG has no equivalent of:
the message bodies are already PG’s verbatim (LIMIT must not be negative, invalid input syntax for type bigint: "abc"), and the
prefix was SPG’s internal token index leaking into every one of
them. token_pos stays a field — the wire recovers PG’s 1-based
character position from it for the ErrorResponse P.