Struct pdb_addr2line::ContextPdbData[][src]

pub struct ContextPdbData<'s> { /* fields omitted */ }
Expand description

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

let mut pdb = pdb::PDB::open(stream)?;
let context_data = pdb_addr2line::ContextPdbData::try_from_pdb(&mut 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

impl<'s> ContextPdbData<'s>[src]

pub fn try_from_pdb<S: Source<'s> + 's>(pdb: &mut PDB<'s, S>) -> Result<Self>[src]

Create a ContextPdbData from a PDB. This parses many of the PDB streams and stores them in the ContextPdbData. Most importantly, it builds a list of all the ModuleInfo objects in the PDB.

pub fn make_context(&self) -> Result<Context<'_, 's, '_>>[src]

Create a Context. This uses the default TypeFormatter settings.

pub fn make_context_with_formatter_flags(
    &self,
    flags: TypeFormatterFlags
) -> Result<Context<'_, 's, '_>>
[src]

Create a Context, using the specified TypeFormatter flags.

Auto Trait Implementations

impl<'s> !RefUnwindSafe for ContextPdbData<'s>

impl<'s> !Send for ContextPdbData<'s>

impl<'s> !Sync for ContextPdbData<'s>

impl<'s> Unpin for ContextPdbData<'s>

impl<'s> !UnwindSafe for ContextPdbData<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.