pub enum ParseErrorKind {
Syntax,
DepthLimit {
limit_name: &'static str,
value: usize,
},
InputTooLarge {
limit_name: &'static str,
value: usize,
},
IdentifierTooLong {
limit_name: &'static str,
value: usize,
},
ValueOutOfRange {
field: &'static str,
constraint: &'static str,
},
UnsupportedToken {
token: String,
},
}Expand description
Categorical kind for a parse error.
Most parse errors are plain Syntax failures; the variants
below carry structured information for the parser-hardening
layer (issue #87) so callers can distinguish DoS-style refusals
from grammar errors without string matching.
Variants§
Syntax
Generic syntax / semantic error.
DepthLimit
Recursion-depth limit exceeded during parsing.
InputTooLarge
Input larger than the configured byte cap.
IdentifierTooLong
Identifier longer than the configured character cap.
ValueOutOfRange
A literal value (integer / float) parsed cleanly but lies
outside the semantic range expected for its slot — e.g.
MAX_SIZE 0, lat = 91.0, K = 0, or a negative integer
where a positive one is required. The structured payload lets
the snapshot/property harness distinguish these from generic
syntax errors without string matching.
Fields
UnsupportedToken
The lexer recognized this token, but the parser does not support it in the current grammar position.
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 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 Eq for ParseErrorKind
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request