MCPcopy Index your code
hub / github.com/endbasic/endbasic / run_to_end

Function run_to_end

core/src/vm/mod.rs:678–688  ·  view source on GitHub ↗

Runs the VM to completion, invoking every upcall as it is encountered.

(vm: &mut Vm, image: &Image)

Source from the content-addressed store, hash-verified

676
677 /// Runs the VM to completion, invoking every upcall as it is encountered.
678 async fn run_to_end(vm: &mut Vm, image: &Image) {
679 loop {
680 match vm.exec(image) {
681 StopReason::End(_) => break,
682 StopReason::Eof => break,
683 StopReason::Exception(_, msg) => panic!("Unexpected exception: {}", msg),
684 StopReason::UpcallAsync(handler) => handler.invoke().await.unwrap(),
685 StopReason::Yield => (),
686 }
687 }
688 }
689
690 #[test]
691 fn test_exec_without_load_is_eof() {

Calls 2

invokeMethod · 0.80
execMethod · 0.45