Struct csx64::exec::Memory [−][src]
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]
&mut self,
pos: u64,
value: &[u8]
) -> Result<(), ExecError>
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
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]
T: 'static + ?Sized,
impl<T> Az for T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedAs for T
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
T: CheckedCast<Dst>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> OverflowingAs for T
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
T: OverflowingCast<Dst>,
impl<T> SaturatingAs for T
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
T: SaturatingCast<Dst>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnwrappedAs for T
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
T: UnwrappedCast<Dst>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WrappingAs for T
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
T: WrappingCast<Dst>,