pub struct CodeReference {
    pub address: u64,
    /* private fields */
}
Expand description

A struct representing a single code cross-reference. Taking a cue from crate::linearview::LinearDisassemblyLine, this struct uses ManuallyDrop to prevent destructors from being run on the Function object allocated by the core in BNGetCodeReferences (et al). The reference is cleaned up on Drop of the enclosing array object.

Fields§

§address: u64

Implementations§

source§

impl<'a> CodeReference

source

pub fn function(&'a self) -> &'a Function

A handle to the referenced function bound by the CodeReference object’s lifetime. A user can call .to_owned() to promote this into its own ref-counted struct and use it after the lifetime of the CodeReference.

source

pub fn architecture(&self) -> CoreArchitecture

A handle to the CodeReference’s CoreArchitecture. This type is Copy so reference shenanigans are not needed here.

Trait Implementations§

source§

impl CoreArrayProvider for CodeReference

§

type Raw = BNReferenceSource

§

type Context = ()

§

type Wrapped<'a> = Guard<'a, CodeReference>

source§

impl Debug for CodeReference

source§

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

Formats the value using the given formatter. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.