pub struct SparseMemory<R> { /* private fields */ }
Expand description

A sparse flat memory implementation, it allocates pages only when requested, but besides that, it does not permission checking.

Implementations§

source§

impl<R> SparseMemory<R>

source

pub fn new() -> Self

Trait Implementations§

source§

impl<R> Default for SparseMemory<R>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<R: Register> Memory for SparseMemory<R>

§

type REG = R

source§

fn init_pages( &mut self, addr: u64, size: u64, _flags: u8, source: Option<Bytes>, offset_from_addr: u64 ) -> Result<(), Error>

source§

fn fetch_flag(&mut self, page: u64) -> Result<u8, Error>

source§

fn set_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>

source§

fn clear_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>

source§

fn load8(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>

source§

fn load16(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>

source§

fn load32(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>

source§

fn load64(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>

source§

fn execute_load16(&mut self, addr: u64) -> Result<u16, Error>

source§

fn execute_load32(&mut self, addr: u64) -> Result<u32, Error>

source§

fn store_bytes(&mut self, addr: u64, value: &[u8]) -> Result<(), Error>

source§

fn store_byte(&mut self, addr: u64, size: u64, value: u8) -> Result<(), Error>

source§

fn store8(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>

source§

fn store16(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>

source§

fn store32(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>

source§

fn store64(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for SparseMemory<R>where R: RefUnwindSafe,

§

impl<R> Send for SparseMemory<R>where R: Send,

§

impl<R> Sync for SparseMemory<R>where R: Sync,

§

impl<R> Unpin for SparseMemory<R>where R: Unpin,

§

impl<R> UnwindSafe for SparseMemory<R>where R: 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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V