#[non_exhaustive]pub enum ExprError {
Show 16 variants
NotAnExpression,
Unclosed,
Empty,
MissingSource,
UnterminatedString {
quote: char,
},
InvalidFunctionName {
name: String,
},
UnclosedCall {
function: String,
},
InvalidArgument {
function: String,
position: usize,
cause: Box<ExprError>,
},
MissingNamespace {
text: String,
},
NotAReference {
text: String,
},
UnknownNamespace {
namespace: String,
},
MaterialNamespace {
namespace: String,
name: String,
},
EmptyName {
namespace: String,
},
InvalidName {
name: String,
},
InvalidProperty {
property: String,
},
InvalidPipeStage {
stage: String,
},
}Expand description
Why a ${...} occurrence is not a usable expression.
Each variant names one decision the parser made, so a caller can tell an
unknown namespace from a malformed name without reading the message text.
Display renders the sentence a diagnostic shows.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAnExpression
The text is not wrapped in ${ and }.
Unclosed
Nothing closes the occurrence.
Empty
The braces hold nothing.
MissingSource
A pipeline has stages but nothing to compute them from.
UnterminatedString
A quoted string never closes.
InvalidFunctionName
The text before a ( is not a function name.
UnclosedCall
A function call never closes its parentheses.
InvalidArgument
One argument to a function call is not an expression.
Fields
MissingNamespace
A name stands on its own, with no namespace in front of it.
NotAReference
The text is neither a literal nor the start of a reference.
UnknownNamespace
The namespace is not one this DSL has.
MaterialNamespace
A reference names material, which is not a namespace.
Fields
EmptyName
Nothing follows the namespace.
InvalidName
The name is not an identifier.
InvalidProperty
The property is not an identifier.
InvalidPipeStage
A pipe stage is not a function name.
Implementations§
Trait Implementations§
impl Eq for ExprError
Source§impl Error for ExprError
impl Error for ExprError
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()
impl StructuralPartialEq for ExprError
Auto Trait Implementations§
impl Freeze for ExprError
impl RefUnwindSafe for ExprError
impl Send for ExprError
impl Sync for ExprError
impl Unpin for ExprError
impl UnsafeUnpin for ExprError
impl UnwindSafe for ExprError
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.