(method: String, request: Buffer)
| 12 | |
| 13 | #[napi] |
| 14 | pub async fn call(method: String, request: Buffer) -> napi::Result<Buffer> { |
| 15 | SERVICE |
| 16 | .call(&method, request.as_ref()) |
| 17 | .await |
| 18 | .map(Buffer::from) |
| 19 | .map_err(|error| { |
| 20 | napi::Error::new( |
| 21 | napi::Status::GenericFailure, |
| 22 | format!("{}: {}", error.code(), error.message()), |
| 23 | ) |
| 24 | }) |
| 25 | } |
| 26 | |
| 27 | #[napi] |
| 28 | pub fn descriptor() -> Buffer { |