pub struct CallRelation {
pub caller: String,
pub callee: String,
pub evidence: EvidenceKind,
pub source: Option<SourceLocation>,
pub mir_line: Option<usize>,
pub caller_frame: Option<u64>,
pub callee_frame: Option<u64>,
}Expand description
One call edge normalized across runtime, MIR, and source evidence. 跨运行时、MIR、源码证据统一表示的一条调用边。
Fields§
§caller: StringFunction symbol making the call. 发起调用的函数符号。
callee: StringFunction symbol being called. 被调用的函数符号。
evidence: EvidenceKindStrongest evidence supporting this relation: live over MIR. 支持该关系的最高证据等级:Live 优先于 MIR。
source: Option<SourceLocation>Source location of the callee, when known. 已知时,被调用方的源码位置。
mir_line: Option<usize>MIR record position for a MIR-only relation; None for a live edge.
仅由 MIR 支持时为 MIR 记录位置;live 边为 None。
caller_frame: Option<u64>Runtime frame id of the caller; None for a static-only relation.
调用方的运行期帧 id;仅静态关系为 None。
callee_frame: Option<u64>Runtime frame id of the callee; None for a static-only relation.
被调用方的运行期帧 id;仅静态关系为 None。
Implementations§
Source§impl CallRelation
impl CallRelation
Sourcepub fn from_symbols(
caller: impl Into<String>,
callee: impl Into<String>,
evidence: EvidenceKind,
) -> CallRelation
pub fn from_symbols( caller: impl Into<String>, callee: impl Into<String>, evidence: EvidenceKind, ) -> CallRelation
A relation whose two ends are known but whose provenance is only the text of the call site: no MIR record, no runtime frame. 两端已知、但来源只是调用点文本的关系:没有 MIR 记录,也没有运行期帧。
Studio’s source scan produces these, which is why the type has to be constructible without inventing a MIR line or a frame id. Studio 的源码扫描产生的正是它们,因此该类型必须能在不编造 MIR 行号或帧 id 的情况下构造。
Trait Implementations§
Source§impl Clone for CallRelation
impl Clone for CallRelation
Source§fn clone(&self) -> CallRelation
fn clone(&self) -> CallRelation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more