#[non_exhaustive]pub enum JsonIpldError {
DepthExceeded {
cap: usize,
},
UnsignedOverflow {
value: String,
},
UnsupportedNumber {
value: String,
},
}Expand description
Failure modes for json_to_ipld.
Deliberately coarse-grained; each variant carries enough detail
for a caller to render a user-facing error without string-parsing
the Display output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DepthExceeded
The input exceeded IPLD_MAX_DEPTH levels of nesting.
Fields
cap: usizeThe cap that was exceeded; always equals IPLD_MAX_DEPTH.
UnsignedOverflow
A JSON Number was an unsigned integer greater than
i64::MAX. Such values cannot round-trip through
Ipld::Integer (which is i128 but DAG-CBOR encodes only
i64 / u64) without ambiguity; the old “demote to
Ipld::Float” path silently lost precision above 2^53.
UnsupportedNumber
A JSON Number was neither an i64, a u64, nor a finite
f64. In practice this cannot happen from serde_json today
(the Number variants exhaust the space) but is kept as a
defensive catch-all.
Trait Implementations§
Source§impl Debug for JsonIpldError
impl Debug for JsonIpldError
Source§impl Display for JsonIpldError
impl Display for JsonIpldError
Source§impl Error for JsonIpldError
impl Error for JsonIpldError
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()