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
//! # A library for safe interoperation between Rust and Java
//!
//! [`rust-jni`](index.html) provides tools to safely make calls from Rust to Java
//! and from Java to Rust using
//! [JNI](https://docs.oracle.com/javase/10/docs/specs/jni/index.html).
//!
//! 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.
// TODO: a complete example.

extern crate cesu8;
extern crate jni_sys;
#[cfg(test)]
#[macro_use]
extern crate lazy_static;

mod attach_arguments;
mod generate;
mod init_arguments;
mod java_string;
mod jni;
mod raw;
mod version;

pub use attach_arguments::AttachArguments;
pub use init_arguments::{InitArguments, JvmOption, JvmVerboseOption};
pub use jni::{Cast, Exception, JavaResult, JavaType, JavaVM, JniEnv, JniError, NoException};
pub use version::JniVersion;

pub mod java {
    pub mod lang {
        pub use jni::class::Class;
        pub use jni::string::String;
        pub use jni::throwable::Throwable;
        pub use jni::Object;
    }
}

/// Tools used by the Java class wrapper code generator.
///
/// SHOULD NOT BE USED MANUALLY.
#[doc(hidden)]
pub mod __generator {
    pub use jni::method_calls::call_constructor;
    pub use jni::method_calls::call_method;
    pub use jni::method_calls::call_static_method;
    pub use jni::native_method::native_method_wrapper;
    pub use jni::native_method::test_from_jni_type;
    pub use jni::native_method::test_jni_argument_type;
    pub use jni::FromJni;
    pub use jni::ToJni;
}