#[non_exhaustive]pub enum ParseErrorKind {
UnexpectedEof,
UnexpectedToken {
expected: &'static str,
},
InvalidNumber,
InvalidString(&'static str),
InvalidUtf8,
UnknownField,
UnknownEnumValue,
RecursionLimitExceeded,
DelimiterMismatch,
Internal(&'static str),
}text only.Expand description
The category of textproto parse error.
Variants are all zero-allocation: they hold &'static str or small Copy
payloads. The full diagnostic (including position) lives in ParseError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
Input ended while a value was still being parsed.
UnexpectedToken
A token appeared where the grammar didn’t permit it.
The expected string describes what the parser wanted — e.g.
"field name", "scalar value", "',' or ']'".
InvalidNumber
A number literal couldn’t be interpreted as the target numeric type (out of range, wrong base, or float where integer expected).
InvalidString(&'static str)
A string literal contained a malformed escape sequence.
Holds the reason produced by the unescaper — e.g.
"invalid \\x escape", "invalid unicode escape".
InvalidUtf8
A string field’s unescaped bytes were not valid UTF-8.
bytes fields use TextDecoder::read_bytes
and do not produce this error.
UnknownField
A field name appeared that the message’s merge_text does not
recognise, and the caller did not ask to skip unknowns.
UnknownEnumValue
An enum variant name was not recognised, or a closed enum received a numeric value outside its defined set.
Open (proto3) enums accept any in-range integer and never produce this error for numeric input. Closed (proto2) enums reject unknown numbers.
RecursionLimitExceeded
Message nesting exceeded RECURSION_LIMIT.
DelimiterMismatch
A message was opened with { but closed with >, or vice versa.
Textproto allows either {...} or <...> around sub-messages, but
the pair must match.
Internal(&'static str)
An internal invariant was violated during parsing.
This indicates a bug in buffa, not a problem with the input. Please report it if encountered.
Trait Implementations§
Source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
Source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
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 ParseErrorKind
impl Debug for ParseErrorKind
Source§impl Display for ParseErrorKind
impl Display for ParseErrorKind
impl Eq for ParseErrorKind
Source§impl Error for ParseErrorKind
impl Error for ParseErrorKind
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()
Source§impl PartialEq for ParseErrorKind
impl PartialEq for ParseErrorKind
Source§fn eq(&self, other: &ParseErrorKind) -> bool
fn eq(&self, other: &ParseErrorKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ParseErrorKind
Auto Trait Implementations§
impl Freeze for ParseErrorKind
impl RefUnwindSafe for ParseErrorKind
impl Send for ParseErrorKind
impl Sync for ParseErrorKind
impl Unpin for ParseErrorKind
impl UnsafeUnpin for ParseErrorKind
impl UnwindSafe for ParseErrorKind
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more