Skip to main content

CallRelation

Struct CallRelation 

Source
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: String

Function symbol making the call. 发起调用的函数符号。

§callee: String

Function symbol being called. 被调用的函数符号。

§evidence: EvidenceKind

Strongest 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

Source

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

Source§

fn clone(&self) -> CallRelation

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 CallRelation

Source§

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

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

impl Eq for CallRelation

Source§

impl PartialEq for CallRelation

Source§

fn eq(&self, other: &CallRelation) -> 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 CallRelation

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.