Struct svmap::MemoryLayout

source ·
pub struct MemoryLayout<M: Clone, V: Clone> { /* private fields */ }
Expand description

Contains the result of compiled SVMap.

Implementations§

source§

impl<M: Clone, V: Clone> MemoryLayout<M, V>

source

pub fn from_file( path: &str, region_interpreter: fn(_: &str) -> Result<M, &str>, vector_interpreter: fn(_: &str) -> Result<V, &str> ) -> Result<Self, Error>

Returns a MemoryLayout struct from a given filepath.

The region_interpreter and the vector_interpreter convert a &str to the corresponding (user defined) description.

source

pub fn from_lines( lines: String, region_interpreter: fn(_: &str) -> Result<M, &str>, vector_interpreter: fn(_: &str) -> Result<V, &str> ) -> Result<Self, Error>

Returns a MemoryLayout struct from a given String.

The region_interpreter and the vector_interpreter convert a &str to the corresponding (user defined) description.

source

pub fn get_unassigned_regions(&self, description: M) -> Vec<MemoryRegion<M>>

Returns all the unassigned memory regions between 0 and the last MemoryRegions lower bound with the user defined description.

source

pub fn address_is_assigned(&self, address: AddressType) -> bool

Returns true if a address is inside of a MemoryRegion (and thus is assigned).

Trait Implementations§

source§

impl<M: Debug + Clone, V: Debug + Clone> Debug for MemoryLayout<M, V>

source§

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

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

impl<M: PartialEq + Clone, V: PartialEq + Clone> PartialEq<MemoryLayout<M, V>> for MemoryLayout<M, V>

source§

fn eq(&self, other: &MemoryLayout<M, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<M: Eq + Clone, V: Eq + Clone> Eq for MemoryLayout<M, V>

source§

impl<M: Clone, V: Clone> StructuralEq for MemoryLayout<M, V>

source§

impl<M: Clone, V: Clone> StructuralPartialEq for MemoryLayout<M, V>

Auto Trait Implementations§

§

impl<M, V> RefUnwindSafe for MemoryLayout<M, V>where M: RefUnwindSafe, V: RefUnwindSafe,

§

impl<M, V> Send for MemoryLayout<M, V>where M: Send, V: Send,

§

impl<M, V> Sync for MemoryLayout<M, V>where M: Sync, V: Sync,

§

impl<M, V> Unpin for MemoryLayout<M, V>where M: Unpin, V: Unpin,

§

impl<M, V> UnwindSafe for MemoryLayout<M, V>where M: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

§

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

§

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.