#[non_exhaustive]pub enum SchemaError {
Show 25 variants
JsonSerialization(JsonSerializationError),
JsonDeserialization(JsonDeserializationError),
ActionTransitiveClosure(ActionTransitiveClosureError),
EntityTypeTransitiveClosure(EntityTypeTransitiveClosureError),
UnsupportedFeature(UnsupportedFeatureError),
UndeclaredEntityTypes(UndeclaredEntityTypesError),
TypeNotDefined(TypeNotDefinedError),
ActionNotDefined(ActionNotDefinedError),
TypeShadowing(TypeShadowingError),
ActionShadowing(ActionShadowingError),
DuplicateEntityType(DuplicateEntityTypeError),
DuplicateAction(DuplicateActionError),
DuplicateCommonType(DuplicateCommonTypeError),
CycleInActionHierarchy(CycleInActionHierarchyError),
CycleInCommonTypeReferences(CycleInCommonTypeReferencesError),
ActionEntityTypeDeclared(ActionEntityTypeDeclaredError),
ContextOrShapeNotRecord(ContextOrShapeNotRecordError),
ActionAttributesContainEmptySet(ActionAttributesContainEmptySetError),
UnsupportedActionAttribute(UnsupportedActionAttributeError),
ActionAttrEval(ActionAttrEvalError),
ExprEscapeUsed(ExprEscapeUsedError),
UnknownExtensionType(UnknownExtensionTypeError),
ReservedName(ReservedNameError),
CommonTypeInvariantViolation(CommonTypeInvariantViolationError),
ActionInvariantViolation(ActionInvariantViolationError),
}
Expand description
Error when constructing a schema
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
JsonSerialization(JsonSerializationError)
Error thrown by the serde_json
crate during serialization
JsonDeserialization(JsonDeserializationError)
This error is thrown when serde_json
fails to deserialize the JSON
ActionTransitiveClosure(ActionTransitiveClosureError)
Errors occurring while computing or enforcing transitive closure on action hierarchy.
EntityTypeTransitiveClosure(EntityTypeTransitiveClosureError)
Errors occurring while computing or enforcing transitive closure on entity type hierarchy.
UnsupportedFeature(UnsupportedFeatureError)
Error generated when processing a schema file that uses unsupported features
UndeclaredEntityTypes(UndeclaredEntityTypesError)
Undeclared entity type(s) used in the memberOf
field of an entity
type, the appliesTo
fields of an action, or an attribute type in a
context or entity attribute record. Entity types in the error message
are fully qualified, including any implicit or explicit namespaces.
TypeNotDefined(TypeNotDefinedError)
This error occurs when we cannot resolve a typename (because it refers to an entity type or common type that was not defined).
ActionNotDefined(ActionNotDefinedError)
This error occurs when we cannot resolve an action name used in the
memberOf
field of an action (because it refers to an action that was
not defined).
TypeShadowing(TypeShadowingError)
Entity/common type shadowing error. Some shadowing relationships are not allowed for clarity reasons; see RFC 70.
ActionShadowing(ActionShadowingError)
Action shadowing error. Some shadowing relationships are not allowed for clarity reasons; see RFC 70.
DuplicateEntityType(DuplicateEntityTypeError)
Duplicate specifications for an entity type
DuplicateAction(DuplicateActionError)
Duplicate specifications for an action
DuplicateCommonType(DuplicateCommonTypeError)
Duplicate specification for a common type declaration
CycleInActionHierarchy(CycleInActionHierarchyError)
Cycle in the schema’s action hierarchy.
CycleInCommonTypeReferences(CycleInCommonTypeReferencesError)
Cycle in the schema’s common type declarations.
ActionEntityTypeDeclared(ActionEntityTypeDeclaredError)
The schema file included an entity type Action
in the entity type
list. The Action
entity type is always implicitly declared, and it
cannot currently have attributes or be in any groups, so there is no
purposes in adding an explicit entry.
ContextOrShapeNotRecord(ContextOrShapeNotRecordError)
context
or shape
fields are not records
ActionAttributesContainEmptySet(ActionAttributesContainEmptySetError)
An action entity (transitively) has an attribute that is an empty set.
The validator cannot assign a type to an empty set.
This error variant should only be used when PermitAttributes
is enabled.
UnsupportedActionAttribute(UnsupportedActionAttributeError)
An action entity (transitively) has an attribute of unsupported type (ExprEscape
, EntityEscape
or ExtnEscape
).
This error variant should only be used when PermitAttributes
is enabled.
ActionAttrEval(ActionAttrEvalError)
Error when evaluating an action attribute
ExprEscapeUsed(ExprEscapeUsedError)
Error thrown when the schema contains the __expr
escape.
Support for this escape form has been dropped.
UnknownExtensionType(UnknownExtensionTypeError)
The schema used an extension type that the validator doesn’t know about.
ReservedName(ReservedNameError)
The schema used a reserved namespace or typename (as of this writing, just __cedar
).
CommonTypeInvariantViolation(CommonTypeInvariantViolationError)
Could not find a definition for a common type, at a point in the code where internal invariants should guarantee that we would find one.
ActionInvariantViolation(ActionInvariantViolationError)
Could not find a definition for an action, at a point in the code where internal invariants should guarantee that we would find one.
Implementations§
Source§impl SchemaError
impl SchemaError
Sourcepub fn join_nonempty(errs: NonEmpty<SchemaError>) -> SchemaError
pub fn join_nonempty(errs: NonEmpty<SchemaError>) -> SchemaError
Given one or more SchemaError
, collect them into a single SchemaError
.
Due to current structures, some errors may have to be dropped in some cases.
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Diagnostic for SchemaError
impl Diagnostic for SchemaError
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 SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
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<ActionAttrEvalError> for SchemaError
impl From<ActionAttrEvalError> for SchemaError
Source§fn from(source: ActionAttrEvalError) -> SchemaError
fn from(source: ActionAttrEvalError) -> SchemaError
Source§impl From<ActionAttributesContainEmptySetError> for SchemaError
impl From<ActionAttributesContainEmptySetError> for SchemaError
Source§fn from(source: ActionAttributesContainEmptySetError) -> SchemaError
fn from(source: ActionAttributesContainEmptySetError) -> SchemaError
Source§impl From<ActionEntityTypeDeclaredError> for SchemaError
impl From<ActionEntityTypeDeclaredError> for SchemaError
Source§fn from(source: ActionEntityTypeDeclaredError) -> SchemaError
fn from(source: ActionEntityTypeDeclaredError) -> SchemaError
Source§impl From<ActionInvariantViolationError> for SchemaError
impl From<ActionInvariantViolationError> for SchemaError
Source§fn from(source: ActionInvariantViolationError) -> SchemaError
fn from(source: ActionInvariantViolationError) -> SchemaError
Source§impl From<ActionNotDefinedError> for SchemaError
impl From<ActionNotDefinedError> for SchemaError
Source§fn from(source: ActionNotDefinedError) -> SchemaError
fn from(source: ActionNotDefinedError) -> SchemaError
Source§impl From<ActionShadowingError> for SchemaError
impl From<ActionShadowingError> for SchemaError
Source§fn from(source: ActionShadowingError) -> SchemaError
fn from(source: ActionShadowingError) -> SchemaError
Source§impl From<ActionTransitiveClosureError> for SchemaError
impl From<ActionTransitiveClosureError> for SchemaError
Source§fn from(source: ActionTransitiveClosureError) -> SchemaError
fn from(source: ActionTransitiveClosureError) -> SchemaError
Source§impl From<CommonTypeInvariantViolationError> for SchemaError
impl From<CommonTypeInvariantViolationError> for SchemaError
Source§fn from(source: CommonTypeInvariantViolationError) -> SchemaError
fn from(source: CommonTypeInvariantViolationError) -> SchemaError
Source§impl From<ContextOrShapeNotRecordError> for SchemaError
impl From<ContextOrShapeNotRecordError> for SchemaError
Source§fn from(source: ContextOrShapeNotRecordError) -> SchemaError
fn from(source: ContextOrShapeNotRecordError) -> SchemaError
Source§impl From<CycleInActionHierarchyError> for SchemaError
impl From<CycleInActionHierarchyError> for SchemaError
Source§fn from(source: CycleInActionHierarchyError) -> SchemaError
fn from(source: CycleInActionHierarchyError) -> SchemaError
Source§impl From<CycleInCommonTypeReferencesError> for SchemaError
impl From<CycleInCommonTypeReferencesError> for SchemaError
Source§fn from(source: CycleInCommonTypeReferencesError) -> SchemaError
fn from(source: CycleInCommonTypeReferencesError) -> SchemaError
Source§impl From<DuplicateActionError> for SchemaError
impl From<DuplicateActionError> for SchemaError
Source§fn from(source: DuplicateActionError) -> SchemaError
fn from(source: DuplicateActionError) -> SchemaError
Source§impl From<DuplicateCommonTypeError> for SchemaError
impl From<DuplicateCommonTypeError> for SchemaError
Source§fn from(source: DuplicateCommonTypeError) -> SchemaError
fn from(source: DuplicateCommonTypeError) -> SchemaError
Source§impl From<DuplicateEntityTypeError> for SchemaError
impl From<DuplicateEntityTypeError> for SchemaError
Source§fn from(source: DuplicateEntityTypeError) -> SchemaError
fn from(source: DuplicateEntityTypeError) -> SchemaError
Source§impl From<EntityTypeTransitiveClosureError> for SchemaError
impl From<EntityTypeTransitiveClosureError> for SchemaError
Source§fn from(source: EntityTypeTransitiveClosureError) -> SchemaError
fn from(source: EntityTypeTransitiveClosureError) -> SchemaError
Source§impl From<ExprEscapeUsedError> for SchemaError
impl From<ExprEscapeUsedError> for SchemaError
Source§fn from(source: ExprEscapeUsedError) -> SchemaError
fn from(source: ExprEscapeUsedError) -> SchemaError
Source§impl From<JsonDeserializationError> for SchemaError
impl From<JsonDeserializationError> for SchemaError
Source§fn from(source: JsonDeserializationError) -> SchemaError
fn from(source: JsonDeserializationError) -> SchemaError
Source§impl From<JsonSerializationError> for SchemaError
impl From<JsonSerializationError> for SchemaError
Source§fn from(source: JsonSerializationError) -> SchemaError
fn from(source: JsonSerializationError) -> SchemaError
Source§impl From<ReservedNameError> for SchemaError
impl From<ReservedNameError> for SchemaError
Source§fn from(source: ReservedNameError) -> SchemaError
fn from(source: ReservedNameError) -> SchemaError
Source§impl From<SchemaError> for CedarSchemaError
impl From<SchemaError> for CedarSchemaError
Source§fn from(source: SchemaError) -> Self
fn from(source: SchemaError) -> Self
Source§impl From<TypeNotDefinedError> for SchemaError
impl From<TypeNotDefinedError> for SchemaError
Source§fn from(source: TypeNotDefinedError) -> SchemaError
fn from(source: TypeNotDefinedError) -> SchemaError
Source§impl From<TypeShadowingError> for SchemaError
impl From<TypeShadowingError> for SchemaError
Source§fn from(source: TypeShadowingError) -> SchemaError
fn from(source: TypeShadowingError) -> SchemaError
Source§impl From<UndeclaredEntityTypesError> for SchemaError
impl From<UndeclaredEntityTypesError> for SchemaError
Source§fn from(source: UndeclaredEntityTypesError) -> SchemaError
fn from(source: UndeclaredEntityTypesError) -> SchemaError
Source§impl From<UnsupportedActionAttributeError> for SchemaError
impl From<UnsupportedActionAttributeError> for SchemaError
Source§fn from(source: UnsupportedActionAttributeError) -> SchemaError
fn from(source: UnsupportedActionAttributeError) -> SchemaError
Source§impl From<UnsupportedFeatureError> for SchemaError
impl From<UnsupportedFeatureError> for SchemaError
Source§fn from(source: UnsupportedFeatureError) -> SchemaError
fn from(source: UnsupportedFeatureError) -> SchemaError
Auto Trait Implementations§
impl Freeze for SchemaError
impl !RefUnwindSafe for SchemaError
impl Send for SchemaError
impl Sync for SchemaError
impl Unpin for SchemaError
impl !UnwindSafe for SchemaError
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