Macros§
- impl_
array - 实现rust数组类型与java数组的自动关联
- import
- 导出所有的pub条目。 这还将定义必要的trait,以便于在本地为任何数据类型实现JAVA对象所需的功能。
Structs§
- Attach
Guard - A RAII implementation of scoped guard which detaches the current thread
when dropped. The attached
JNIEnv
can be accessed through this guard via itsDeref
implementation. - Global
Ref - A global JVM reference. These are “pinned” by the garbage collector and are
guaranteed to not get collected until released. Thus, this is allowed to
outlive the
JNIEnv
that it came from and can be used in other threads. - JClass
- Lifetime’d representation of a
jclass
. Just aJObject
wrapped in a new class. - JNIEnv
- FFI-compatible JNIEnv struct. You can safely use this as the JNIEnv argument to exported methods that will be called by java. This is where most of the magic happens. All methods on this object are wrappers around JNI functions, so the documentation on their behavior is still pretty applicable.
- JObject
- Wrapper around [
sys::jobject
] that adds a lifetime to ensure that the underlying JNI pointer won’t be accessible to safe Rust code if the object reference is released. - JObject
Array - Lifetime’d representation of a
jobjectArray
which wraps aJObject
reference - JString
- Lifetime’d representation of a
jstring
. Just aJObject
wrapped in a new class. - JavaVM
- The Java VM, providing Invocation API support.
- Native
Method - Native method descriptor.
Enums§
- Droid
Wrap Error - 错误类型
- JValue
Gen - Rusty version of the JNI C
jvalue
enum. Used in Java method call arguments and returns. - JniError
- Release
Mode - ReleaseMode
Traits§
- ParseJ
Object Type - 解析JObject类型。
Functions§
- android_
context - 获取安卓的Context对象,这通常是NativeActivity对象的引用。
- android_
vm - 获取android系统的java虚拟机。
- bind_
proxy_ handler - java动态代理绑定rust函数。
- get_
proxy_ hash_ code - 获取java代理对象的哈希值。
- java_
object_ equals - 比较两个Java对象是否相等。
- java_
object_ to_ string - 将Java对象转换为字符串。
- new_
proxy - 创建一个java动态代理,用于在rust层实现java接口的方法。
- null_
value - 获取null的全局引用值。
- to_
java_ byte_ array - 将Rust数组转换为Java byte数组
- to_
java_ object_ array - 将Rust数组转换为Java对象数组
- to_vec
- 把java对象数组转换成Vec
- unbind_
proxy_ handler - 删除java动态代理绑定的rust函数。
- vm_
attach - 获取vm,将vm附加到当前线程,随后操作java虚拟机。
- wrapper_
bool_ value - 获取boolean的包装对象的全局引用值。
- wrapper_
integer_ value - 获取int的包装对象的全局引用值。
- wrapper_
long_ value - 获取long的包装对象的全局引用值。
Type Aliases§
- JBoolean
Array - Lifetime’d representation of a
crate::sys::jbooleanArray
which wraps aJObject
reference - JByte
Array - Lifetime’d representation of a
crate::sys::jbyteArray
which wraps aJObject
reference - Result
- 结果类型
- jboolean
- jbyte
- jchar
- jdouble
- jfloat
- jint
- jlong
- jshort
- jsize