Enum nu_parser::ParseError
source · [−]pub enum ParseError {
Show 45 variants
ExtraTokens(Span),
ExtraPositional(String, Span),
RequiredAfterOptional(String, Span),
UnexpectedEof(String, Span),
Unclosed(String, Span),
Expected(String, Span),
Mismatch(String, String, Span),
UnsupportedOperation(Span, Span, Type, Span, Type),
ExpectedKeyword(String, Span),
UnexpectedKeyword(String, Span),
BuiltinCommandInPipeline(String, Span),
IncorrectValue(String, Span, String),
MultipleRestParams(Span),
VariableNotFound(Span),
VariableNotValid(Span),
ModuleNotFound(Span),
NotFound(Span),
DuplicateCommandDef(Span),
UnknownCommand(Span),
NonUtf8(Span),
UnknownFlag(String, String, Span),
UnknownType(Span),
MissingFlagParam(String, Span),
ShortFlagBatchCantTakeArg(Span),
MissingPositional(String, Span, String),
KeywordMissingArgument(String, String, Span),
MissingType(Span),
TypeMismatch(Type, Type, Span),
MissingRequiredFlag(String, Span),
IncompleteMathExpression(Span),
UnknownState(String, Span),
InternalError(String, Span),
IncompleteParser(Span),
RestNeedsName(Span),
ParameterMismatchType(String, String, String, Span),
ExtraColumns(usize, Span),
MissingColumns(usize, Span),
AssignmentMismatch(String, String, Span),
MissingImportPattern(Span),
WrongImportPattern(Span),
ExportNotFound(Span),
SourcedFileNotFound(String, Span),
RegisteredFileNotFound(String, Span),
FileNotFound(String, Span),
LabeledError(String, String, Span),
}
Variants
ExtraTokens(Span)
The parser encountered unexpected tokens, when the code should have finished. You should remove these or finish adding what you intended to add.
ExtraPositional(String, Span)
RequiredAfterOptional(String, Span)
UnexpectedEof(String, Span)
Unclosed(String, Span)
Expected(String, Span)
Mismatch(String, String, Span)
UnsupportedOperation(Span, Span, Type, Span, Type)
ExpectedKeyword(String, Span)
UnexpectedKeyword(String, Span)
BuiltinCommandInPipeline(String, Span)
IncorrectValue(String, Span, String)
MultipleRestParams(Span)
VariableNotFound(Span)
VariableNotValid(Span)
ModuleNotFound(Span)
NotFound(Span)
DuplicateCommandDef(Span)
UnknownCommand(Span)
NonUtf8(Span)
UnknownFlag(String, String, Span)
UnknownType(Span)
MissingFlagParam(String, Span)
ShortFlagBatchCantTakeArg(Span)
MissingPositional(String, Span, String)
KeywordMissingArgument(String, String, Span)
MissingType(Span)
TypeMismatch(Type, Type, Span)
MissingRequiredFlag(String, Span)
IncompleteMathExpression(Span)
UnknownState(String, Span)
InternalError(String, Span)
IncompleteParser(Span)
RestNeedsName(Span)
ParameterMismatchType(String, String, String, Span)
ExtraColumns(usize, Span)
MissingColumns(usize, Span)
AssignmentMismatch(String, String, Span)
MissingImportPattern(Span)
WrongImportPattern(Span)
ExportNotFound(Span)
SourcedFileNotFound(String, Span)
RegisteredFileNotFound(String, Span)
FileNotFound(String, Span)
LabeledError(String, String, Span)
Implementations
sourceimpl ParseError
impl ParseError
Trait Implementations
sourceimpl Clone for ParseError
impl Clone for ParseError
sourcefn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ParseError
impl Debug for ParseError
sourceimpl Diagnostic for ParseError
impl Diagnostic for ParseError
sourcefn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Unique diagnostic code that can be used to look up more information
about this Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine. Read more
sourcefn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn help<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Additional help text related to this Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue? Read more
sourcefn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan>>>
Labels to apply to this Diagnostic
’s Diagnostic::source_code
sourcefn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
URL to visit for a more detailed explanation/help about this
Diagnostic
. Read more
sourcefn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandler
s to change the display format
of this diagnostic. Read more
sourcefn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this Diagnostic
’s Diagnostic::labels
to.
Additional related Diagnostic
s.
sourceimpl Display for ParseError
impl Display for ParseError
sourceimpl Error for ParseError
impl Error for ParseError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more