libnode_rs 0.0.2

Library embedding Nodejs (libnode) within Rust
Documentation
use std::ffi::c_char;
use std::sync::OnceLock;

use super::super::*;

const SYMBOL: &[u8] = "napi_fatal_error".as_bytes();
type SIGNATURE = fn(
  location: *const c_char,
  location_len: isize,
  message: *const c_char,
  message_len: isize,
) -> napi_status;
static CACHE: OnceLock<super::super::super::libnode::DynSymbol<SIGNATURE>> = OnceLock::new();

pub unsafe fn napi_fatal_error(
  location: *const c_char,
  location_len: isize,
  message: *const c_char,
  message_len: isize,
) -> napi_status {
  CACHE.get_or_init(|| super::super::super::libnode::libnode_sym(SYMBOL))(
    location,
    location_len,
    message,
    message_len,
  )
}