pub enum DebugSymbols {
    Unloaded(WeakFileRef),
    Loaded(DebugSections),
}
Expand description

An enum describing the possible forms of debug information for a crate.

Variants§

§

Unloaded(WeakFileRef)

Debug information that hasn’t yet been parsed from the given file. We use a weak reference to the file because it’s not mandatory to have debug symbols.

§

Loaded(DebugSections)

The debug information has already been parsed from the file

Implementations§

source§

impl DebugSymbols

source

pub fn load( &mut self, loaded_crate: &StrongCrateRef, namespace: &CrateNamespace ) -> Result<&DebugSections, &'static str>

Loads the debug symbols from the enclosed weak file reference that correspond to the given LoadedCrate and using symbols from the given CrateNamespace.

If these DebugSymbols are already loaded, this is a no-op and simply returns those loaded DebugSections.

source

pub fn get_loaded(&self) -> Option<&DebugSections>

A convenience method for accessing the already-loaded DebugSections within. Returns None if the symbols are not currently loaded.

source

pub fn unload(&mut self) -> Option<DebugSections>

Unloads these DebugSymbols, returning the enclosed DebugSections if they were already loaded. If not, this is a no-op and returns None.

This is useful to free the large memory regions needed for debug information, and also to release dependencies on other crates’ sections.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.