Enum llama_cpp_2::grammar::GrammarParseError
source · pub enum GrammarParseError {
UnexpectedEndOfInput {
parse_stage: &'static str,
},
UnexpectedCharsAfterName {
name: String,
chars: String,
},
ExpectedEqualsAfterName {
name: String,
},
MissingClosingBracketInNestedRule {
name: String,
},
ExpectedRuleBeforePostfixOperator {
name: String,
},
IncorrectHexSize {
expected_size: usize,
actual: String,
},
UnknownEscape {
escape: char,
},
ParseHexError {
error: ParseIntError,
string: String,
},
MissingSpaceAfterName {
rest: String,
},
ExtraneousCharsAfterRule(ExtraneousCharsAfterRule),
}
Expand description
There was an error parsing the grammar.
Variants§
UnexpectedEndOfInput
Fields
There was an unexpected end of input.
UnexpectedCharsAfterName
There was unexpected characters after a rule name but before “::=”. There can only be whitespace.
ExpectedEqualsAfterName
There was no “::=” after a rule name.
MissingClosingBracketInNestedRule
There was no closing bracket in a nested rule.
ExpectedRuleBeforePostfixOperator
There was no rule before a postfix operator.
IncorrectHexSize
There was an incorrect hex size.
UnknownEscape
An unknown escape character was found.
ParseHexError
Fields
§
error: ParseIntError
the error that occurred when parsing the hex
Failed to parse hex from a string.
MissingSpaceAfterName
there was not space after the name
ExtraneousCharsAfterRule(ExtraneousCharsAfterRule)
There was unexpected characters after the rule.
Trait Implementations§
source§impl Debug for GrammarParseError
impl Debug for GrammarParseError
source§impl Display for GrammarParseError
impl Display for GrammarParseError
source§impl Error for GrammarParseError
impl Error for GrammarParseError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<GrammarParseError> for LlamaGrammarFromStrError
impl From<GrammarParseError> for LlamaGrammarFromStrError
source§fn from(source: GrammarParseError) -> Self
fn from(source: GrammarParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for GrammarParseError
impl Send for GrammarParseError
impl Sync for GrammarParseError
impl Unpin for GrammarParseError
impl UnwindSafe for GrammarParseError
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
Mutably borrows from an owned value. Read more