pub enum Classification {
Show 53 variants
Unclassified,
NotYetImplemented,
IllegalValue,
IllegalValueInHint,
IllegalUri,
IllegalGlob,
Deprecation,
Experimental,
Proto,
ProtoParseFailed,
ProtoMissingField,
ProtoAny,
ProtoMissingAnyDeclaration,
Yaml,
YamlResolutionDisabled,
YamlResolutionFailed,
YamlParseFailed,
YamlSchemaValidationFailed,
YamlMissingKey,
YamlMissingElement,
YamlInvalidType,
Link,
LinkMissingAnchor,
LinkMissingFunctionName,
LinkMissingTypeName,
LinkMissingTypeVariationName,
LinkAnchorZero,
Type,
TypeUnknown,
TypeMismatchedParameters,
TypeMismatchedFieldNameAssociations,
TypeInvalidSwizzle,
TypeMismatch,
TypeStructRequired,
TypeMismatchedVariation,
TypeMismatchedNullability,
Relation,
RelationRootMissing,
RelationMissing,
RelationInvalid,
Expression,
ExpressionFieldRefMissingStream,
ExpressionIllegalLiteralValue,
ExpressionFunctionDefinitionUnavailable,
ExpressionIllegalSubquery,
Redundant,
RedundantProtoAnyDeclaration,
RedundantExtensionDefition,
RedundantFunctionDeclaration,
RedundantTypeDeclaration,
RedundantTypeVariationDeclaration,
RedundantListSlice,
RedundantField,
}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
NotYetImplemented
IllegalValue
IllegalValueInHint
IllegalUri
IllegalGlob
Deprecation
Experimental
Proto
ProtoParseFailed
ProtoMissingField
ProtoAny
ProtoMissingAnyDeclaration
Yaml
YamlResolutionDisabled
YamlResolutionFailed
YamlParseFailed
YamlSchemaValidationFailed
YamlMissingKey
YamlMissingElement
YamlInvalidType
Link
LinkMissingAnchor
LinkMissingFunctionName
LinkMissingTypeName
LinkMissingTypeVariationName
LinkAnchorZero
Type
TypeUnknown
TypeMismatchedParameters
TypeMismatchedFieldNameAssociations
TypeInvalidSwizzle
TypeMismatch
TypeStructRequired
TypeMismatchedVariation
TypeMismatchedNullability
Relation
RelationRootMissing
RelationMissing
RelationInvalid
Expression
ExpressionFieldRefMissingStream
ExpressionIllegalLiteralValue
ExpressionFunctionDefinitionUnavailable
ExpressionIllegalSubquery
Redundant
RedundantProtoAnyDeclaration
RedundantExtensionDefition
RedundantFunctionDeclaration
RedundantTypeDeclaration
RedundantTypeVariationDeclaration
RedundantListSlice
RedundantField
Implementations
sourceimpl 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
sourceimpl Clone for Classification
impl Clone for Classification
sourcefn clone(&self) -> Classification
fn clone(&self) -> Classification
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Classification
impl Debug for Classification
sourceimpl Default for Classification
impl Default for Classification
sourceimpl EnumProperty for Classification
impl EnumProperty for Classification
sourceimpl From<Classification> for u32
impl From<Classification> for u32
sourcefn from(classification: Classification) -> Self
fn from(classification: Classification) -> Self
Converts a Classification into its error code.
sourceimpl FromPrimitive for Classification
impl FromPrimitive for Classification
sourcefn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
Converts an i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
Converts an u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
Converts an isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
Converts an i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
Converts an i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
Converts an i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
Converts an i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
Converts a usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
Converts an u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
Converts an u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
Converts an u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourcefn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
Converts an u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read more
sourceimpl Hash for Classification
impl Hash for Classification
sourceimpl IntoEnumIterator for Classification
impl IntoEnumIterator for Classification
type Iterator = ClassificationIter
fn iter() -> ClassificationIterⓘNotable traits for ClassificationIterimpl Iterator for ClassificationIter type Item = Classification;
sourceimpl PartialEq<Classification> for Classification
impl PartialEq<Classification> for Classification
impl Copy for Classification
impl Eq for Classification
impl StructuralEq for Classification
impl StructuralPartialEq for Classification
Auto Trait Implementations
impl RefUnwindSafe for Classification
impl Send for Classification
impl Sync for Classification
impl Unpin for Classification
impl UnwindSafe for Classification
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more