Struct gimli::read::EntriesTree
source · [−]pub struct EntriesTree<'abbrev, 'unit, R> where
R: Reader, { /* private fields */ }
Expand description
The state information for a tree view of the Debugging Information Entries.
The EntriesTree
can be used to recursively iterate through the DIE
tree, following the parent/child relationships. The EntriesTree
contains
shared state for all nodes in the tree, avoiding any duplicate parsing of
entries during the traversal.
Example Usage
let unit = get_some_unit();
let abbrevs = get_abbrevs_for_unit(&unit);
let mut tree = unit.entries_tree(&abbrevs, None)?;
let root = tree.root()?;
process_tree(root)?;
fn process_tree<R>(mut node: gimli::EntriesTreeNode<R>) -> gimli::Result<()>
where R: gimli::Reader
{
{
// Examine the entry attributes.
let mut attrs = node.entry().attrs();
while let Some(attr) = attrs.next()? {
}
}
let mut children = node.children();
while let Some(child) = children.next()? {
// Recursively process a child.
process_tree(child);
}
Ok(())
}
Implementations
sourceimpl<'abbrev, 'unit, R: Reader> EntriesTree<'abbrev, 'unit, R>
impl<'abbrev, 'unit, R: Reader> EntriesTree<'abbrev, 'unit, R>
sourcepub fn root<'me>(
&'me mut self
) -> Result<EntriesTreeNode<'abbrev, 'unit, 'me, R>>
pub fn root<'me>(
&'me mut self
) -> Result<EntriesTreeNode<'abbrev, 'unit, 'me, R>>
Returns the root node of the tree.
Trait Implementations
sourceimpl<'abbrev, 'unit, R: Clone> Clone for EntriesTree<'abbrev, 'unit, R> where
R: Reader,
impl<'abbrev, 'unit, R: Clone> Clone for EntriesTree<'abbrev, 'unit, R> where
R: Reader,
sourcefn clone(&self) -> EntriesTree<'abbrev, 'unit, R>
fn clone(&self) -> EntriesTree<'abbrev, 'unit, R>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'abbrev, 'unit, R> !RefUnwindSafe for EntriesTree<'abbrev, 'unit, R>
impl<'abbrev, 'unit, R> Send for EntriesTree<'abbrev, 'unit, R> where
R: Send + Sync,
<R as Reader>::Offset: Send + Sync,
impl<'abbrev, 'unit, R> !Sync for EntriesTree<'abbrev, 'unit, R>
impl<'abbrev, 'unit, R> Unpin for EntriesTree<'abbrev, 'unit, R> where
R: Unpin,
<R as Reader>::Offset: Unpin,
impl<'abbrev, 'unit, R> UnwindSafe for EntriesTree<'abbrev, 'unit, R> where
R: UnwindSafe + RefUnwindSafe,
<R as Reader>::Offset: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more