#[non_exhaustive]pub enum JsonDeserializationError {
Show 17 variants
Serde(JsonError),
ParseEscape(ParseEscape),
RestrictedExpressionError(RestrictedExpressionError),
ExpectedLiteralEntityRef(ExpectedLiteralEntityRef),
ExpectedExtnValue(ExpectedExtnValue),
ActionParentIsNotAction(ActionParentIsNotAction),
MissingImpliedConstructor(MissingImpliedConstructor),
DuplicateKey(DuplicateKey),
EntityAttributeEvaluation(EntityAttrEvaluationError),
EntitySchemaConformance(EntitySchemaConformanceError),
UnexpectedRecordAttr(UnexpectedRecordAttr),
MissingRequiredRecordAttr(MissingRequiredRecordAttr),
TypeMismatch(TypeMismatch),
ExprTag(Box<JsonDeserializationErrorContext>),
Null(Box<JsonDeserializationErrorContext>),
ReservedName(ReservedNameError),
UnsupportedEntityTags,
}
Expand description
Errors thrown during deserialization from JSON
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Serde(JsonError)
Error thrown by the serde_json
crate
ParseEscape(ParseEscape)
Contents of an escape failed to parse.
RestrictedExpressionError(RestrictedExpressionError)
Restricted expression error
ExpectedLiteralEntityRef(ExpectedLiteralEntityRef)
A field that needs to be a literal entity reference, was some other JSON value
ExpectedExtnValue(ExpectedExtnValue)
A field that needs to be an extension value, was some other JSON value
ActionParentIsNotAction(ActionParentIsNotAction)
Parents of actions should be actions, but this action has a non-action parent
MissingImpliedConstructor(MissingImpliedConstructor)
Schema-based parsing needed an implicit extension constructor, but no suitable constructor was found
DuplicateKey(DuplicateKey)
The same key appears two or more times in a single record
EntityAttributeEvaluation(EntityAttrEvaluationError)
Error when evaluating an entity attribute
EntitySchemaConformance(EntitySchemaConformanceError)
During schema-based parsing, encountered an entity which does not conform to the schema.
This error contains the Entity
analogues some of the other errors
listed below, among other things.
UnexpectedRecordAttr(UnexpectedRecordAttr)
During schema-based parsing, encountered this attribute on a record, but that attribute shouldn’t exist on that record
MissingRequiredRecordAttr(MissingRequiredRecordAttr)
During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed
TypeMismatch(TypeMismatch)
During schema-based parsing, found a different type than the schema indicated.
(This is used in all cases except inside entity attributes; type mismatches in
entity attributes are reported as Self::EntitySchemaConformance
. As of
this writing, that means this should only be used for schema-based
parsing of the Context
.)
ExprTag(Box<JsonDeserializationErrorContext>)
Raised when a JsonValue contains the no longer supported __expr
escape
Null(Box<JsonDeserializationErrorContext>)
Raised when the input JSON contains a null
ReservedName(ReservedNameError)
Returned when a name contains __cedar
UnsupportedEntityTags
Never returned as of 4.2.0 (entity tags are now stable), but this error variant not removed because that would be a breaking change on this publicly-exported type.
Trait Implementations§
Source§impl Debug for JsonDeserializationError
impl Debug for JsonDeserializationError
Source§impl Diagnostic for JsonDeserializationError
impl Diagnostic for JsonDeserializationError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moreSource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Diagnostic
s.Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for JsonDeserializationError
impl Display for JsonDeserializationError
Source§impl Error for JsonDeserializationError
impl Error for JsonDeserializationError
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
Source§impl From<EntityAttrEvaluationError> for JsonDeserializationError
impl From<EntityAttrEvaluationError> for JsonDeserializationError
Source§fn from(source: EntityAttrEvaluationError) -> JsonDeserializationError
fn from(source: EntityAttrEvaluationError) -> JsonDeserializationError
Source§impl From<Error> for JsonDeserializationError
impl From<Error> for JsonDeserializationError
Source§fn from(value: Error) -> JsonDeserializationError
fn from(value: Error) -> JsonDeserializationError
Source§impl From<JsonDeserializationError> for ContextJsonError
impl From<JsonDeserializationError> for ContextJsonError
Source§fn from(source: JsonDeserializationError) -> Self
fn from(source: JsonDeserializationError) -> Self
Source§impl From<JsonDeserializationError> for EntitiesError
impl From<JsonDeserializationError> for EntitiesError
Source§fn from(source: JsonDeserializationError) -> EntitiesError
fn from(source: JsonDeserializationError) -> EntitiesError
Source§impl From<JsonError> for JsonDeserializationError
impl From<JsonError> for JsonDeserializationError
Source§fn from(source: JsonError) -> JsonDeserializationError
fn from(source: JsonError) -> JsonDeserializationError
Source§impl From<ReservedNameError> for JsonDeserializationError
impl From<ReservedNameError> for JsonDeserializationError
Source§fn from(source: ReservedNameError) -> JsonDeserializationError
fn from(source: ReservedNameError) -> JsonDeserializationError
Source§impl From<RestrictedExpressionError> for JsonDeserializationError
impl From<RestrictedExpressionError> for JsonDeserializationError
Source§fn from(source: RestrictedExpressionError) -> JsonDeserializationError
fn from(source: RestrictedExpressionError) -> JsonDeserializationError
Auto Trait Implementations§
impl Freeze for JsonDeserializationError
impl !RefUnwindSafe for JsonDeserializationError
impl Send for JsonDeserializationError
impl Sync for JsonDeserializationError
impl Unpin for JsonDeserializationError
impl !UnwindSafe for JsonDeserializationError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more