pub enum SchemaError {
Show 21 variants
Serde(Error),
ActionTransitiveClosure(Box<TcError<EntityUID>>),
EntityTypeTransitiveClosure(TcError<Name>),
UnsupportedFeature(UnsupportedFeature),
UndeclaredEntityTypes(HashSet<String>),
UndeclaredActions(HashSet<String>),
UndeclaredCommonTypes(HashSet<String>),
DuplicateEntityType(String),
DuplicateAction(String),
DuplicateCommonType(String),
CycleInActionHierarchy(EntityUID),
ParseEntityType(ParseErrors),
ParseNamespace(ParseErrors),
ParseExtensionType(ParseErrors),
ParseCommonType(ParseErrors),
ActionEntityTypeDeclared,
ContextOrShapeNotRecord(ContextOrShape),
ActionAttributesContainEmptySet(EntityUID),
UnsupportedActionAttribute(EntityUID, String),
ActionAttrEval(EntityAttrEvaluationError),
ExprEscapeUsed,
}
Variants§
Serde(Error)
Error thrown by the serde_json
crate during deserialization
ActionTransitiveClosure(Box<TcError<EntityUID>>)
Errors occurring while computing or enforcing transitive closure on action hierarchy.
EntityTypeTransitiveClosure(TcError<Name>)
Errors occurring while computing or enforcing transitive closure on entity type hierarchy.
UnsupportedFeature(UnsupportedFeature)
Error generated when processing a schema file that uses unsupported features
UndeclaredEntityTypes(HashSet<String>)
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.
UndeclaredActions(HashSet<String>)
Undeclared action(s) used in the memberOf
field of an action.
UndeclaredCommonTypes(HashSet<String>)
This error occurs in either of the following cases (see discussion on #477): - undeclared common type(s) appearing in entity or context attributes - common type(s) (declared or not) appearing in declarations of other common types
DuplicateEntityType(String)
Duplicate specifications for an entity type. Argument is the name of the duplicate entity type.
DuplicateAction(String)
Duplicate specifications for an action. Argument is the name of the duplicate action.
DuplicateCommonType(String)
Duplicate specification for a reusable type declaration.
CycleInActionHierarchy(EntityUID)
Cycle in the schema’s action hierarchy.
ParseEntityType(ParseErrors)
Parse errors occurring while parsing an entity type.
ParseNamespace(ParseErrors)
Parse errors occurring while parsing a namespace identifier.
ParseExtensionType(ParseErrors)
Parse errors occurring while parsing an extension type.
ParseCommonType(ParseErrors)
Parse errors occurring while parsing the name of one of reusable declared types.
ActionEntityTypeDeclared
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(ContextOrShape)
context
or shape
fields are not records
ActionAttributesContainEmptySet(EntityUID)
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(EntityUID, String)
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(EntityAttrEvaluationError)
Error when evaluating an action attribute
ExprEscapeUsed
Error thrown when the schema contains the __expr
escape.
Support for this escape form has been dropped.
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<Error> for SchemaError
impl From<Error> for SchemaError
source§impl From<SchemaError> for HumanSchemaError
impl From<SchemaError> for HumanSchemaError
source§fn from(source: SchemaError) -> Self
fn from(source: SchemaError) -> Self
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