[][src]Struct jni::JavaVM

pub struct JavaVM(_);

The invocation API.

Methods

impl JavaVM[src]

pub unsafe fn from_raw(ptr: *mut JavaVM) -> Result<Self>[src]

Create a JavaVM from a raw pointer.

pub fn get_java_vm_pointer(&self) -> *mut JavaVM[src]

Returns underlying sys::JavaVM interface.

pub fn attach_current_thread(&self) -> Result<AttachGuard>[src]

Attaches the current thread to a Java VM. The resulting AttachGuard can be dereferenced to a JNIEnv and automatically detaches the thread when dropped. Calling this for a thread that is already attached is a no-op.

pub fn attach_current_thread_as_daemon(&self) -> Result<JNIEnv>[src]

Attaches the current thread to a Java VM as a daemon.

pub fn get_env(&self) -> Result<JNIEnv>[src]

Get the JNIEnv associated with the current thread, or ErrorKind::Detached if the current thread is not attached to the java VM.

Trait Implementations

impl Send for JavaVM[src]

impl Sync for JavaVM[src]

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.