pub struct Program { /* private fields */ }
Expand description
A representation of a program by il::Function
Implementations§
source§impl Program
impl Program
sourcepub fn function_by_address(&self, address: u64) -> Option<&Function>
pub fn function_by_address(&self, address: u64) -> Option<&Function>
Search for a Function
by its optional address, assuming one was assigned.
Returns the Function
if found, or None
if not found.
sourcepub fn functions_map(&self) -> BTreeMap<usize, &Function>
pub fn functions_map(&self) -> BTreeMap<usize, &Function>
Get the underlying BTreeMap holding all Function
for this Program
.
sourcepub fn function(&self, index: usize) -> Option<&Function>
pub fn function(&self, index: usize) -> Option<&Function>
Get a Function
by its index.
A Function
index is assigned by Program
and is not the address where the Function
was discovered.
sourcepub fn add_function(&mut self, function: Function)
pub fn add_function(&mut self, function: Function)
Add a Function
to the Program
.
This will also assign an index to the Function
.
sourcepub fn function_by_name(&self, name: &str) -> Option<&Function>
pub fn function_by_name(&self, name: &str) -> Option<&Function>
Get a Function
by its name.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Program
impl<'de> Deserialize<'de> for Program
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more