Struct rsim::processor::elements::memory::MemoryBacking[][src]

pub struct MemoryBacking {
    data: Vec<u8>,
    range: Range<usize>,
}

Array-backed memory

Defines a valid address range - all addresses passed into read/write must be within this range

Implements MemoryOf, MemoryOf, MemoryOf, MemoryOf

Fields

Fields

data: Vec<u8>range: Range<usize>

Implementations

impl MemoryBacking[src]

pub fn zeros(range: Range<usize>) -> MemoryBacking[src]

Generate a vector of zeros and map it to an address range.

pub fn from_vec(vec: Vec<u8>, range: Range<usize>) -> MemoryBacking[src]

Map a set of bytes to an address range. Any empty space between the end of the file data and the end of the range will be zero-padded.

pub fn from_file(path_s: &str, range: Range<usize>) -> MemoryBacking[src]

Read bytes from a file and map them to an address range. The file data will be read into the start of the range, any empty space between the end of the file data and the end of the range will be zero-padded.

Trait Implementations

impl From<MemoryBacking> for AggregateMemory[src]

For convenience, allow a single MemoryBacking to be converted directly to an AggregateMemory

impl Memory<u64> for MemoryBacking[src]

impl MemoryOf<u16, u64> for MemoryBacking[src]

impl MemoryOf<u32, u64> for MemoryBacking[src]

impl MemoryOf<u64, u64> for MemoryBacking[src]

impl MemoryOf<u8, u64> for MemoryBacking[src]

Auto Trait Implementations

impl RefUnwindSafe for MemoryBacking

impl Send for MemoryBacking

impl Sync for MemoryBacking

impl Unpin for MemoryBacking

impl UnwindSafe for MemoryBacking

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.