pub enum JsonDeserializationError {
Show 16 variants
Serde(Error),
ExprParseError(ParseError),
EntityParseError(ParseError),
ExtnParseError(ParseError),
RestrictedExpressionError(RestrictedExpressionError),
ExtensionsError(ExtensionsError),
ExpectedLiteralEntityRef {
ctx: JsonDeserializationErrorContext,
got: Box<Expr>,
},
ExpectedExtnValue {
ctx: JsonDeserializationErrorContext,
got: Box<Expr>,
},
ExpectedContextToBeRecord {
got: Box<RestrictedExpr>,
},
ImpliedConstructorNotFound {
return_type: Box<SchemaType>,
arg_type: Box<SchemaType>,
},
UnexpectedEntityAttr {
uid: EntityUID,
attr: SmolStr,
},
UnexpectedRecordAttr {
ctx: JsonDeserializationErrorContext,
record_attr: SmolStr,
},
MissingRequiredEntityAttr {
uid: EntityUID,
attr: SmolStr,
},
MissingRequiredRecordAttr {
ctx: JsonDeserializationErrorContext,
record_attr: SmolStr,
},
TypeMismatch {
ctx: JsonDeserializationErrorContext,
expected: Box<SchemaType>,
actual: Box<SchemaType>,
},
HeterogeneousSet {
ctx: JsonDeserializationErrorContext,
ty1: Box<SchemaType>,
ty2: Box<SchemaType>,
},
}Expand description
Errors thrown during deserialization from JSON
Variants§
Serde(Error)
Error thrown by serde_json
ExprParseError(ParseError)
Contents of an __expr escape failed to parse as a Cedar expression.
__expr is deprecated (starting with the 1.2 release), and once it is
removed, this error will also be removed.
EntityParseError(ParseError)
Contents of an __entity escape failed to parse as an entity reference
ExtnParseError(ParseError)
Function name in an __extn escape failed to parse as an extension function name
RestrictedExpressionError(RestrictedExpressionError)
Restricted expression error
ExtensionsError(ExtensionsError)
Error thrown by an operation on Extensions
ExpectedLiteralEntityRef
A field that needs to be a literal entity reference, was some other JSON value
Fields
ctx: JsonDeserializationErrorContextContext of this error
ExpectedExtnValue
A field that needs to be an extension value, was some other JSON value
Fields
ctx: JsonDeserializationErrorContextContext of this error
ExpectedContextToBeRecord
Contexts need to be records, but we got some other JSON value
Fields
got: Box<RestrictedExpr>Expression we got instead
ImpliedConstructorNotFound
Schema-based parsing needed an implicit extension constructor, but no suitable constructor was found
Fields
return_type: Box<SchemaType>return type of the constructor we were looking for
arg_type: Box<SchemaType>argument type of the constructor we were looking for
UnexpectedEntityAttr
During schema-based parsing, encountered this attribute on this entity, but that attribute shouldn’t exist on entities of this type
Fields
UnexpectedRecordAttr
During schema-based parsing, encountered this attribute on a record, but that attribute shouldn’t exist on that record
Fields
ctx: JsonDeserializationErrorContextContext of this error
MissingRequiredEntityAttr
During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed
Fields
MissingRequiredRecordAttr
During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed
Fields
ctx: JsonDeserializationErrorContextContext of this error
TypeMismatch
During schema-based parsing, the given attribute on the given entity had a different type than the schema indicated to expect
Fields
ctx: JsonDeserializationErrorContextContext of this error
expected: Box<SchemaType>Type which was expected
actual: Box<SchemaType>Type which was encountered instead
HeterogeneousSet
During schema-based parsing, found a set whose elements don’t all have the same type. This doesn’t match any possible schema.
Fields
ctx: JsonDeserializationErrorContextContext of this error
ty1: Box<SchemaType>First element type which was found
ty2: Box<SchemaType>Second element type which was found
Trait Implementations§
Source§impl Debug for JsonDeserializationError
impl Debug for JsonDeserializationError
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<Error> for JsonDeserializationError
impl From<Error> for JsonDeserializationError
Source§impl From<ExtensionsError> for JsonDeserializationError
impl From<ExtensionsError> for JsonDeserializationError
Source§fn from(source: ExtensionsError) -> Self
fn from(source: ExtensionsError) -> Self
Source§impl From<JsonDeserializationError> for EntitiesError
impl From<JsonDeserializationError> for EntitiesError
Source§fn from(source: JsonDeserializationError) -> Self
fn from(source: JsonDeserializationError) -> Self
Source§impl From<JsonDeserializationError> for EstToAstError
impl From<JsonDeserializationError> for EstToAstError
Source§fn from(source: JsonDeserializationError) -> Self
fn from(source: JsonDeserializationError) -> Self
Source§impl From<RestrictedExpressionError> for JsonDeserializationError
impl From<RestrictedExpressionError> for JsonDeserializationError
Source§fn from(source: RestrictedExpressionError) -> Self
fn from(source: RestrictedExpressionError) -> Self
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