pub enum SymbolKind {
Module,
Struct,
Enum,
Union,
Trait,
TypeAlias,
Function,
Method,
Const,
Static,
Macro,
}Expand description
What kind of thing a Symbol is.
The set is a superset of what common languages need; language adapters map their
own constructs onto the closest variant (a TypeScript interface would be
a SymbolKind::Trait, a Python class a SymbolKind::Struct).
Variants§
Module
A module / namespace. Every source file has one.
Struct
A product type with named or positional fields.
Enum
A sum type.
Union
An untagged union.
Trait
An interface / trait / protocol.
TypeAlias
A type alias.
Function
A free function.
Method
A function attached to a type (inherent or trait method, including
associated functions without self).
Const
A constant.
Static
A static / global variable.
Macro
A macro definition.
Implementations§
Source§impl SymbolKind
impl SymbolKind
Sourcepub fn is_type(self) -> bool
pub fn is_type(self) -> bool
true for kinds that are rendered as classes in a structure diagram.
Sourcepub fn is_callable(self) -> bool
pub fn is_callable(self) -> bool
true for kinds that have a body and therefore may carry a Flow.
Sourcepub fn descriptor(self, name: impl Into<String>) -> Descriptor
pub fn descriptor(self, name: impl Into<String>) -> Descriptor
The sym: descriptor for a symbol of this kind called name: a
namespace for modules, a type for structs, enums, unions, traits and
aliases, a method for functions and methods, a term for constants and
statics, a macro for macros.
assert_eq!(SymbolKind::Module.descriptor("net").suffix(), &sealmap_model::Suffix::Namespace);