Crate droid_wrap_utils

Source

Macros§

impl_array
实现rust数组类型与java数组的自动关联
import
导出所有的pub条目。 这还将定义必要的trait,以便于在本地为任何数据类型实现JAVA对象所需的功能。

Structs§

AttachGuard
A RAII implementation of scoped guard which detaches the current thread when dropped. The attached JNIEnv can be accessed through this guard via its Deref implementation.
GlobalRef
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 a JObject 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.
JObjectArray
Lifetime’d representation of a jobjectArray which wraps a JObject reference
JString
Lifetime’d representation of a jstring. Just a JObject wrapped in a new class.
JavaVM
The Java VM, providing Invocation API support.
NativeMethod
Native method descriptor.

Enums§

DroidWrapError
错误类型
JValueGen
Rusty version of the JNI C jvalue enum. Used in Java method call arguments and returns.
JniError
ReleaseMode
ReleaseMode

Traits§

ParseJObjectType
解析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§

JBooleanArray
Lifetime’d representation of a crate::sys::jbooleanArray which wraps a JObject reference
JByteArray
Lifetime’d representation of a crate::sys::jbyteArray which wraps a JObject reference
Result
结果类型
jboolean
jbyte
jchar
jdouble
jfloat
jint
jlong
jshort
jsize