pub enum ItemKind {
Show 19 variants
Function,
Struct,
Enum,
Trait,
Impl,
TypeAlias,
Const,
Static,
Mod,
Use,
Macro,
Method,
Field,
Variant,
LocalVar,
Parameter,
TupleField,
Any,
Other,
}Expand description
Kind of AST item (shared vocabulary across crates).
This enum represents the type of an AST item and is used for:
- Item-level conflict detection in parallel execution
- Intent extraction and pattern matching
- Spec directives and documentation
§Design
- Top-level items: items that can appear at module level
- Nested items: items that appear inside other items (methods in impl, fields in struct)
- Wildcard: for pattern matching any kind
Variants§
Function
Function definition (fn foo() {})
Struct
Struct definition (struct Foo {})
Enum
Enum definition (enum Foo {})
Trait
Trait definition (trait Foo {})
Impl
Impl block (impl Foo {} or impl Trait for Foo {})
TypeAlias
Type alias (type Foo = Bar;)
Const
Const item (const FOO: i32 = 1;)
Static
Static item (static FOO: i32 = 1;)
Mod
Module (mod foo; or mod foo {})
Use
Use statement (use std::io;)
Macro
Macro invocation at item level (macro_rules! or foo!())
Method
Method inside an impl or trait block
Field
Field in a struct or enum variant
Variant
Variant in an enum
LocalVar
Local variable (let x = ...)
Parameter
Function parameter
TupleField
Tuple struct/enum field (indexed by number: 0, 1, 2…)
Any
Wildcard - matches any kind (for pattern matching)
Other
Unknown or unsupported item
Implementations§
Source§impl ItemKind
impl ItemKind
Sourcepub fn is_top_level(&self) -> bool
pub fn is_top_level(&self) -> bool
Returns true if this is a top-level item (can appear at module level).
Sourcepub fn is_nested(&self) -> bool
pub fn is_nested(&self) -> bool
Returns true if this is a nested item (appears inside another item).
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if this is a variable-level item (local scope).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ItemKind
impl<'de> Deserialize<'de> for ItemKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ItemKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ItemKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<PureSymbolKind> for ItemKind
impl From<PureSymbolKind> for ItemKind
Source§fn from(kind: PureSymbolKind) -> ItemKind
fn from(kind: PureSymbolKind) -> ItemKind
Source§impl Serialize for ItemKind
impl Serialize for ItemKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ItemKind
impl Eq for ItemKind
impl StructuralPartialEq for ItemKind
Auto Trait Implementations§
impl Freeze for ItemKind
impl RefUnwindSafe for ItemKind
impl Send for ItemKind
impl Sync for ItemKind
impl Unpin for ItemKind
impl UnsafeUnpin for ItemKind
impl UnwindSafe for ItemKind
Blanket Implementations§
Source§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<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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more