Skip to main content

FunctionInterface

Struct FunctionInterface 

Source
pub struct FunctionInterface<'str> {
    pub name: Cow<'str, str>,
    pub address: Option<u64>,
    pub is_external: bool,
    pub signature: Option<FunctionSignature>,
    pub kind: FunctionKind,
    pub effects: FunctionEffects,
    pub import_ordinal: Option<u16>,
}
Expand description

Everything a caller reasons about a function: its name, address, semantic kind, external-ness, and ABI/analysis signature. This is the caller-reasoning surface (ruling 1 of the context-split design): it is precisely the data a function pass may read about another function. Its counterpart is the function body (arenas, roster, users, local names) — everything only the function’s own passes touch.

Interfaces are stored in their own Context::interfaces registry, held in lockstep with the function bodies under the same FunctionId and never checked out — so a caller always reads the real interface even while a callee’s body is checked out to a worker.

Fields§

§name: Cow<'str, str>

The function’s name.

§address: Option<u64>

Optional entry address (from binary).

§is_external: bool

Whether this is an external (imported) function.

External functions have no lifted body — they are stubs for calls that go outside the binary (e.g. PLT thunks for shared-library functions). The recursive disassembler will not attempt to lift their body.

§signature: Option<FunctionSignature>

Optional ABI description used by alias analysis.

§kind: FunctionKind

What semantic class this function belongs to.

§effects: FunctionEffects

Call-graph-closed implicit effect summary of this function, per the argpromote v2 design (ARGPROMOTE_REGISTERS_V2.md). Solved by the effect-analysis pass and read by the materialize/regpure passes, the emulator, alias analysis, and the verifier.

Serialized into the .harbinger wire shape so that rewritten regpure call sites and materialized interfaces stay in sync with the snapshot. Older snapshots that predate this field load as RegisterChannelState::Unsolved via #[serde(default)].

§import_ordinal: Option<u16>

For a PE import brought in by ordinal only, the ordinal it was imported at. Recorded before the stub is renamed to its real export name.

Implementations§

Source§

impl<'str> FunctionInterface<'str>

Source

pub fn new(name: Cow<'str, str>) -> Self

A fresh interface named name, with default (empty) signature/kind.

Source

pub fn param_attr(&self, index: usize) -> Option<ParamAttrs>

The inferred pointer attributes for positional argument index, or None when this function has no analyzed attributes.

Trait Implementations§

Source§

impl<'str> Clone for FunctionInterface<'str>

Source§

fn clone(&self) -> FunctionInterface<'str>

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<'str> Default for FunctionInterface<'str>

Source§

fn default() -> FunctionInterface<'str>

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

impl<'de, 'str> Deserialize<'de> for FunctionInterface<'str>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'str> Serialize for FunctionInterface<'str>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'str> Freeze for FunctionInterface<'str>

§

impl<'str> RefUnwindSafe for FunctionInterface<'str>

§

impl<'str> Send for FunctionInterface<'str>

§

impl<'str> Sync for FunctionInterface<'str>

§

impl<'str> Unpin for FunctionInterface<'str>

§

impl<'str> UnsafeUnpin for FunctionInterface<'str>

§

impl<'str> UnwindSafe for FunctionInterface<'str>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.