napi-rs/bench/src/lib.rs
LongYinan e9de5681be
fix(napi): also apply electron external data fallback to lowlevel APIs (#1458)
* fix(napi): also apply electron external data fallback to lowlevel APIs

* chore: allow uninlined_format_args in tests
2023-01-28 21:31:57 +08:00

38 lines
856 B
Rust

#![allow(clippy::uninlined_format_args)]
#[macro_use]
extern crate napi_derive;
use napi::{Env, JsObject, Result};
#[cfg(all(
target_arch = "x86_64",
not(target_env = "musl"),
not(debug_assertions)
))]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
mod async_compute;
mod buffer;
mod create_array;
mod get_set_property;
mod get_value_from_js;
mod noop;
mod plus;
mod query;
#[module_exports]
fn init(mut exports: JsObject, env: Env) -> Result<()> {
exports.create_named_method("noop", noop::noop)?;
async_compute::register_js(&mut exports)?;
buffer::register_js(&mut exports)?;
plus::register_js(&mut exports)?;
get_set_property::register_js(&mut exports, &env)?;
create_array::register_js(&mut exports)?;
get_value_from_js::register_js(&mut exports)?;
query::register_js(&mut exports)?;
Ok(())
}