#![cfg_attr(docsrs, feature(doc_cfg))]
pub mod context;
pub mod event;
pub mod handle;
pub mod meta;
pub mod object;
pub mod prelude;
pub mod reflect;
pub mod result;
#[cfg(not(feature = "sys"))]
mod sys;
#[cfg(feature = "napi-6")]
pub mod thread;
mod types_docs;
mod types_impl;
#[cfg(feature = "sys")]
#[cfg_attr(docsrs, doc(cfg(feature = "sys")))]
pub mod sys;
pub use types_docs::exports as types;
#[doc(hidden)]
pub mod macro_internal;
pub use neon_macros::*;
#[cfg(feature = "napi-6")]
mod lifecycle;
#[cfg(feature = "napi-8")]
static MODULE_TAG: once_cell::sync::Lazy<crate::sys::TypeTag> = once_cell::sync::Lazy::new(|| {
let mut lower = [0; std::mem::size_of::<u64>()];
getrandom::getrandom(&mut lower).expect("Failed to generate a Neon module type tag");
let lower = u64::from_ne_bytes(lower);
crate::sys::TypeTag { lower, upper: 1 }
});
#[test]
#[ignore]
fn feature_matrix() {
use std::{env, process::Command};
const EXTERNAL_BUFFERS: &str = "external-buffers";
const FUTURES: &str = "futures";
const NODE_API_VERSIONS: &[&str] = &[
"napi-1", "napi-2", "napi-3", "napi-4", "napi-5", "napi-6", "napi-7", "napi-8",
];
const FEATURES: &[&[&str]] = &[
&[],
&[EXTERNAL_BUFFERS],
&[FUTURES],
&[EXTERNAL_BUFFERS, FUTURES],
];
let cargo = env::var_os("CARGO").unwrap_or_else(|| "cargo".into());
for features in FEATURES {
for version in NODE_API_VERSIONS.iter().map(|f| f.to_string()) {
let features = features.iter().fold(version, |f, s| f + "," + s);
let status = Command::new(&cargo)
.args(["check", "-p", "neon", "--features"])
.arg(features)
.spawn()
.unwrap()
.wait()
.unwrap();
assert!(status.success());
}
}
}