#[non_exhaustive]pub enum ParseSingleError {
Show 24 variants
InvalidRegex {
span: SourceSpan,
message: String,
},
InvalidGlob {
span: SourceSpan,
error: GlobConstructError,
},
BannedPredicate {
kind: FiltersetKind,
span: SourceSpan,
reason: BannedPredicateReason,
},
InvalidRegexWithoutMessage(SourceSpan),
ExpectedCloseRegex(SourceSpan),
InvalidOrOperator(SourceSpan),
InvalidAndOperator(SourceSpan),
UnexpectedArgument(SourceSpan),
UnexpectedComma(SourceSpan),
InvalidString(SourceSpan),
ExpectedOpenParenthesis(SourceSpan),
ExpectedCloseParenthesis(SourceSpan),
InvalidEscapeCharacter(SourceSpan),
ExpectedExpr(SourceSpan),
ExprFoundBinaryOp {
op: &'static str,
suggest: &'static str,
span: SourceSpan,
},
ExprFoundUnaryOp {
op: &'static str,
suggest: &'static str,
span: SourceSpan,
},
ExpectedEndOfExpression(SourceSpan),
NoPackageMatch(SourceSpan),
NoGroupMatch(SourceSpan),
NoBinaryIdMatch(SourceSpan),
NoBinaryNameMatch(SourceSpan),
InvalidPlatformArgument(SourceSpan),
UnsupportedExpression(SourceSpan),
Unknown,
}Expand description
An individual error that occurred while parsing a filterset.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRegex
An invalid regex was encountered.
Fields
span: SourceSpanThe part of the input that failed.
InvalidGlob
An invalid glob pattern was encountered.
Fields
span: SourceSpanThe part of the input that failed.
error: GlobConstructErrorThe underlying error.
BannedPredicate
A banned predicate was encountered.
Fields
kind: FiltersetKindThe kind of expression.
span: SourceSpanThe span of the banned predicate.
reason: BannedPredicateReasonThe reason why the predicate is banned.
InvalidRegexWithoutMessage(SourceSpan)
An invalid regex was encountered but we couldn’t determine a better error message.
ExpectedCloseRegex(SourceSpan)
A regex string was not closed.
InvalidOrOperator(SourceSpan)
An unexpected OR operator was found.
InvalidAndOperator(SourceSpan)
An unexpected AND operator was found.
UnexpectedArgument(SourceSpan)
An unexpected argument was found.
UnexpectedComma(SourceSpan)
An unexpected comma was found.
InvalidString(SourceSpan)
An invalid string was found.
ExpectedOpenParenthesis(SourceSpan)
An open parenthesis ( was expected but not found.
ExpectedCloseParenthesis(SourceSpan)
A close parenthesis ) was expected but not found.
InvalidEscapeCharacter(SourceSpan)
An invalid escape character was found.
ExpectedExpr(SourceSpan)
An expression was expected in this position but not found.
ExprFoundBinaryOp
A binary operator keyword or sigil was used in a position where an expression was expected.
Filterset binary operators are infix operators, not prefix ones. The
suggest field is the canonical recognized form of the operator, used
to nudge the user toward valid syntax in a single step: for AND it’s
and, for && it’s &, and so on.
Fields
span: SourceSpanThe span of the operator.
ExprFoundUnaryOp
A unary-operator-shaped token was used in a syntax filtersets don’t
recognize, e.g. uppercase NOT instead of not.
The suggest field is the canonical recognized form.
Fields
span: SourceSpanThe span of the token.
ExpectedEndOfExpression(SourceSpan)
The expression was expected to end here but some extra text was found.
NoPackageMatch(SourceSpan)
This matcher didn’t match any packages.
NoGroupMatch(SourceSpan)
This matcher didn’t match any test groups.
NoBinaryIdMatch(SourceSpan)
This matcher didn’t match any binary IDs.
NoBinaryNameMatch(SourceSpan)
This matcher didn’t match any binary names.
InvalidPlatformArgument(SourceSpan)
Expected “host” or “target” for a platform() predicate.
UnsupportedExpression(SourceSpan)
Contained an unsupported expression.
Unknown
An unknown parsing error occurred.
Trait Implementations§
Source§impl Clone for ParseSingleError
impl Clone for ParseSingleError
Source§fn clone(&self) -> ParseSingleError
fn clone(&self) -> ParseSingleError
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 ParseSingleError
impl Debug for ParseSingleError
Source§impl Diagnostic for ParseSingleError
impl Diagnostic for ParseSingleError
Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeSource§fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
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.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic.Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Diagnostics.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for ParseSingleError
impl Display for ParseSingleError
Source§impl Error for ParseSingleError
impl Error for ParseSingleError
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 ParseSingleError
impl PartialEq for ParseSingleError
Source§fn eq(&self, other: &ParseSingleError) -> bool
fn eq(&self, other: &ParseSingleError) -> bool
self and other values to be equal, and is used by ==.impl Eq for ParseSingleError
impl StructuralPartialEq for ParseSingleError
Auto Trait Implementations§
impl Freeze for ParseSingleError
impl RefUnwindSafe for ParseSingleError
impl Send for ParseSingleError
impl Sync for ParseSingleError
impl Unpin for ParseSingleError
impl UnsafeUnpin for ParseSingleError
impl UnwindSafe for ParseSingleError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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 more