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

Function dispatch_set_item

compiler/src/main/abi_bridge.rs:143–153  ·  view source on GitHub ↗

SetItem: built-in item-assignment only, same rationale as `dispatch_get_item`. */

(recv_h: u32, args: &[Val])

Source from the content-addressed store, hash-verified

141
142/* SetItem: built-in item-assignment only, same rationale as `dispatch_get_item`. */
143fn dispatch_set_item(recv_h: u32, args: &[Val]) -> Result<Val, VmErr> {
144 if args.len() != 2 {
145 return Err(VmErr::TypeMsg(s!("set_item expects (index, value), got ", int args.len() as i64, " args")));
146 }
147 let idx = args[0];
148 let value = args[1];
149 with_recv("edge_op set_item: invalid receiver handle", recv_h, |vm, recv| {
150 vm.store_item_builtin(recv, idx, value)?;
151 Ok(Val::none())
152 })
153}
154
155fn dispatch_len(recv_h: u32) -> Result<Val, VmErr> {
156 with_recv("edge_op len: invalid receiver handle", recv_h, |vm, recv| {

Callers 1

host_edge_opFunction · 0.85

Calls 3

with_recvFunction · 0.85
store_item_builtinMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected