napi-rs/crates/napi/src
Ivan Enderlin cb2a407228 feat(napi) Implement ToNapiValue for 8 and 16-bits numbers.
`napi` only supports numbers in 16 and 32-bits. To support Rust
numbers with 8 and 16-bits, we can cast them to 32-bits. To convert
from 8 and 16-bits to 32-bits, we use their `Into` implementation. To
convert from 32-bits to 8 and 16-bits, we use their `TryInto`, we
should theorically not fail, but in case of, an `except` message is
appended.

The code has also been re-indented as it was containing a mix of 2
spaces, 4 spaces and tabs identation.
2022-05-25 14:43:23 +08:00
..
bindgen_runtime feat(napi) Implement ToNapiValue for 8 and 16-bits numbers. 2022-05-25 14:43:23 +08:00
js_values refactor(napi): use libloading on Windows 2022-05-06 22:27:09 +08:00
async_cleanup_hook.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
async_work.rs fix(napi): clippy error on 1.58 2022-01-14 11:21:03 +08:00
call_context.rs refactor(napi): remove compatible Either struct 2021-11-25 17:53:41 +08:00
cleanup_env.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
env.rs fix(napi): use create_buffer/arrary_buffer if provided data is empty 2022-04-26 16:53:13 +08:00
error.rs feat(napi): make Error::from_reason() generic 2022-05-01 17:00:24 +02:00
lib.rs fix(napi): drop all thread_local! usage 2022-05-10 18:39:36 +08:00
promise.rs fix(napi): clippy error on 1.58 2022-01-14 11:21:03 +08:00
status.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
task.rs feat(napi): implement AsyncTask with AbortSignal support 2021-11-06 13:51:54 +08:00
threadsafe_function.rs feat(napi): relax the value type on ThreadSafeFunction 2022-04-14 14:24:47 +08:00
tokio_runtime.rs style: clippy fix 2022-03-05 23:05:04 +08:00
value_type.rs feat(napi): BigInt codegen support 2021-11-11 16:18:25 +08:00
version.rs fix(napi): correct the CString usage 2021-11-15 16:55:13 +08:00