Return the error code.
(&self)
| 374 | #[allow(unused_unsafe, clippy::all)] |
| 375 | /// Return the error code. |
| 376 | pub fn code(&self) -> ErrorCode { |
| 377 | unsafe { |
| 378 | #[cfg(target_arch = "wasm32")] |
| 379 | #[link( |
| 380 | wasm_import_module = "wasi:nn/errors@0.2.0-rc-2024-08-19" |
| 381 | )] |
| 382 | extern "C" { |
| 383 | #[link_name = "[method]error.code"] |
| 384 | fn wit_import(_: i32) -> i32; |
| 385 | } |
| 386 | #[cfg(not(target_arch = "wasm32"))] |
| 387 | fn wit_import(_: i32) -> i32 { |
| 388 | unreachable!() |
| 389 | } |
| 390 | let ret = wit_import((self).handle() as i32); |
| 391 | ErrorCode::_lift(ret as u8) |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | impl Error { |
| 396 | #[allow(unused_unsafe, clippy::all)] |
nothing calls this directly
no test coverage detected