#[non_exhaustive]pub enum JcsError {
NonFiniteNumber,
DuplicateKey(String),
Serde(Error),
}Expand description
Errors that can occur during canonicalization.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NonFiniteNumber
JSON contained a non-finite number (NaN or Infinity); RFC 8785 forbids these.
DuplicateKey(String)
Reserved. Duplicate object keys are not detected here: this
module canonicalizes an already-parsed serde_json::Value, and
serde_json (built with preserve_order) collapses duplicate
keys last-wins at parse time, before canonicalization. Since both
signer and verifier canonicalize the same parsed value, there is
no signature split-brain (RFC 8785 operates on parsed JSON). This
variant is retained for API stability and is never constructed by
canonicalize; reject duplicate keys at a raw-bytes
deserialization step if a deployment’s threat model requires it.
Serde(Error)
Underlying serde error.
Trait Implementations§
Source§impl Error for JcsError
impl Error for JcsError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for JcsError
impl !UnwindSafe for JcsError
impl Freeze for JcsError
impl Send for JcsError
impl Sync for JcsError
impl Unpin for JcsError
impl UnsafeUnpin for JcsError
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