jni-mangle (0.1.3-dev.20260213-191510.3eaa699)

Published 2026-02-13 19:15:13 +00:00 by Evan Pratten

Installation

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add jni-mangle@0.1.3-dev.20260213-191510.3eaa699 --registry forgejo

About this package

Mangle Rust functions for use with JNI

Rust function mangler for JNI

Crates.io Docs.rs Build Clippy

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
Cargo
2026-02-13 19:15:13 +00:00
8
Evan Pratten <ewpratten@gmail.com>
GPL-3.0
19 KiB
Assets (1)
Versions (2) View all