jni-mangle (0.2.0-dev.20260409-025448.1c96023)
Published 2026-04-09 02:54:51 +00:00 by Evan Pratten
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add jni-mangle@0.2.0-dev.20260409-025448.1c96023 --registry forgejoAbout this package
Mangle Rust functions for use with JNI
Rust function mangler for JNI
The jni-mangle crate provides proc macros for working with Rust functions that are called from Java through JNI.
The main purpose of this crate is to turn rust functions that might look like this:
#[no_mangle]
#[allow(non_snake_case)]
pub extern "system" fn Java_com_example_Example_addTwoNumbers(a: i32, b: i32) -> i32 {
a + b
}
Into something a little more readable:
use jni_mangle::mangle;
#[mangle(package="com.example", class="Example", method="addTwoNumbers")]
pub fn add_two_numbers(a: i32, b: i32) -> i32 {
a + b
}
Dependencies
| ID | Version |
|---|---|
| darling | ^0.20.3 |
| proc-macro2 | ^1.0.66 |
| quote | ^1.0.33 |
| regex | ^1.9.5 |
| syn | ^2.0.31 |
Keywords
jni
function-signature
Details
2026-04-09 02:54:51 +00:00
Assets (1)
Versions (2)
View all
Cargo
18
Evan Pratten <ewpratten@gmail.com>
GPL-3.0
19 KiB
0.2.0-dev.20260409-025448.1c96023
2026-04-09
0.1.3-dev.20260213-191510.3eaa699
2026-02-13