Enum ruma_signatures::JsonError [−][src]
#[non_exhaustive] pub enum JsonError { NotOfType { target: String, of_type: JsonType, }, NotMultiplesOfType { target: String, of_type: JsonType, }, JsonFieldMissingFromObject(String), JsonKeyMissing { for_target: String, type_of: String, with_key: String, }, CanonicalJson(CanonicalJsonError), Serde(Error), }
Expand description
All errors related to JSON validation/parsing.
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.
Signals that target
is not of type of_type
(JsonType
).
Show fields
Like JsonError::NotOfType
, only called when the target
is a multiple;
array, set, etc.
Show fields
JsonFieldMissingFromObject(String)
Signals that a specific field is missing from a JSON object.
Signals a key missing from a JSON object.
Note that this is different from JsonError::JsonFieldMissingFromObject
,
this error talks about an expected identifying key ("ed25519:abcd"
)
missing from a target, where the key has a specific “type”/name.
Show fields
CanonicalJson(CanonicalJsonError)
A derivative error from ruma_serde::CanonicalJsonError
,
captured here.
Serde(Error)
A more generic JSON error from serde_json
.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for JsonError
impl !UnwindSafe for JsonError