Struct jni::objects::GlobalRef [] [src]

pub struct GlobalRef { /* fields omitted */ }

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. Still can't cross thread boundaries since it requires a pointer to the JNIEnv to do anything useful with it.

Methods

impl GlobalRef
[src]

[src]

Create a new global reference object. This assumes that CreateGlobalRef has already been called.

[src]

Get the object from the global ref

This borrows the ref and prevents it from being dropped as long as the JObject sticks around.

Trait Implementations

impl<'a> Desc<'a, JClass<'a>> for &'a GlobalRef
[src]

This conversion assumes that the GlobalRef is a pointer to a class object.

[src]

Look up the concrete type from the JVM.

impl Drop for GlobalRef
[src]

[src]

Executes the destructor for this type. Read more