Skip to main content

NativeCpu

Struct NativeCpu 

Source
pub struct NativeCpu<IO: HostIO> {
    pub host_io: Option<IO>,
    /* private fields */
}

Fields§

§host_io: Option<IO>

Implementations§

Source§

impl<IO: HostIO> NativeCpu<IO>

Source

pub fn set_addresses_as_integers(&mut self, addresses_as_integers: bool)

Source

pub fn print_state(&self)

Source

pub fn set_halted(&mut self, halted: bool)

Source

pub fn get_halted(&self) -> bool

Source

pub fn set_print_memory_access(&mut self, print_memory_access: bool)

Source

pub fn set_verbose(&mut self, verbose: bool)

Source

pub fn set_entrypoint(&mut self, entrypoint: u32)

Source

pub fn protect(&mut self, range: Range<u32>)

Source

pub fn load_protected_memory(&mut self, address: u32, memory: &[u32])

Source

pub fn load_memory(&mut self, address: u32, memory: &[u32])

Source

pub fn execute(&mut self, run_mode: RunMode) -> Result<CpuStats, ExecutionError>

Source

pub fn get_registers(&self) -> &[u32]

Source

pub fn get_mut_registers(&mut self) -> &mut [u32]

Source

pub fn get_memory(&self) -> &[u32]

Source

pub fn new(memory_size: u32, registers: u8, host_io: IO) -> Self

Trait Implementations§

Source§

impl<IO: Debug + HostIO> Debug for NativeCpu<IO>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<IO> Freeze for NativeCpu<IO>
where IO: Freeze,

§

impl<IO> RefUnwindSafe for NativeCpu<IO>
where IO: RefUnwindSafe,

§

impl<IO> Send for NativeCpu<IO>
where IO: Send,

§

impl<IO> Sync for NativeCpu<IO>
where IO: Sync,

§

impl<IO> Unpin for NativeCpu<IO>
where IO: Unpin,

§

impl<IO> UnsafeUnpin for NativeCpu<IO>
where IO: UnsafeUnpin,

§

impl<IO> UnwindSafe for NativeCpu<IO>
where IO: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Source§

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.