Struct libdw::Dwarf

source · []
pub struct Dwarf<'dw> { /* private fields */ }

Implementations

Open a Dwarf from a path.

Examples
let exe = std::env::current_exe().unwrap();
let dw = libdw::Dwarf::open(exe).unwrap();

Create a Dwarf from an open file.

Examples
let exe = std::env::current_exe().unwrap();
let f = std::fs::File::open(exe).unwrap();
let dw = libdw::Dwarf::from_fd(&f).unwrap();

Create a Dwarf from an existing Elf.

Examples
let exe = std::env::current_exe().unwrap();
let elf = libelf::Elf::open(exe).unwrap();
let dw = libdw::Dwarf::from_elf(&elf).unwrap();

Create a Dwarf from a raw FFI pointer.

Safety

This function is unsafe because there is no guarantee that the given pointer is a valid libdw handle, nor whether the lifetime inferred is appropriate. This does not take ownership of the underlying object, so the caller must ensure it outlives the returned Dwarf wrapper.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.