Skip to main content

UnifiedCallGraph

Struct UnifiedCallGraph 

Source
pub struct UnifiedCallGraph {
    pub static_calls: Vec<MirCall>,
    pub runtime_calls: Vec<CallEdge>,
}
Expand description

Static MIR candidates plus calls observed in one live run. 静态 MIR 候选边与一次运行中真实观察到的调用边。

Fields§

§static_calls: Vec<MirCall>

Calls the static MIR parse proposed, none of them confirmed as executed. 静态 MIR 解析提出的调用,均未确认为已执行。

§runtime_calls: Vec<CallEdge>

Calls actually observed during the live run, i.e. confirmed evidence. 实时运行中真正观察到的调用,即已确认的证据。

Implementations§

Source§

impl UnifiedCallGraph

Source

pub fn new(static_graph: &MirGraph, trace: &CallTrace) -> Self

Pair one static MIR graph with one live trace into a single evidence set; neither input is mutated. 将一个静态 MIR 图与一次实时 trace 配对为一份证据集合;两侧输入都不被修改。

Source

pub fn topology(&self) -> CallGraph

Delegate topology queries to the petgraph-backed adapter. 将拓扑查询委托给基于 petgraph 的适配层。

Source

pub fn relations(&self) -> Vec<CallRelation>

Merge all known edges into one evidence-aware relation list. 将所有已知边合并为一份带证据等级的关系列表。

Live edges win over MIR candidates with the same logical symbols. A static candidate that was not observed remains visible as Mir, so a missing branch is not silently mistaken for a successful call. 逻辑符号相同的边以 Live 证据为准。未被观察到的静态候选仍保留为 Mir,不会把未执行分支误报成已经成功调用。

Source

pub fn render(&self) -> String

Render the merged relations as human-readable lines, one per relation, each carrying its evidence marker, source location, and frame ids. 将合并后的关系渲染为人类可读的行,每行一条,带证据标记、源码位置与帧 id。

Trait Implementations§

Source§

impl Clone for UnifiedCallGraph

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UnifiedCallGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UnifiedCallGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for UnifiedCallGraph

Source§

impl PartialEq for UnifiedCallGraph

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UnifiedCallGraph

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more