[][src]Trait gimli::read::Section

pub trait Section<R>: From<R> {
    fn id() -> SectionId;
fn reader(&self) -> &R
    where
        R: Reader
; fn section_name() -> &'static str { ... }
fn load<F, E>(f: F) -> Result<Self, E>
    where
        F: FnOnce(SectionId) -> Result<R, E>
, { ... }
fn lookup_offset_id(
        &self,
        id: ReaderOffsetId
    ) -> Option<(SectionId, R::Offset)>
    where
        R: Reader
, { ... } }

A convenience trait for loading DWARF sections from object files. To be used like:

use gimli::{DebugInfo, EndianSlice, LittleEndian, Reader, Section};

let buf = [0x00, 0x01, 0x02, 0x03];
let reader = EndianSlice::new(&buf, LittleEndian);
let loader = |name| -> Result<_, ()> { Ok(reader) };

let debug_info: DebugInfo<_> = Section::load(loader).unwrap();

Required methods

fn id() -> SectionId

Returns the section id for this type.

fn reader(&self) -> &R where
    R: Reader

Returns the Reader for this section.

Loading content...

Provided methods

fn section_name() -> &'static str

Returns the ELF section name for this type.

fn load<F, E>(f: F) -> Result<Self, E> where
    F: FnOnce(SectionId) -> Result<R, E>, 

Try to load the section using the given loader function.

fn lookup_offset_id(&self, id: ReaderOffsetId) -> Option<(SectionId, R::Offset)> where
    R: Reader

Returns the Reader for this section.

Loading content...

Implementors

impl<R> Section<R> for DebugAbbrev<R>[src]

impl<R> Section<R> for DebugAddr<R>[src]

impl<R> Section<R> for DebugInfo<R>[src]

impl<R> Section<R> for DebugLine<R>[src]

impl<R> Section<R> for DebugLineStr<R>[src]

impl<R> Section<R> for DebugLoc<R>[src]

impl<R> Section<R> for DebugLocLists<R>[src]

impl<R> Section<R> for DebugRanges<R>[src]

impl<R> Section<R> for DebugRngLists<R>[src]

impl<R> Section<R> for DebugStr<R>[src]

impl<R> Section<R> for DebugStrOffsets<R>[src]

impl<R> Section<R> for DebugTypes<R>[src]

impl<R: Reader> Section<R> for DebugAranges<R>[src]

impl<R: Reader> Section<R> for DebugFrame<R>[src]

impl<R: Reader> Section<R> for DebugPubNames<R>[src]

impl<R: Reader> Section<R> for DebugPubTypes<R>[src]

impl<R: Reader> Section<R> for EhFrame<R>[src]

impl<R: Reader> Section<R> for EhFrameHdr<R>[src]

Loading content...