pub enum SymbolKind {
Show 20 variants
Struct,
Enum,
Function,
Method,
Trait,
Impl,
Mod,
Const,
Static,
TypeAlias,
Union,
Macro,
Variable,
Parameter,
Field,
TupleField,
Variant,
Use,
Any,
Other,
}Expand description
Symbol type classification
This enum classifies symbols for analysis and search purposes. It extends AST-level item kinds with additional types for variables, parameters, and fields (InSymbol).
§Design
| Layer | Kind Type | Responsibility |
|---|---|---|
| AST (ryo-source) | ItemKind | Syntactic item classification (no Var) |
| Symbol (ryo-symbol) | SymbolKind | Analysis/search classification (includes Var) |
Conversion from ItemKind is done via From trait implemented
in the consuming crate (e.g., ryo-analysis), not here.
§InSymbol Extensions
| SymbolKind | VarScope | Path Example |
|---|---|---|
| Parameter | $param | my_crate::my_fn::$param::x |
| Variable | $var | my_crate::my_fn::$var::result |
| Field | $field | my_crate::MyStruct::$field::name |
Variants§
Struct
Struct definition
Enum
Enum definition
Function
Free function
Method
Method (in impl block)
Trait
Trait definition
Impl
Impl block
Mod
Module
Const
Constant
Static
Static variable
TypeAlias
Type alias
Union
Union type
Macro
Macro definition
Variable
Local variable ($var)
Parameter
Function/method parameter ($param)
Field
Struct/enum field ($field)
TupleField
Tuple struct/enum field (indexed: 0, 1, 2…)
Variant
Enum variant
Use
Use statement (import)
Any
Wildcard - matches any kind (for pattern matching)
Other
Unknown or unsupported
Implementations§
Source§impl SymbolKind
impl SymbolKind
Sourcepub fn is_in_symbol(&self) -> bool
pub fn is_in_symbol(&self) -> bool
Check if this is an InSymbol kind (variable, parameter, or field)
Sourcepub fn is_callable(&self) -> bool
pub fn is_callable(&self) -> bool
Check if this is callable
Sourcepub fn is_value(&self) -> bool
pub fn is_value(&self) -> bool
Check if this is a value (const, static, field, variable, parameter)
Sourcepub fn display_name(&self) -> &'static str
pub fn display_name(&self) -> &'static str
Get display name for this kind
Sourcepub fn matches(&self, other: &SymbolKind) -> bool
pub fn matches(&self, other: &SymbolKind) -> bool
Returns true if this matches the given kind (considering Any as wildcard).
Trait Implementations§
Source§impl Clone for SymbolKind
impl Clone for SymbolKind
Source§fn clone(&self) -> SymbolKind
fn clone(&self) -> SymbolKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SymbolKind
impl Debug for SymbolKind
Source§impl<'de> Deserialize<'de> for SymbolKind
impl<'de> Deserialize<'de> for SymbolKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymbolKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for SymbolKind
impl Display for SymbolKind
Source§impl Hash for SymbolKind
impl Hash for SymbolKind
Source§impl PartialEq for SymbolKind
impl PartialEq for SymbolKind
Source§fn eq(&self, other: &SymbolKind) -> bool
fn eq(&self, other: &SymbolKind) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SymbolKind
impl Serialize for SymbolKind
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 SymbolKind
impl Eq for SymbolKind
impl StructuralPartialEq for SymbolKind
Auto Trait Implementations§
impl Freeze for SymbolKind
impl RefUnwindSafe for SymbolKind
impl Send for SymbolKind
impl Sync for SymbolKind
impl Unpin for SymbolKind
impl UnsafeUnpin for SymbolKind
impl UnwindSafe for SymbolKind
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<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