pub struct CodeNode {
pub id: NodeId,
pub kind: NodeKind,
pub name: String,
pub file_path: Option<String>,
pub line_range: Option<(usize, usize)>,
pub doc_comment: Option<String>,
pub signature: Option<String>,
pub visibility: Option<String>,
pub module_path: Vec<String>,
}Expand description
代码实体节点
Fields§
§id: NodeId在 petgraph 图中的索引
kind: NodeKind实体类型
name: String实体名称
file_path: Option<String>所属文件路径(相对项目根)
line_range: Option<(usize, usize)>源代码行范围 [start, end]
doc_comment: Option<String>文档注释
signature: Option<String>函数/类型签名
visibility: Option<String>可见性修饰符(“pub”/“pub(crate)”/“private”/“internal”/“export” 等), 由解析器按行级文本提取;缺失(默认可见性)为 None。 serde(default) 兼容旧版 insights_cache 反序列化。
module_path: Vec<String>模块路径(用 :: 分隔)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeNode
impl<'de> Deserialize<'de> for CodeNode
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeNode
impl RefUnwindSafe for CodeNode
impl Send for CodeNode
impl Sync for CodeNode
impl Unpin for CodeNode
impl UnsafeUnpin for CodeNode
impl UnwindSafe for CodeNode
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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 more