pub struct Section { /* private fields */ }Implementations§
Source§impl Section
impl Section
pub fn new( name: String, kind: SectionKind, start_address: u32, end_address: u32, alignment: u32, ) -> Result<Self, SectionError>
pub fn with_functions( name: String, kind: SectionKind, start_address: u32, end_address: u32, alignment: u32, functions: BTreeMap<u32, Function>, ) -> Result<Self, SectionError>
pub fn inherit( other: &Section, start_address: u32, end_address: u32, ) -> Result<Self, SectionError>
pub fn code_from_module<'a>( &'a self, module: &'a Module<'_>, ) -> Result<Option<&'a [u8]>, SectionCodeError>
pub fn code<'a>( &'a self, code: &'a [u8], base_address: u32, ) -> Result<Option<&'a [u8]>, SectionCodeError>
pub fn size(&self) -> u32
Sourcepub fn iter_words<'a>(
&'a self,
code: &'a [u8],
range: Option<Range<u32>>,
) -> impl Iterator<Item = Word> + 'a
pub fn iter_words<'a>( &'a self, code: &'a [u8], range: Option<Range<u32>>, ) -> impl Iterator<Item = Word> + 'a
Iterates over every 32-bit word in the specified range, which defaults to the entire section if it is None. Note
that code must be the full raw content of this section.
pub fn name(&self) -> &str
pub fn kind(&self) -> SectionKind
pub fn start_address(&self) -> u32
pub fn end_address(&self) -> u32
pub fn address_range(&self) -> Range<u32>
pub fn alignment(&self) -> u32
pub fn overlaps_with(&self, other: &Section) -> bool
pub fn functions(&self) -> &BTreeMap<u32, Function>
pub fn functions_mut(&mut self) -> &mut BTreeMap<u32, Function>
pub fn add_function(&mut self, function: Function)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnwindSafe for Section
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more