Classification

Enum Classification 

Source
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

§

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

Implementations§

Source§

impl Classification

Source

pub fn code(&self) -> u32

Returns the complete code for this classification.

Source

pub fn name(&self) -> String

Returns the name of the classiciation.

Source

pub fn group_code(&self) -> u32

Returns the group code for this classification.

Source

pub fn group(&self) -> Classification

Returns the group variant for this classification.

Source

pub fn sub_code(&self) -> u32

Returns the code for this classification within its group.

Source

pub fn description(&self) -> &str

Returns the description of this classification.

Source

pub fn from_code(code: u32) -> Option<Self>

Returns the classification associated with the given code, if any.

Source

pub fn group_from_code(code: u32) -> Option<Self>

Returns the group classification associated with the given code, if any.

Source

pub fn from_group(group: u32) -> Option<Self>

Returns the group classification associated with the given group.

Source

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.

Source

pub fn format_message(&self, message: &Message, f: &mut Formatter<'_>) -> Result

Formats a Message with this classification.

Trait Implementations§

Source§

impl Clone for Classification

Source§

fn clone(&self) -> Classification

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Classification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Classification

Source§

fn default() -> Classification

Returns the “default value” for a type. Read more
Source§

impl EnumProperty for Classification

Source§

fn get_str(&self, prop: &str) -> Option<&'static str>

Source§

fn get_int(&self, prop: &str) -> Option<i64>

Source§

fn get_bool(&self, prop: &str) -> Option<bool>

Source§

impl From<Classification> for u32

Source§

fn from(classification: Classification) -> Self

Converts a Classification into its error code.

Source§

impl FromPrimitive for Classification

Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

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
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl Hash for Classification

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for Classification

Source§

impl PartialEq for Classification

Source§

fn eq(&self, other: &Classification) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Classification

Source§

impl Eq for Classification

Source§

impl StructuralPartialEq for Classification

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

Source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

Source§

fn coerce_box_to(self: Box<X>) -> Box<T>

Source§

fn coerce_ref_to(&self) -> &T

Source§

fn coerce_mut_to(&mut self) -> &mut T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,