pub struct ConstantReflection {
pub attribute_reflections: Vec<AttributeReflection>,
pub name: Name,
pub type_reflection: TypeReflection,
pub item_span: Span,
pub definition_span: Span,
pub is_populated: bool,
pub issues: IssueCollection,
}Expand description
Represents a constant reflection in the codebase.
A ConstantReflection provides metadata about a single constant, including its
name, type, and location in the source code. Constants are uniquely identified
and separated even when declared in a single statement, such as const A = 1, B = 2;.
Fields§
§attribute_reflections: Vec<AttributeReflection>Collection of attributes applied to the constant.
name: NameThe name of the constant.
type_reflection: TypeReflectionThe type reflection of the constant.
item_span: SpanThe span of the specific constant item (A = 1 in const A = 1, B = 2;).
definition_span: SpanThe span of the entire constant definition (const A = 1, B = 2;).
is_populated: boolWhether the reflection’s metadata is fully populated.
issues: IssueCollectionCollection of issues related to the constant.
Trait Implementations§
Source§impl Clone for ConstantReflection
impl Clone for ConstantReflection
Source§fn clone(&self) -> ConstantReflection
fn clone(&self) -> ConstantReflection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConstantReflection
impl Debug for ConstantReflection
Source§impl<'de> Deserialize<'de> for ConstantReflection
impl<'de> Deserialize<'de> for ConstantReflection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl HasSource for ConstantReflection
impl HasSource for ConstantReflection
Source§fn source(&self) -> SourceIdentifier
fn source(&self) -> SourceIdentifier
Returns the source identifier of the file containing this constant.
The source identifier includes metadata about the file or context where the constant is defined, such as whether it is a user-defined, vendor-provided, or built-in constant.
Source§impl HasSpan for ConstantReflection
impl HasSpan for ConstantReflection
Source§impl Hash for ConstantReflection
impl Hash for ConstantReflection
Source§impl PartialEq for ConstantReflection
impl PartialEq for ConstantReflection
Source§impl Reflection for ConstantReflection
impl Reflection for ConstantReflection
Source§fn get_category(&self) -> SourceCategory
fn get_category(&self) -> SourceCategory
Returns the category of the source where the constant is defined.
The category indicates whether the constant is part of the project (UserDefined),
comes from a external library (External), or is built into the language (BuiltIn).
Source§fn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Indicates whether the constant’s reflection data is fully populated.
If is_populated is false, additional processing may be required to resolve
the constant’s metadata completely.