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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! JNI / Kotlin language adapter — the [`JniGenBuilder`] back-end.
//!
//! Sibling of the C adapter (now the separate `prebindgen-c` crate): it implements the
//! language-agnostic [`prebindgen_registry::Prebindgen`] trait to
//! turn a flat `#[prebindgen]` library into a Rust file of JNI `extern "C"`
//! wrappers plus a fan-out of generated Kotlin sources.
//!
//! Pipeline:
//! 1. [`prebindgen_registry::Registry::builder`] describes a binding over a model built from
//! `(syn::Item, SourceLocation)` (typically `source.items_all()`).
//! 2. `Registry::write_rust` resolves every
//! required type via a configured [`JniGenBuilder`] and writes the generated
//! Rust bindings file.
//! 3. `JniGenBuilder::write_kotlin` walks the resolved registry to emit the
//! secondary Kotlin artifacts (typed-handle classes, data/enum classes,
//! exception classes, the centralized `JNINative` holder).
//!
//! # Fixed-width unsigned integers
//!
//! JniGenBuilder exposes Rust's fixed-width unsigned scalars without narrowing their
//! domain at the Kotlin boundary:
//!
//! | Rust | Kotlin surface | JNI wire |
//! |------|----------------|----------|
//! | `u8` | `Int` | `jint` |
//! | `u16` | `Int` | `jint` |
//! | `u32` | `Long` | `jlong` |
//! | `u64` | `ULong` | `jlong` / `Long` bit pattern |
//!
//! Inputs for `u8`, `u16`, and `u32` are range-checked and report a
//! [`JniBindingError`] through the generated binding-error handler. `u64`
//! uses Kotlin's bit-preserving `ULong.toLong()` / `Long.toULong()` bridge.
//! These mappings compose through nullable/result outputs, generated data
//! classes, callbacks, const getters, and supported output collections.
pub
pub use ;
// Kotlin emission types now live in the standalone `kotlin-codegen` crate;
// re-exported here so the public `lang::` surface is unchanged (`KotlinFile`
// aliases the model's `KtFile`).
pub use KtFile as KotlinFile;
pub use WriteKotlinError;