pub struct VM {
pub registers: [i32; 32],
pub float_registers: [f64; 32],
pub program: Vec<u8>,
pub logical_cores: usize,
pub alias: Option<String>,
pub connection_manager: Arc<RwLock<Manager>>,
pub id: Uuid,
pub server_port: Option<String>,
/* private fields */
}Expand description
Virtual machine struct that will execute bytecode
Fields§
§registers: [i32; 32]Array that simulates having hardware registers
float_registers: [f64; 32]Array that simulates having floating point hardware registers
program: Vec<u8>The bytecode of the program being run
logical_cores: usizeNumber of logical cores the system reports
alias: Option<String>An alias that can be specified by the user and used to refer to the Node
connection_manager: Arc<RwLock<Manager>>Data structure to manage remote clients
id: UuidIs a unique, randomly generated UUID for identifying this VM
server_port: Option<String>Port the server will bind to for server-to-server communications
Implementations§
Source§impl VM
impl VM
Sourcepub fn run(&mut self) -> Vec<VMEvent>
pub fn run(&mut self) -> Vec<VMEvent>
Wraps execution in a loop so it will continue to run until done or there is an error executing instructions.
pub fn with_alias(self, alias: String) -> Self
pub fn with_cluster_bind(self, server_addr: String, server_port: String) -> Self
Sourcepub fn run_once(&mut self)
pub fn run_once(&mut self)
Executes one instruction. Meant to allow for more controlled execution of the VM
pub fn print_i32_register(&self, register: usize)
pub fn get_test_vm() -> VM
pub fn prepend_header(b: Vec<u8>) -> Vec<u8> ⓘ
pub fn bind_cluster_server(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VM
impl RefUnwindSafe for VM
impl Send for VM
impl Sync for VM
impl Unpin for VM
impl UnsafeUnpin for VM
impl UnwindSafe for VM
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