pub enum RenderError {
Show 13 variants
MissingPath {
path: String,
key: Option<String>,
span: Span,
},
TypeMismatch {
expected: &'static str,
got: String,
span: Span,
},
DivideByZero {
span: Span,
},
ArithmeticOverflow {
span: Span,
},
WhenNoMatch {
span: Span,
},
UnknownMethod {
method: String,
on_type: String,
span: Span,
},
ArityMismatch {
method: String,
expected: usize,
got: usize,
span: Span,
},
IndexOutOfBounds {
index: i64,
length: usize,
span: Span,
},
NotIndexable {
got: String,
span: Span,
},
LambdaExpected {
span: Span,
},
ValueTooDeep {
limit: usize,
span: Span,
},
DuplicateKey {
key: String,
span: Span,
},
Deserialize(String),
}Expand description
Why a template could not be rendered.
Variants§
MissingPath
A path reached a field that isn’t there; key is the missing field.
TypeMismatch
A value has the wrong type for what was done with it.
DivideByZero
Division or remainder by zero.
ArithmeticOverflow
A number left the range it can represent.
WhenNoMatch
No when branch matched and there was no else.
UnknownMethod
A method that doesn’t exist on the value’s type.
ArityMismatch
A method or function called with the wrong number of arguments.
IndexOutOfBounds
An array index outside the array.
NotIndexable
[...] on a value that isn’t an array or object.
LambdaExpected
A method that takes a lambda was given something else.
ValueTooDeep
A value nests deeper than limit levels.
DuplicateKey
An object literal produced the same key twice.
Deserialize(String)
The rendered value could not be turned into the requested Rust type.
Implementations§
Trait Implementations§
Source§impl Clone for RenderError
impl Clone for RenderError
Source§impl Debug for RenderError
impl Debug for RenderError
Source§impl Display for RenderError
impl Display for RenderError
Source§impl Error for RenderError
impl Error for RenderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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<RenderError> for EvalError
impl From<RenderError> for EvalError
Source§fn from(e: RenderError) -> Self
fn from(e: RenderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RenderError
impl RefUnwindSafe for RenderError
impl Send for RenderError
impl Sync for RenderError
impl Unpin for RenderError
impl UnsafeUnpin for RenderError
impl UnwindSafe for RenderError
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