rust_jni/
lib.rs

1//! # A library for safe interoperation between Rust and Java
2//!
3//! [`rust-jni`](index.html) provides tools to safely make calls from Rust to Java
4//! and from Java to Rust using
5//! [JNI](https://docs.oracle.com/javase/10/docs/specs/jni/index.html).
6//!
7//! The main philosofy of this library is to push as many errors to compile-time as possible
8//! and panic whenever it's impossible to have a compile error.
9// TODO: a complete example.
10
11extern crate cesu8;
12extern crate jni_sys;
13#[cfg(test)]
14#[macro_use]
15extern crate lazy_static;
16
17mod attach_arguments;
18mod generate;
19mod init_arguments;
20mod java_string;
21mod jni;
22mod raw;
23mod version;
24
25pub use attach_arguments::AttachArguments;
26pub use init_arguments::{InitArguments, JvmOption, JvmVerboseOption};
27pub use jni::{Cast, Exception, JavaResult, JavaType, JavaVM, JniEnv, JniError, NoException};
28pub use version::JniVersion;
29
30pub mod java {
31    pub mod lang {
32        pub use jni::class::Class;
33        pub use jni::string::String;
34        pub use jni::throwable::Throwable;
35        pub use jni::Object;
36    }
37}
38
39/// Tools used by the Java class wrapper code generator.
40///
41/// SHOULD NOT BE USED MANUALLY.
42#[doc(hidden)]
43pub mod __generator {
44    pub use jni::method_calls::call_constructor;
45    pub use jni::method_calls::call_method;
46    pub use jni::method_calls::call_static_method;
47    pub use jni::native_method::native_method_wrapper;
48    pub use jni::native_method::test_from_jni_type;
49    pub use jni::native_method::test_jni_argument_type;
50    pub use jni::FromJni;
51    pub use jni::ToJni;
52}