nichlink_debug_method/lib.rs
1//! Optional runtime evidence model.
2//!
3//! `EvidenceKind` is re-exported from core and is the single evidence type
4//! used by MIR, live traces, source scanners, graph adapters, and Studio.
5//! MIR and source candidates are informative only; `Live` is the sole
6//! confirmed execution evidence. Locals marked `unobserved` have no runtime
7//! value and must not be treated as observed data.
8//! 可选的运行期证据模型。
9//!
10//! `EvidenceKind` 从 core 再导出,是 MIR、实时 trace、源码扫描、图适配器与 Studio
11//! 共用的唯一证据类型。MIR 与源码候选只是提示;只有 `Live` 是已确认的执行证据。
12//! 标记为 `unobserved` 的局部值没有运行期取值,不得当作已观测数据。
13
14// The published surface must be readable on docs.rs without leaving the page,
15// so the lint is on for the whole crate; `clippy -D warnings` makes a new
16// undocumented public item a failure.
17// 发布表面必须能在 docs.rs 上不跳页读懂,因此 lint 开在整个 crate 上;
18// `clippy -D warnings` 会让新增的、没有文档的公开项变成失败。
19#![warn(missing_docs)]
20
21pub mod adapters;
22pub mod collector;
23pub mod mir;
24
25#[doc(hidden)]
26pub use inventory;
27
28/// Local inventory payload avoids orphan-rule coupling to core's declaration
29/// type while keeping the collected value zero-copy.
30/// 本地的 inventory 载荷避免与内核声明类型产生孤儿规则耦合,同时让收集到的值保持零拷贝。
31#[doc(hidden)]
32pub struct CollectedRegistration(pub &'static nichlink_run_method::RegistrationInfo);
33
34#[cfg(debug_assertions)]
35inventory::collect!(CollectedRegistration);
36
37pub use mir::{CallEvidence, CallRelation, MirCall, MirGraph, MirLocal, UnifiedCallGraph};
38pub use nichlink_run_method::{
39 CallEdge, CallSite, CallTrace, DataEdge, DataHop, EvidenceKind, LocalId, LocalKind, LocalValue,
40 NodeId, Observation, SourceLocation,
41};