napi-rs/examples/napi/src/promise.rs
2021-11-15 16:54:55 +08:00

7 lines
137 B
Rust

use napi::bindgen_prelude::*;
#[napi]
pub async fn async_plus_100(p: Promise<u32>) -> Result<u32> {
let v = p.await?;
Ok(v + 100)
}