Register a debuggee in a resource table.
(
table: &mut ResourceTable,
debuggee: crate::Debuggee<T>,
)
| 16 | |
| 17 | /// Register a debuggee in a resource table. |
| 18 | pub fn add_debuggee<T: Send + 'static>( |
| 19 | table: &mut ResourceTable, |
| 20 | debuggee: crate::Debuggee<T>, |
| 21 | ) -> Result<Resource<Debuggee>> { |
| 22 | let engine = debuggee.engine().clone(); |
| 23 | let interrupt_pending = debuggee.interrupt_pending().clone(); |
| 24 | let inner: Option<Box<dyn OpaqueDebugger + Send + 'static>> = Some(Box::new(debuggee)); |
| 25 | Ok(table.push(Debuggee { |
| 26 | inner, |
| 27 | engine, |
| 28 | interrupt_pending, |
| 29 | })?) |
| 30 | } |
| 31 | |
| 32 | impl bindings::DebugMainImports for ResourceTable { |
| 33 | async fn print_debugger_info(&mut self, message: String) -> wasmtime::Result<()> { |
no test coverage detected