Elf

Struct Elf 

Source
pub struct Elf { /* private fields */ }
Expand description

An Elf file in the process image is a container for Sections

Implementations§

Source§

impl Elf

Source

pub fn path(&self) -> &Path

The path to the underlying ELF file, this Elf struct was generated from

Source

pub fn builder() -> ElfBuilder

Create an ElfBuilder to create Elf files from scratch

Source§

impl Elf

Accessor methods that handle the children of this process image element

Source

pub fn cursor(&self) -> usize

Get the cursor of this process image element

Source

pub fn set_cursor(&mut self, cursor: usize)

Set the cursor of this process image element

Source

pub fn move_cursor_beyond_end(&mut self)

Move the cursor of this process image element to the end of its children list. This enables appending children.

Source

pub fn move_cursor_forward(&mut self) -> bool

Increment the cursor of this process image element or return false if the cursor is already at the last child

Source

pub fn move_cursor_backwards(&mut self) -> bool

Decrement the cursor of this process image element or return false if it’s already at the first child

Source

pub fn section(&self, id: Id) -> Option<&Section>

Retrieve the child with the given ID of this process image element

Source

pub fn num_sections(&self) -> usize

Get the number of children for this process image element

Source

pub fn cursor_section(&self) -> Option<&Section>

Get the child at the current cursor position for this process image element

Source

pub fn cursor_section_mut(&mut self) -> Option<&mut Section>

Get the child at the current cursor position for this process image element

Source

pub fn insert_section(&mut self, child: Section) -> Id

Insert the given child into the list of children at the current cursor position for this process image element

Source

pub fn delete_section(&mut self) -> Section

Delete the child at the current cursor position of this process image element and return it

Source

pub fn iter_sections(&self) -> Iter<'_, Section>

Iterate over all children of this process image element independent of the current cursor position

Source

pub fn iter_sections_mut(&mut self) -> IterMut<'_, Section>

Iterate over all children of this process image element independent of the current cursor position

Source

pub fn section_mut(&mut self, id: Id) -> Option<&mut Section>

Retrieve the child with the given ID of this process image element

Trait Implementations§

Source§

impl Debug for Elf

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl HasId for Elf

Source§

fn id(&self) -> Id

Retrieve the ID of this element
Source§

impl Hash for Elf

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

§

impl Freeze for Elf

§

impl RefUnwindSafe for Elf

§

impl Send for Elf

§

impl Sync for Elf

§

impl Unpin for Elf

§

impl UnwindSafe for Elf

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Source§

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.