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

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§got: Box<Expr>

the expression we got instead

A field that needs to be a literal entity reference, was some other JSON value

§

ExpectedExtnValue

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§got: Box<Expr>

the expression we got instead

A field that needs to be an extension value, was some other JSON value

§

ExpectedContextToBeRecord

Fields

§got: Box<RestrictedExpr>

Expression we got instead

Contexts need to be records, but we got some other JSON value

§

ImpliedConstructorNotFound

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

Schema-based parsing needed an implicit extension constructor, but no suitable constructor was found

§

UnexpectedEntityAttr

Fields

§uid: EntityUID

Entity that had the unexpected attribute

§attr: SmolStr

Name of the attribute that was unexpected

During schema-based parsing, encountered this attribute on this entity, but that attribute shouldn’t exist on entities of this type

§

UnexpectedRecordAttr

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§record_attr: SmolStr

Name of the (Record) attribute which was unexpected

During schema-based parsing, encountered this attribute on a record, but that attribute shouldn’t exist on that record

§

MissingRequiredEntityAttr

Fields

§uid: EntityUID

Entity that is missing a required attribute

§attr: SmolStr

Name of the attribute which was expected

During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed

§

MissingRequiredRecordAttr

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§record_attr: SmolStr

Name of the (Record) attribute which was expected

During schema-based parsing, didn’t encounter this attribute of a record, but that attribute should have existed

§

TypeMismatch

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§expected: Box<SchemaType>

Type which was expected

§actual: Box<SchemaType>

Type which was encountered instead

During schema-based parsing, the given attribute on the given entity had a different type than the schema indicated to expect

§

HeterogeneousSet

Fields

§ctx: JsonDeserializationErrorContext

Context of this error

§ty1: Box<SchemaType>

First element type which was found

§ty2: Box<SchemaType>

Second element type which was found

During schema-based parsing, found a set whose elements don’t all have the same type. This doesn’t match any possible schema.

Trait Implementations§

source§

impl Debug for JsonDeserializationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for JsonDeserializationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for JsonDeserializationError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for JsonDeserializationError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<ExtensionsError> for JsonDeserializationError

source§

fn from(source: ExtensionsError) -> Self

Converts to this type from the input type.
source§

impl From<JsonDeserializationError> for EntitiesError

source§

fn from(source: JsonDeserializationError) -> Self

Converts to this type from the input type.
source§

impl From<JsonDeserializationError> for EstToAstError

source§

fn from(source: JsonDeserializationError) -> Self

Converts to this type from the input type.
source§

impl From<RestrictedExpressionError> for JsonDeserializationError

source§

fn from(source: RestrictedExpressionError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.