pub struct Definition {
pub name: String,
pub kind: String,
pub start_line: u32,
pub end_line: u32,
pub scope: String,
pub signature: Option<String>,
pub start_byte: u32,
pub end_byte: u32,
pub calls: Vec<CallRef>,
pub decorator: Option<String>,
pub lsp_kind_hint: Option<u32>,
}Expand description
A definition extracted from a source file.
Fields§
§name: StringName of the definition (e.g., function name, class name).
kind: StringKind of syntax node (e.g., function_item, class_definition).
start_line: u321-based start line number.
end_line: u321-based end line number.
scope: StringScope chain (e.g., "impl_item Foo > fn bar").
signature: Option<String>Function/method signature, if available.
start_byte: u32Byte offset of this definition’s start in the source file.
end_byte: u32Byte offset of this definition’s end in the source file.
calls: Vec<CallRef>Call sites within this definition’s body.
decorator: Option<String>The first decorator name for Python decorated_definition nodes (e.g.,
"property", "classmethod", "staticmethod", "cached_property").
None for all non-Python definitions and for bare (undecorated) Python
functions and classes. Populated by extract_definitions at AST-parse
time with full tree-sitter access (C1, 4.1.1).
lsp_kind_hint: Option<u32>Decorator-aware LSP SymbolKind integer (e.g., 7=Property, 12=Function).
Computed at parse time when the AST is available so projection sites
(render_json_budgeted) do not need to re-parse. For Python @property
or @cached_property → 7. For @classmethod, @staticmethod, or any
other decorator → 12. None for all non-decorated definitions; callers
fall back to lsp_symbol_kind_for_node_kind(&self.kind) when None
(C1/C2, 4.1.1).
Trait Implementations§
Source§impl Archive for Definition
impl Archive for Definition
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedDefinition
type Archived = ArchivedDefinition
Source§type Resolver = DefinitionResolver
type Resolver = DefinitionResolver
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
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 Definition
impl Debug for Definition
Source§impl Default for Definition
impl Default for Definition
Source§fn default() -> Definition
fn default() -> Definition
Source§impl<__D: Fallible + ?Sized> Deserialize<Definition, __D> for Archived<Definition>where
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
u32: Archive,
<u32 as Archive>::Archived: Deserialize<u32, __D>,
Option<String>: Archive,
<Option<String> as Archive>::Archived: Deserialize<Option<String>, __D>,
Vec<CallRef>: Archive,
<Vec<CallRef> as Archive>::Archived: Deserialize<Vec<CallRef>, __D>,
Option<u32>: Archive,
<Option<u32> as Archive>::Archived: Deserialize<Option<u32>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<Definition, __D> for Archived<Definition>where
String: Archive,
<String as Archive>::Archived: Deserialize<String, __D>,
u32: Archive,
<u32 as Archive>::Archived: Deserialize<u32, __D>,
Option<String>: Archive,
<Option<String> as Archive>::Archived: Deserialize<Option<String>, __D>,
Vec<CallRef>: Archive,
<Vec<CallRef> as Archive>::Archived: Deserialize<Vec<CallRef>, __D>,
Option<u32>: Archive,
<Option<u32> as Archive>::Archived: Deserialize<Option<u32>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<Definition, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<Definition, <__D as Fallible>::Error>
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.