Skip to content

ViolationCode should be marked as non-exhaustive #209

@popematt

Description

@popematt

/// Represents violation code that indicates the type of the violation
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ViolationCode {
AllTypesNotMatched,
AnnotationMismatched,
ElementMismatched, // this is used for mismatched elements in containers
ElementNotDistinct, // this is used for elements that are not distinct in containers
FieldNamesMismatched, // this is used for mismatched field names in a struct
FieldNamesNotDistinct, // this is used for field names that are not distinct in a struct
FieldsNotMatched,
InvalidIeee754Float, // this is used for ieee754_float constraint
InvalidLength, // this is used for any length related constraints (e.g. container_length, byte_length, codepoint_length)
InvalidNull, // if the value is a null for type references that doesn't allow null
InvalidOpenContent, // if a container contains open content when `content: closed` is specified
InvalidValue, // this is used for valid_values constraint
MissingAnnotation, // if the annotation is missing for annotations constraint
MissingValue, // if the ion value is missing for a particular constraint
MoreThanOneTypeMatched,
NoTypesMatched,
RegexMismatched, // this is used for regex constraint
TypeConstraintsUnsatisfied,
TypeMatched,
TypeMismatched,
UnexpectedAnnotation, // if unexpected annotation is found for annotations constraint
}

ViolationCode should be marked as #[non_exhaustive] so that new violation codes can be added if/when new versions of ISL add new constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions