1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use FfiValue;
/// Newtype over [`FfiValue`] carrying the Node.js conversions.
///
/// The value tree itself — and its `Encrypt`/`Decrypt` impls and leaf wire
/// format — lives in the language-neutral `vitaminc-aead-value` crate. This
/// wrapper exists because Rust's orphan rule prevents implementing napi's
/// `FromNapiValue`/`ToNapiValue` (foreign traits) directly on `FfiValue`
/// (a foreign type) from this crate.
///
/// Convert with [`From`]/[`Into`] (or [`into_inner`](NapiValue::into_inner))
/// at the `#[napi]` function boundary; everything past that boundary works
/// with the bare [`FfiValue`].
///
/// See the `vitaminc-aead-value` crate docs for the JS type mapping,
/// including the `Number`/`Int` split (JS numbers always encode as
/// `Number`; `BigInt` encodes as `Int`) and the `BigInt` decode rule.
;