Struct Expansion

Source
pub struct Expansion<'a> {
    pub filenames: Vec<&'a str>,
    pub branches: Vec<Branch>,
    pub source_region: Region,
    pub target_regions: Vec<Region>,
}
Expand description

Metrics of an expansion, i.e., a expanded macro or include statement.

Fields§

§filenames: Vec<&'a str>

Vector that is references via index by the branches, source_region and target_regions attribute in order to refer to a specific file.

§branches: Vec<Branch>

All branches in a file that is included into other files. E.g., these are the branches in the header file self.filenames[self.branches[x].file_id]. A Branch object may reference a macro such as #define LTC_ARGCHK(x) do { if (!(x)) { … } }, or, to be more specific, the column/row value would point to ‘if (!(x))’. TODO: Where does branch.expanded_file_id points to?

§source_region: Region

The source and destination of the expansion (i.e., macro/include statement). Indexing the filenames array with the source_region.file_id returns the path of the file in which the macro/include was used. The source_region.line_* and source_region.column_* attrbiutes refer to the code location where in macro was used. The source_region.expanded_file_id can be used as index for the filenames array to get the file path where the expanded macro or included file is located.

§target_regions: Vec<Region>

Trait Implementations§

Source§

impl<'a> Debug for Expansion<'a>

Source§

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

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

impl<'de: 'a, 'a> Deserialize<'de> for Expansion<'a>

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<'a> PartialEq for Expansion<'a>

Source§

fn eq(&self, other: &Expansion<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for Expansion<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Expansion<'a>

§

impl<'a> RefUnwindSafe for Expansion<'a>

§

impl<'a> Send for Expansion<'a>

§

impl<'a> Sync for Expansion<'a>

§

impl<'a> Unpin for Expansion<'a>

§

impl<'a> UnwindSafe for Expansion<'a>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,