Function
get_local_events
(tool_id: i32, code: PyObjectRef, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 635 | } |
| 636 | |
| 637 | fn get_local_events(tool_id: i32, code: PyObjectRef, vm: &VirtualMachine) -> PyResult<u32> { |
| 638 | if code.downcast_ref::<PyCode>().is_none() { |
| 639 | return Err(vm.new_type_error("code must be a code object")); |
| 640 | } |
| 641 | let tool = check_valid_tool(tool_id, vm)?; |
| 642 | let code_id = code.get_id(); |
| 643 | let state = vm.state.monitoring.lock(); |
| 644 | Ok(state |
| 645 | .local_events |
| 646 | .get(&(tool, code_id)) |
| 647 | .copied() |
| 648 | .unwrap_or(0)) |
| 649 | } |
| 650 | |
| 651 | fn set_local_events( |
| 652 | tool_id: i32, |
Callers
nothing calls this directly
Tested by
no test coverage detected