Struct csx64::exec::Memory[][src]

pub struct Memory { /* fields omitted */ }

The memory module of an emulator.

Implementations

impl Memory[src]

pub fn len(&self) -> usize[src]

Gets the length of the currently allocated block of memory.

pub fn get(&self, pos: u64, len: u64) -> Result<&[u8], ExecError>[src]

Grabs a contiguous block of memory. Fails if the block goes out of bounds.

pub fn get_mut(&mut self, pos: u64, len: u64) -> Result<&mut [u8], ExecError>[src]

Similar to get but returns a mutable slice. Additionally, fails if grabbing from readonly memory.

pub fn set(&mut self, pos: u64, value: &[u8]) -> Result<(), ExecError>[src]

Assigns a binary value to memory. Equivalent to assigning to the result of get_mut. On failure, the internal state is unmodified.

pub fn get_null_terminated(&self, pos: u64) -> Result<&[u8], ExecError>[src]

Reads a null-terminated binary string starting at the given position. The null terminator is not included in the result. If pos itself is a null terminator, returns an empty slice. Fails if no null terminator is found or the range goes out of bounds.

pub fn set_null_terminated(
    &mut self,
    pos: u64,
    value: &[u8]
) -> Result<(), ExecError>
[src]

Writes a null-terminated binary string to the given position. Note that the value need not be null terminated: we simply append a terminator in the internal representation. Indeed, zeros in the value are included verbatim, though they will not be present with the matching read function. Fails if the result goes out of bounds or intersects readonly memory. On failure, the internal state is unmodified.

pub fn get_u8(&self, pos: u64) -> Result<u8, ExecError>[src]

pub fn set_u8(&mut self, pos: u64, val: u8) -> Result<(), ExecError>[src]

pub fn get_u16(&self, pos: u64) -> Result<u16, ExecError>[src]

pub fn set_u16(&mut self, pos: u64, val: u16) -> Result<(), ExecError>[src]

pub fn get_u32(&self, pos: u64) -> Result<u32, ExecError>[src]

pub fn set_u32(&mut self, pos: u64, val: u32) -> Result<(), ExecError>[src]

pub fn get_u64(&self, pos: u64) -> Result<u64, ExecError>[src]

pub fn set_u64(&mut self, pos: u64, val: u64) -> Result<(), ExecError>[src]

pub fn get_i8(&self, pos: u64) -> Result<i8, ExecError>[src]

pub fn set_i8(&mut self, pos: u64, val: i8) -> Result<(), ExecError>[src]

pub fn get_i16(&self, pos: u64) -> Result<i16, ExecError>[src]

pub fn set_i16(&mut self, pos: u64, val: i16) -> Result<(), ExecError>[src]

pub fn get_i32(&self, pos: u64) -> Result<i32, ExecError>[src]

pub fn set_i32(&mut self, pos: u64, val: i32) -> Result<(), ExecError>[src]

pub fn get_i64(&self, pos: u64) -> Result<i64, ExecError>[src]

pub fn set_i64(&mut self, pos: u64, val: i64) -> Result<(), ExecError>[src]

pub fn get_f32(&self, pos: u64) -> Result<f32, ExecError>[src]

pub fn set_f32(&mut self, pos: u64, val: f32) -> Result<(), ExecError>[src]

pub fn get_f64(&self, pos: u64) -> Result<f64, ExecError>[src]

pub fn set_f64(&mut self, pos: u64, val: f64) -> Result<(), ExecError>[src]

pub fn get_f80(&self, pos: u64) -> Result<F80, ExecError>[src]

pub fn set_f80(&mut self, pos: u64, val: F80) -> Result<(), ExecError>[src]

Trait Implementations

impl Default for Memory[src]

Auto Trait Implementations

impl RefUnwindSafe for Memory

impl Send for Memory

impl Sync for Memory

impl Unpin for Memory

impl UnwindSafe for Memory

Blanket Implementations

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

impl<T> Az for T[src]

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

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

impl<T> CheckedAs for T[src]

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

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

impl<T> OverflowingAs for T[src]

impl<T> SaturatingAs for 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.

impl<T> UnwrappedAs for T[src]

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

impl<T> WrappingAs for T[src]