MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / deliver_host_result

Method deliver_host_result

compiler/src/modules/vm/init.rs:101–108  ·  view source on GitHub ↗

Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */

(&mut self, idx: usize, val: Val)

Source from the content-addressed store, hash-verified

99
100 /* Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */
101 fn deliver_host_result(&mut self, idx: usize, val: Val) {
102 let coro = self.scheduler[idx].coro;
103 if let HeapObj::Coroutine(_, _, saved_stack, _, _, sub_frames, _) = self.heap.get_mut(coro) {
104 let target_stack = if let Some(frame) = sub_frames.last_mut() { &mut frame.stack_delta } else { saved_stack };
105 if let Some(top) = target_stack.last_mut() { *top = val; } else { target_stack.push(val); }
106 }
107 self.scheduler[idx].state = CoroState::Ready;
108 }
109
110 /* String form of `inject_host_result`: allocates `message` on the heap and injects it. Used by Rust hosts that return text bodies (and test fixtures simulating that path). */
111 pub fn push_host_result(&mut self, message: &str) -> Result<bool, VmErr> {

Callers 2

inject_host_resultMethod · 0.80

Calls 2

get_mutMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected