Section

Struct Section 

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

A Section is consecutive group of symbols that share the same permissions

Implementations§

Source§

impl Section

Source

pub fn last_addr(&self) -> VAddr

The last virtual address occupied by this section (size - 1)

Source

pub fn contains_address(&self, vaddr: VAddr) -> bool

Check whether this section contains the givem virtual address

Source

pub fn size(&self) -> usize

The size of this section

Source

pub fn perms(&self) -> Perms

The permissions of this section

Source

pub fn vaddr(&self) -> VAddr

The virtual address of this section

Source

pub fn set_size(&mut self, size: usize)

Change the size of this section

Source

pub fn set_perms(&mut self, perms: Perms)

Change the permissions of this section

Source

pub fn set_vaddr(&mut self, vaddr: VAddr)

Change the virtual address of this section

Source

pub fn builder() -> SectionBuilder

Create a SectionBuilder that can build Sections from scratch

Source§

impl Section

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 symbol(&self, id: Id) -> Option<&Symbol>

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

Source

pub fn num_symbols(&self) -> usize

Get the number of children for this process image element

Source

pub fn cursor_symbol(&self) -> Option<&Symbol>

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

Source

pub fn cursor_symbol_mut(&mut self) -> Option<&mut Symbol>

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

Source

pub fn insert_symbol(&mut self, child: Symbol) -> Id

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

Source

pub fn delete_symbol(&mut self) -> Symbol

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

Source

pub fn iter_symbols(&self) -> Iter<'_, Symbol>

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

Source

pub fn iter_symbols_mut(&mut self) -> IterMut<'_, Symbol>

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

Source

pub fn symbol_mut(&mut self, id: Id) -> Option<&mut Symbol>

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

Trait Implementations§

Source§

impl Debug for Section

Source§

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

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

impl HasId for Section

Source§

fn id(&self) -> Id

Retrieve the ID of this element
Source§

impl Hash for Section

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§

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.