pub enum Classification {
Show 64 variants
Unclassified = 0,
NotYetImplemented = 1,
IllegalValue = 2,
IllegalValueInHint = 3,
IllegalUri = 4,
IllegalGlob = 5,
Deprecation = 6,
Versioning = 7,
Experimental = 999,
Proto = 1_000,
ProtoParseFailed = 1_001,
ProtoMissingField = 1_002,
ProtoAny = 1_004,
ProtoMissingAnyDeclaration = 1_006,
Yaml = 2_000,
YamlResolutionDisabled = 2_001,
YamlResolutionFailed = 2_002,
YamlParseFailed = 2_003,
YamlSchemaValidationFailed = 2_004,
YamlMissingKey = 2_005,
YamlMissingElement = 2_007,
YamlInvalidType = 2_008,
YamlCyclicDependency = 2_009,
Link = 3_000,
LinkMissingAnchor = 3_001,
LinkAnchorZero = 3_005,
LinkMissingTypeVariationNameAndClass = 3_006,
LinkUnresolvedName = 3_007,
LinkAmbiguousName = 3_008,
LinkDuplicateDefinition = 3_009,
LinkCompoundVsSimpleFunctionName = 3_010,
Type = 4_000,
TypeUnknown = 4_001,
TypeMismatchedParameters = 4_002,
TypeMismatchedFieldNameAssociations = 4_003,
TypeInvalidSwizzle = 4_004,
TypeMismatch = 4_005,
TypeStructRequired = 4_006,
TypeMismatchedVariation = 4_007,
TypeMismatchedNullability = 4_008,
TypeDerivationInvalid = 4_009,
TypeDerivationFailed = 4_010,
TypeParseError = 4_011,
TypeResolutionError = 4_012,
TypeInvalidFieldName = 4_013,
TypeDerivationNotSupported = 4_014,
Relation = 5_000,
RelationRootMissing = 5_001,
RelationMissing = 5_002,
RelationInvalid = 5_003,
Expression = 6_000,
ExpressionFieldRefMissingStream = 6_001,
ExpressionIllegalLiteralValue = 6_002,
ExpressionFunctionDefinitionUnavailable = 6_003,
ExpressionIllegalSubquery = 6_004,
Redundant = 7_000,
RedundantProtoAnyDeclaration = 7_001,
RedundantExtensionDefition = 7_002,
RedundantFunctionDeclaration = 7_003,
RedundantTypeDeclaration = 7_004,
RedundantTypeVariationDeclaration = 7_005,
RedundantListSlice = 7_006,
RedundantField = 7_007,
RedundantEnumVariant = 7_008,
}Expand description
Enumeration for the particular types of diagnostics we might encounter.
Numbers must be assigned as follows:
- the group identifier is represented by the thousands digit and up;
- the first classification for each group (i.e. divisible by 1000) is reserved for diagnostics that have no more specific information attached to them: their description must be hidden and related to the group name;
- group 0 is a sort of null group, where no group information is known;
- all enum variant names for classifications belonging to a group (except the null group) must be prefixed by the group name;
- for backward/forward-compatibility, numbers should not be reassigned.
The Description and HiddenDescription enum properties define a description of the class. When Description is used, the description is prefixed before the error message; when HiddenDescription is used, the message is not prefixed, and should thus be sufficiently specific to not need it. The latter is useful to reduce the amount of redundant information in a message.
Variants§
Unclassified = 0
NotYetImplemented = 1
IllegalValue = 2
IllegalValueInHint = 3
IllegalUri = 4
IllegalGlob = 5
Deprecation = 6
Versioning = 7
Experimental = 999
Proto = 1_000
ProtoParseFailed = 1_001
ProtoMissingField = 1_002
ProtoAny = 1_004
ProtoMissingAnyDeclaration = 1_006
Yaml = 2_000
YamlResolutionDisabled = 2_001
YamlResolutionFailed = 2_002
YamlParseFailed = 2_003
YamlSchemaValidationFailed = 2_004
YamlMissingKey = 2_005
YamlMissingElement = 2_007
YamlInvalidType = 2_008
YamlCyclicDependency = 2_009
Link = 3_000
LinkMissingAnchor = 3_001
LinkAnchorZero = 3_005
LinkMissingTypeVariationNameAndClass = 3_006
LinkUnresolvedName = 3_007
LinkAmbiguousName = 3_008
LinkDuplicateDefinition = 3_009
LinkCompoundVsSimpleFunctionName = 3_010
Type = 4_000
TypeUnknown = 4_001
TypeMismatchedParameters = 4_002
TypeMismatchedFieldNameAssociations = 4_003
TypeInvalidSwizzle = 4_004
TypeMismatch = 4_005
TypeStructRequired = 4_006
TypeMismatchedVariation = 4_007
TypeMismatchedNullability = 4_008
TypeDerivationInvalid = 4_009
TypeDerivationFailed = 4_010
TypeParseError = 4_011
TypeResolutionError = 4_012
TypeInvalidFieldName = 4_013
TypeDerivationNotSupported = 4_014
Relation = 5_000
RelationRootMissing = 5_001
RelationMissing = 5_002
RelationInvalid = 5_003
Expression = 6_000
ExpressionFieldRefMissingStream = 6_001
ExpressionIllegalLiteralValue = 6_002
ExpressionIllegalSubquery = 6_004
Redundant = 7_000
RedundantProtoAnyDeclaration = 7_001
RedundantExtensionDefition = 7_002
RedundantFunctionDeclaration = 7_003
RedundantTypeDeclaration = 7_004
RedundantTypeVariationDeclaration = 7_005
RedundantListSlice = 7_006
RedundantField = 7_007
RedundantEnumVariant = 7_008
Implementations§
Source§impl Classification
impl Classification
Sourcepub fn group_code(&self) -> u32
pub fn group_code(&self) -> u32
Returns the group code for this classification.
Sourcepub fn group(&self) -> Classification
pub fn group(&self) -> Classification
Returns the group variant for this classification.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the description of this classification.
Sourcepub fn from_code(code: u32) -> Option<Self>
pub fn from_code(code: u32) -> Option<Self>
Returns the classification associated with the given code, if any.
Sourcepub fn group_from_code(code: u32) -> Option<Self>
pub fn group_from_code(code: u32) -> Option<Self>
Returns the group classification associated with the given code, if any.
Sourcepub fn from_group(group: u32) -> Option<Self>
pub fn from_group(group: u32) -> Option<Self>
Returns the group classification associated with the given group.
Sourcepub fn parent(code: u32) -> u32
pub fn parent(code: u32) -> u32
Returns the “parent” code for the given code. For non-group codes, this is the code of their group (code rounded down to thousands). For group codes, this is 0.
Sourcepub fn format_message(&self, message: &Message, f: &mut Formatter<'_>) -> Result
pub fn format_message(&self, message: &Message, f: &mut Formatter<'_>) -> Result
Formats a Message with this classification.
Trait Implementations§
Source§impl Clone for Classification
impl Clone for Classification
Source§fn clone(&self) -> Classification
fn clone(&self) -> Classification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Classification
impl Debug for Classification
Source§impl Default for Classification
impl Default for Classification
Source§fn default() -> Classification
fn default() -> Classification
Source§impl EnumProperty for Classification
impl EnumProperty for Classification
Source§impl From<Classification> for u32
impl From<Classification> for u32
Source§fn from(classification: Classification) -> Self
fn from(classification: Classification) -> Self
Converts a Classification into its error code.
Source§impl FromPrimitive for Classification
impl FromPrimitive for Classification
Source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl Hash for Classification
impl Hash for Classification
Source§impl IntoEnumIterator for Classification
impl IntoEnumIterator for Classification
type Iterator = ClassificationIter
fn iter() -> ClassificationIter ⓘ
Source§impl PartialEq for Classification
impl PartialEq for Classification
impl Copy for Classification
impl Eq for Classification
impl StructuralPartialEq for Classification
Auto Trait Implementations§
impl Freeze for Classification
impl RefUnwindSafe for Classification
impl Send for Classification
impl Sync for Classification
impl Unpin for Classification
impl UnwindSafe for Classification
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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