use napi::bindgen_prelude::*; #[napi] pub fn create_external(size: u32) -> External { External::new(size) } #[napi] pub fn create_external_string(content: String) -> External { External::new(content) } #[napi] pub fn get_external(external: External) -> u32 { *external.as_ref() } #[napi] pub fn mutate_external(mut external: External, new_val: u32) { *external.as_mut() = new_val; }