[][src]Struct jerk::jvm::Library

pub struct Library { /* fields omitted */ }

Represents a loaded jvm.dll or libjvm.so instance.

Methods

impl Library[src]

pub fn get() -> Result<Library, LoadError>[src]

Get an instance of the library by... whatever logic jerk feels like. This currently means searching in this order:

  • Already loaded symbols, in case Java is hosting us (.jar entry point like on Android) instead of us hosting Java
  • %JAVA_HOME%, if set
  • Various JDK locations that could totally have been set as %JAVA_HOME%

pub fn from_already_loaded() -> Result<Library, LoadError>[src]

Reference the already loaded JVM library.

pub fn from_system() -> Result<Library, LoadError>[src]

This is supported on non-Android only.

Load a JVM library from wherever.

pub fn from_java_home(
    java_home: &impl AsRef<Path> + ?Sized
) -> Result<Library, LoadError>
[src]

This is supported on non-Android only.

Load a JVM library from a specific %JAVA_HOME%.

Arguments

  • java_home - this should be %JAVA_HOME% or similar.

pub fn from_library_path(
    libjvm: &impl AsRef<Path> + ?Sized
) -> Result<Library, LoadError>
[src]

This is supported on non-Android only.

Load a JVM library from a specific path.

Arguments

  • libjvm - this should be a path to jvm.dll / libjvm.so

pub fn create_java_vm(
    &self,
    java_vm_options: Vec<String>
) -> Result<*mut JavaVM, JniError>
[src]

This is supported on non-Android only.

JNI_CreateJavaVM

pub fn get_created_java_vms(&self) -> Result<Vec<*mut JavaVM>, JniError>[src]

JNI_GetCreatedJavaVMs

pub fn get_default_java_vm_init_args(&self) -> Result<JavaVMInitArgs, JniError>[src]

This is supported on non-Android only.

JNI_GetDefaultJavaVMInitArgs

Auto Trait Implementations

impl RefUnwindSafe for Library

impl Send for Library

impl Sync for Library

impl Unpin for Library

impl UnwindSafe for Library

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.