pub struct ContextPdbData<'p, 's, S: Source<'s> + 's> { /* private fields */ }
Expand description

Allows to easily create a Context directly from a pdb::PDB.

let pdb = pdb::PDB::open(stream)?;
let context_data = pdb_addr2line::ContextPdbData::try_from_pdb(pdb)?;
let context = context_data.make_context()?;

Implementation note: It would be nice if a Context could be created from a PDB directly, without going through an intermediate ContextPdbData object. However, there doesn’t seem to be an easy way to do this, due to certain lifetime dependencies: The Context object wants to store certain objects inside itself (mostly for caching) which have a lifetime dependency on pdb::ModuleInfo, so the ModuleInfo has to be owned outside of the Context. So the ContextPdbData object acts as that external ModuleInfo owner.

Implementations

Create a ContextPdbData from a PDB. This parses many of the PDB streams and stores them in the ContextPdbData. This creator function takes ownership of the pdb object and never gives it back.

Create a ContextPdbData from a PDB. This parses many of the PDB streams and stores them in the ContextPdbData. This creator function takes an exclusive reference to the pdb object, for consumers that want to keep using the pdb object once the ContextPdbData object is dropped.

Create a TypeFormatter. This uses the default TypeFormatter settings.

Create a TypeFormatter, using the specified TypeFormatter flags.

Create a Context. This uses the default TypeFormatter settings.

Create a Context, using the specified TypeFormatterFlags.

Trait Implementations

Get the module info for this module from the PDB.

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.