[][src]Struct j4rs::JvmBuilder

pub struct JvmBuilder<'a> { /* fields omitted */ }

A builder for Jvm

Implementations

impl<'a> JvmBuilder<'a>[src]

pub fn new<'b>() -> JvmBuilder<'b>[src]

Creates a new JvmBuilder.

pub fn classpath_entry(
    &'a mut self,
    cp_entry: ClasspathEntry<'a>
) -> &'a mut JvmBuilder<'_>
[src]

Adds a classpath entry.

pub fn classpath_entries(
    &'a mut self,
    cp_entries: Vec<ClasspathEntry<'a>>
) -> &'a mut JvmBuilder<'_>
[src]

Adds classpath entries.

pub fn java_opt(&'a mut self, opt: JavaOpt<'a>) -> &'a mut JvmBuilder<'_>[src]

Adds a Java option.

pub fn java_opts(&'a mut self, opts: Vec<JavaOpt<'a>>) -> &'a mut JvmBuilder<'_>[src]

Adds Java options.

pub fn with_no_implicit_classpath(&'a mut self) -> &'a mut JvmBuilder<'_>[src]

By default, the created Jvms include an implicit classpath entry that includes the j4rs jar. When with_no_implicit_classpath() is called, this classpath will not be added to the Jvm.

pub fn detach_thread_on_drop(
    &'a mut self,
    detach_thread_on_drop: bool
) -> &'a mut JvmBuilder<'_>
[src]

When a Jvm goes out of scope and is being dropped, its current thread is being detached from the Java VM. A Jvm that is created with detach_thread_on_drop(false) will not detach the thread when being dropped.

This is useful when in the Java world a native method is called and in the native code someone needs to create a j4rs Jvm. If that Jvm detaches its current thread when being dropped, there will be problems for the Java world code to continue executing.

pub fn with_native_lib_name(
    &'a mut self,
    lib_name: &str
) -> &'a mut JvmBuilder<'_>
[src]

In the case that the j4rs is statically linked to some other library, the Java world (j4rs.jar) needs to load that library instead of the default one.

This function defines the native library name to load.

pub fn skip_setting_native_lib(&'a mut self) -> &'a mut JvmBuilder<'_>[src]

Instructs the builder not to instruct the Java world j4rs code not to load the native library. (most probably because it is already loaded)

pub fn with_base_path(&'a mut self, base_path: &str) -> &'a mut JvmBuilder<'_>[src]

Defines the location of the jassets and deps directory. The jassets contains the j4rs jar and the deps the j4rs dynamic library.

pub fn with_maven_settings(
    &'a mut self,
    maven_settings: MavenSettings
) -> &'a mut JvmBuilder<'_>
[src]

Defines the maven settings to use for provisioning maven artifacts.

pub fn with_javafx_support(&'a mut self) -> &'a mut JvmBuilder<'_>[src]

Adds JavaFX support to the created JVM

pub fn build(&mut self) -> Result<Jvm>[src]

Creates a Jvm

pub fn already_initialized() -> Result<Jvm>[src]

Creates a Jvm, similar with an already created j4rs Jvm.

Note: The already created Jvm is a j4rs Jvm, not a Java VM.

Auto Trait Implementations

impl<'a> RefUnwindSafe for JvmBuilder<'a>

impl<'a> Send for JvmBuilder<'a>

impl<'a> Sync for JvmBuilder<'a>

impl<'a> Unpin for JvmBuilder<'a>

impl<'a> UnwindSafe for JvmBuilder<'a>

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.