Struct Unit

Source
pub struct Unit<'input> { /* private fields */ }
Expand description

A compilation unit.

Implementations§

Source§

impl<'input> Unit<'input>

Source

pub fn id(&self) -> usize

The user defined id for this type.

Source

pub fn set_id(&self, id: usize)

Set a user defined id for this type.

Source

pub fn dir(&self) -> Option<&str>

The working directory when the unit was compiled.

Source

pub fn name(&self) -> Option<&str>

The path of the primary source file.

Source

pub fn language(&self) -> Option<DwLang>

The source language.

Source

pub fn address(&self) -> Option<u64>

The base address.

Source

pub fn ranges(&self, hash: &FileHash<'_>) -> RangeList

The address ranges covered by functions and variables in the unit.

Does not include unknown ranges.

Source

pub fn unknown_ranges(&self, hash: &FileHash<'_>) -> RangeList

The address ranges covered that are covered by the unit, but which are not known to be associated with any functions or variables.

Source

pub fn size(&self, hash: &FileHash<'_>) -> u64

The total size of all functions and variables.

Source

pub fn function_size(&self) -> u64

The total size of all functions.

Source

pub fn variable_size(&self, hash: &FileHash<'_>) -> u64

The total size of all variables.

Source

pub fn types(&self) -> &[Type<'input>]

The types declared or defined by this unit.

Source

pub fn functions(&self) -> &[Function<'input>]

The functions declared or defined by this unit.

Source

pub fn variables(&self) -> &[Variable<'input>]

The variables declared or defined by this unit.

Trait Implementations§

Source§

impl<'input> Debug for Unit<'input>

Source§

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

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

impl<'input> Default for Unit<'input>

Source§

fn default() -> Unit<'input>

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

Auto Trait Implementations§

§

impl<'input> !Freeze for Unit<'input>

§

impl<'input> RefUnwindSafe for Unit<'input>

§

impl<'input> Send for Unit<'input>

§

impl<'input> Sync for Unit<'input>

§

impl<'input> Unpin for Unit<'input>

§

impl<'input> UnwindSafe for Unit<'input>

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>,

Source§

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>,

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.