━ Vital::Sandbox::Lua::create()
@Objective: Creates a new VM.
vital_vm* vm = new Vital::Sandbox::Lua::create();
━ Vital::Sandbox::Lua::fetchVM()
@Objective: Retrieves vm by its state's reference.
vital_vm* vm = Vital::Sandbox::Lua::fetchVM(vital_ref* vm);
@Objective: Destroys targetted vm.
bool result = vm -> destroy();
@Objective: Verifies whether the instance is an virtual thread.
bool result = vm -> isVirtualThread();
@Objective: Pushes value of specified index onto the top of the stack.
void result = vm -> push(int index = 1);
@Objective: Pops specified number of values from top of the stack.
void result = vm -> pop(int count = 1);
@Objective: Moves specified number of values from top of the current stack to the target stack.
ℹ️ To be used for exchanging values back & forth b/w threads of same instance.
void result = vm -> move(vital_vm* target, int index = 1);
@Objective: Resumes specified virtual thread's handler.
⚠️ To be used only with virtual threads.
void result = vm -> resume();
@Objective: Pauses specified virtual thread's handler.
⚠️ To be used only with virtual threads.
void result = vm -> pause();
@Objective: Executes a C++ function safely on the vm while reporting encountered exceptions.
⚠️ To be used only within bound C++ functions.
int result = vm -> execute(std::function<int()> exec);
@Objective: Runs specified buffer on the vm.
bool result = vm -> loadString(std::string& buffer);
@Objective: Throws a error with call stack details.
bool result = vm -> throwError(std::string& error = "");