pub struct NativeBackend { /* private fields */ }Expand description
Native x86 interpreter backend backed by the Rust port of v86’s CPU core.
The current adapter is deliberately single-machine: the v86 CPU core uses process-global pointers, so two NativeBackend instances must not execute at the same time in one process.
Implementations§
Source§impl NativeBackend
impl NativeBackend
pub fn new() -> Self
pub fn with_instructions_per_step(self, value: u32) -> Self
pub fn cpu(&self) -> Option<&NativeCpu>
pub fn cpu_mut(&mut self) -> Option<&mut NativeCpu>
pub fn with_9p_root(self, path: impl AsRef<Path>) -> Self
pub fn set_9p_root(&mut self, path: impl AsRef<Path>) -> Result<()>
Trait Implementations§
Source§impl Default for NativeBackend
impl Default for NativeBackend
Source§impl ExecutionBackend for NativeBackend
impl ExecutionBackend for NativeBackend
fn reset(&mut self, config: &MachineConfig) -> Result<()>
Source§fn restore_state(&mut self, state: &SavedState) -> Result<()>
fn restore_state(&mut self, state: &SavedState) -> Result<()>
Restore an attached v86 saved state after reset. Backends that do not
support saved states may keep the default no-op implementation.
fn step(&mut self) -> Result<bool>
fn read_memory(&self, address: u64, buffer: &mut [u8]) -> Result<()>
fn write_memory(&mut self, address: u64, data: &[u8]) -> Result<()>
Auto Trait Implementations§
impl Freeze for NativeBackend
impl RefUnwindSafe for NativeBackend
impl Send for NativeBackend
impl Sync for NativeBackend
impl Unpin for NativeBackend
impl UnsafeUnpin for NativeBackend
impl UnwindSafe for NativeBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more