pub struct Refused {
pub span: Span,
pub reason: &'static str,
}Expand description
Why a value isn’t data, and where it stopped being.
reason is one of:
| Reason | What it was |
|---|---|
not-a-literal | a name, a call, an operator, a function: anything that would have to run |
substitution | a template’s ${…}; the span is the expression in it |
bigint | a BigInt, which JSON has no way to write |
regexp | a regular expression literal |
computed-key | {[k]: v} |
method | a method, getter or setter |
spread | ...x in an array, an object or arguments |
proto | __proto__: v, which sets the prototype rather than a key |
not-a-number | -, + or ! on something other than a number (or, for !, a boolean) |
undefined | the whole value is undefined, which JSON can’t hold |
lone-surrogate | a string with half a surrogate pair, which a Rust string can’t hold |
parameters | a Nuxt function’s parameter that isn’t a plain name |
function-body | a Nuxt function that does more than return a value |
too-large | substituting arguments would copy far more than the source holds |
json-syntax | JSON text that JSON.parse would reject |
too-deep | JSON nested deeper than DEFAULT_MAX_DEPTH |
Fields§
§span: Span§reason: &'static strTrait Implementations§
impl Copy for Refused
impl Eq for Refused
Source§impl Error for Refused
impl Error for Refused
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()
impl StructuralPartialEq for Refused
Auto Trait Implementations§
impl Forget for Refused
impl Freeze for Refused
impl Move for Refused
impl RefUnwindSafe for Refused
impl Send for Refused
impl Sync for Refused
impl Unpin for Refused
impl UnsafeUnpin for Refused
impl UnwindSafe for Refused
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