[−][src]Struct symbolic_debuginfo::SymbolMap
A sorted list of symbols, suitable for quick lookups.
This type can either be computed from a list or iterator of symbols, or preferrably directly
by calling ObjectLike::symbol_map
on any object. Symbols in the symbol map are guaranteed to
have a size
set, except for the last symbol, which is computed by taking the offset to the
subsequent symbol.
SymbolMap
also exposes a read-only view on the sorted slice of symbols. It can be converted to
and from lists of symbols.
Example
let map = SymbolMap::from(vec![ Symbol { name: Some("A".into()), address: 0x4400, size: 0 }, Symbol { name: Some("B".into()), address: 0x4200, size: 0 }, Symbol { name: Some("C".into()), address: 0x4000, size: 0 }, ]); assert_eq!(map[0], Symbol { name: Some("C".into()), address: 0x4000, size: 0x200, });
Methods
impl<'data> SymbolMap<'data>
[src]
pub fn new() -> Self
[src]
Creates a new, empty symbol map.
pub fn lookup(&self, address: u64) -> Option<&Symbol<'data>>
[src]
Looks up a symbol in the symbol map.
pub fn lookup_range<R>(&self, range: R) -> Option<&Symbol<'data>> where
R: RangeBounds<u64>,
[src]
R: RangeBounds<u64>,
Looks up a symbol covering an entire range.
This is similar to lookup
, but it only returns the symbol result if it also covers the
inclusive end address of the range.
Trait Implementations
impl<'d> AsRef<[Symbol<'d>]> for SymbolMap<'d>
[src]
impl<'data> Clone for SymbolMap<'data>
[src]
impl<'data> Debug for SymbolMap<'data>
[src]
impl<'data> Default for SymbolMap<'data>
[src]
impl<'d> Deref for SymbolMap<'d>
[src]
type Target = [Symbol<'d>]
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<'d> From<Vec<Symbol<'d>>> for SymbolMap<'d>
[src]
impl<'d> FromIterator<Symbol<'d>> for SymbolMap<'d>
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Symbol<'d>>,
[src]
I: IntoIterator<Item = Symbol<'d>>,
impl<'data> IntoIterator for SymbolMap<'data>
[src]
type Item = Symbol<'data>
The type of the elements being iterated over.
type IntoIter = SymbolMapIter<'data>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'data, 'a> IntoIterator for &'a SymbolMap<'data>
[src]
Auto Trait Implementations
impl<'data> RefUnwindSafe for SymbolMap<'data>
impl<'data> Send for SymbolMap<'data>
impl<'data> Sync for SymbolMap<'data>
impl<'data> Unpin for SymbolMap<'data>
impl<'data> UnwindSafe for SymbolMap<'data>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,