Create with initialize function taking mutable vm reference. Note: This is a legacy API. To add stdlib, use `Interpreter::builder()` instead.
(settings: Settings, init: F)
| 328 | /// |
| 329 | /// Note: This is a legacy API. To add stdlib, use `Interpreter::builder()` instead. |
| 330 | pub fn with_init<F>(settings: Settings, init: F) -> Self |
| 331 | where |
| 332 | F: FnOnce(&mut VirtualMachine), |
| 333 | { |
| 334 | let (vm, global_state) = initialize_main_vm( |
| 335 | settings, |
| 336 | Context::genesis().clone(), |
| 337 | Vec::new(), // No module_defs |
| 338 | Vec::new(), // No frozen_modules |
| 339 | Vec::new(), // No init_hooks |
| 340 | init, |
| 341 | ); |
| 342 | Self { global_state, vm } |
| 343 | } |
| 344 | |
| 345 | /// Run a function with the main virtual machine and return a PyResult of the result. |
| 346 | /// |
nothing calls this directly
no test coverage detected