Skip to main content

ConvertUnitEntry

Struct ConvertUnitEntry 

Source
#[non_exhaustive]
pub struct ConvertUnitEntry<'a, R: Reader<Offset = usize>> { pub read_unit: UnitRef<'a, R>, pub read_entry: DebuggingInformationEntry<R>, pub sibling: bool, pub parent: Option<UnitEntryId>, }
Expand description

A DIE read by ConvertUnit::read_entry.

This is a simple wrapper that adds some extra information to read::DebuggingInformationEntry. The inner Self::read_entry is accessible via Deref.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§read_unit: UnitRef<'a, R>

The unit that this DIE was read from.

This may be a skeleton unit.

§read_entry: DebuggingInformationEntry<R>

The DIE that was read.

§sibling: bool

True if the DW_AT_sibling attribute was present.

§parent: Option<UnitEntryId>

The id of the entry that was reserved for this DIE’s parent, if any.

You may ignore this value if you wish to use a different parent. This is set to None if the parent is unknown or is the root DIE.

Implementations§

Source§

impl<'a, R: Reader<Offset = usize>> ConvertUnitEntry<'a, R>

Source

pub fn null(read_unit: UnitRef<'a, R>) -> Self

Return a null entry.

This can be used with ConvertUnit::read_entry,

Source

pub fn read( read_unit: UnitRef<'a, R>, offset: UnitOffset, ) -> ConvertResult<ConvertUnitEntry<'a, R>>

Read the DIE at the given offset.

This does not affect the state of the reader. The returned entry will not have a valid depth or parent. This may be used for entries that were not filtered or reserved.

Returns an error if there is no entry at the given offset.

Methods from Deref<Target = DebuggingInformationEntry<R>>§

Source

pub fn is_null(&self) -> bool

Return true if the entry tag is DW_TAG_null.

Source

pub fn depth(&self) -> isize

Get the tree depth of this entry relative to the entry where reading started.

Source

pub fn offset(&self) -> UnitOffset<Offset>

Get this entry’s offset.

Source

pub fn tag(&self) -> DwTag

Get this entry’s tag.

Source

pub fn has_children(&self) -> bool

Return true if this entry’s type can have children, false otherwise.

Source

pub fn attrs(&self) -> &[Attribute<R>]

Return this entry’s set of attributes.

Source

pub fn has_attr(&self, name: DwAt) -> bool

Return true if this entry has an attribute with the given name.

Source

pub fn attr(&self, name: DwAt) -> Option<&Attribute<R>>

Find the first attribute in this entry which has the given name.

Returns None if no attribute is found.

Source

pub fn attr_value_raw(&self, name: DwAt) -> Option<AttributeValue<R>>

Find the first attribute in this entry which has the given name, and return its raw value.

Returns None if no attribute is found.

Source

pub fn attr_value(&self, name: DwAt) -> Option<AttributeValue<R>>

Find the first attribute in this entry which has the given name, and return its normalized value.

Returns None if no attribute is found.

Trait Implementations§

Source§

impl<'a, R: Debug + Reader<Offset = usize>> Debug for ConvertUnitEntry<'a, R>

Source§

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

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

impl<'a, R: Reader<Offset = usize>> Deref for ConvertUnitEntry<'a, R>

Source§

type Target = DebuggingInformationEntry<R>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, R> Freeze for ConvertUnitEntry<'a, R>

§

impl<'a, R> RefUnwindSafe for ConvertUnitEntry<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for ConvertUnitEntry<'a, R>
where R: Sync + Send,

§

impl<'a, R> Sync for ConvertUnitEntry<'a, R>
where R: Sync + Send,

§

impl<'a, R> Unpin for ConvertUnitEntry<'a, R>
where R: Unpin,

§

impl<'a, R> UnsafeUnpin for ConvertUnitEntry<'a, R>

§

impl<'a, R> UnwindSafe for ConvertUnitEntry<'a, R>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.