pub enum JcsDecodeError<R = JsonResource, Q = usize>{
Decode(JsonDecodeError<R, Q>),
DuplicateKey {
line: usize,
column: usize,
},
MaterializationDepthLimit {
limit: usize,
line: usize,
column: usize,
},
}Expand description
JCS decoding failure with explicit duplicate-key handling.
§Type Parameters
R- Resource identity used by the wrapped budget error.Q- Quantity representation used for resource accounting.
§Examples
use qubit_json::decode::{JcsDecodeError, JcsDecoder};
let error = JcsDecoder::unlimited()
.decode_str(r#"{"x":1,"x":2}"#)
.expect_err("duplicate keys must be rejected");
assert!(matches!(error, JcsDecodeError::DuplicateKey { .. }));Variants§
Decode(JsonDecodeError<R, Q>)
An input, UTF-8, budget, or lexical admission failure.
Tuple Fields
§
0: JsonDecodeError<R, Q>Shared decode error with stable category and input diagnostics.
DuplicateKey
An object contains two keys equal after JSON escape decoding.
Fields
MaterializationDepthLimit
Historical compatibility variant; the shared builder no longer emits it.
Trait Implementations§
Source§impl<R: Clone, Q> Clone for JcsDecodeError<R, Q>
impl<R: Clone, Q> Clone for JcsDecodeError<R, Q>
Source§impl<R: Debug, Q> Debug for JcsDecodeError<R, Q>
impl<R: Debug, Q> Debug for JcsDecodeError<R, Q>
Source§impl<R, Q> Display for JcsDecodeError<R, Q>where
R: Debug,
Q: ResourceQuantity,
impl<R, Q> Display for JcsDecodeError<R, Q>where
R: Debug,
Q: ResourceQuantity,
Source§impl<R, Q> Error for JcsDecodeError<R, Q>where
R: Debug + 'static,
Q: ResourceQuantity + 'static,
impl<R, Q> Error for JcsDecodeError<R, Q>where
R: Debug + 'static,
Q: ResourceQuantity + 'static,
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the wrapped decoding error for the standard error chain.
§Returns
The wrapped decode error for Decode, or None for the JCS-specific
duplicate-key and construction-depth failures.
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<R, Q> From<JsonDecodeError<R, Q>> for JcsDecodeError<R, Q>
impl<R, Q> From<JsonDecodeError<R, Q>> for JcsDecodeError<R, Q>
Auto Trait Implementations§
impl<R = JsonResource, Q = usize> !RefUnwindSafe for JcsDecodeError<R, Q>
impl<R = JsonResource, Q = usize> !UnwindSafe for JcsDecodeError<R, Q>
impl<R, Q> Forget for JcsDecodeError<R, Q>
impl<R, Q> Freeze for JcsDecodeError<R, Q>where
JsonDecodeError<R, Q>: Freeze,
impl<R, Q> Send for JcsDecodeError<R, Q>where
JsonDecodeError<R, Q>: Send,
impl<R, Q> Sync for JcsDecodeError<R, Q>where
JsonDecodeError<R, Q>: Sync,
impl<R, Q> Unpin for JcsDecodeError<R, Q>where
JsonDecodeError<R, Q>: Unpin,
impl<R, Q> UnsafeUnpin for JcsDecodeError<R, Q>where
JsonDecodeError<R, Q>: UnsafeUnpin,
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