Crate rust_jni

Source
Expand description

§A library for safe interoperation between Rust and Java

rust-jni provides tools to safely make calls from Rust to Java and from Java to Rust using JNI.

The main philosofy of this library is to push as many errors to compile-time as possible and panic whenever it’s impossible to have a compile error.

Modules§

Macros§

Structs§

  • Arguments for attaching a thread to the JVM.
  • A dual token to NoException that represents that there might be a pending exception in Java.
  • Arguments for creating a Java VM.
  • A struct for interacting with the Java VM.
  • The interface for interacting with Java. All calls to Java are performed through this interface. JNI methods can only be called from threads, explicitly attached to the Java VM. JniEnv represents such a thread.
  • A token that represents that there is no pending Java exception in the current thread.

Enums§

Traits§

  • A trait for casting Java object types to their superclasses.
  • A trait that represents Rust types that are mappable to JNI types. This trait has to be implemented for all types that need to be passed as arguments to or returned from Java functions.

Type Aliases§

  • A type that represents a result of a Java method call. A Java method can either return a result or throw a Throwable.