Struct InitArguments

Source
pub struct InitArguments { /* private fields */ }
Expand description

Arguments for creating a Java VM.

JNI documentation

§Example

use rust_jni::{InitArguments, JniVersion, JvmOption, JvmVerboseOption};

let options = InitArguments::get_default(JniVersion::V8).unwrap()
    .with_option(JvmOption::Unknown("-Xgc:parallel".to_owned()))
    .with_option(JvmOption::Verbose(JvmVerboseOption::Gc));

assert_eq!(options.version(), JniVersion::V8);

Implementations§

Source§

impl InitArguments

Source

pub fn get_default(version: JniVersion) -> Option<Self>

Get default Java VM init arguments for a JNI version. If the requested JNI version is not supported, returns None.

JNI documentation

Source

pub fn get_default_or_closest_supported(version: JniVersion) -> Self

Get default Java VM init arguments for a JNI version. If the requested JNI version is not supported, returns default arguments for the closest supported JNI version. The new version can be obtained with the InitArguments::version() method.

JNI documentation

Source

pub fn get_latest_default() -> Self

Get default init arguments for the latest supported JNI version.

JNI documentation

Source

pub fn with_options(self, options: &[JvmOption]) -> Self

Add init options to the Java VM init arguments.

JNI documentation

Source

pub fn with_option(self, option: JvmOption) -> Self

Add an init option to the Java VM init arguments.

JNI documentation

Source

pub fn unchecked(self) -> Self

Disable checking JNI calls for correctness.

Source

pub fn checked(self) -> Self

Enable checking JNI calls for correctness.

This is a default. Only needed to be called if checking JNI calls was explicitly disabled.

Source

pub fn ignore_unrecognized_options(self) -> Self

Request for JVM to ignore unrecognized options on startup.

JNI documentation

Source

pub fn fail_on_unrecognized_options(self) -> Self

Request for JVM to fail in presence of unrecognized options on startup.

JNI documentation

Source

pub fn version(&self) -> JniVersion

Return the JNI version these arguments will request when creating a Java VM.

JNI documentation

Trait Implementations§

Source§

impl Clone for InitArguments

Source§

fn clone(&self) -> InitArguments

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InitArguments

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for InitArguments

Source§

fn eq(&self, other: &InitArguments) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for InitArguments

Source§

impl StructuralPartialEq for InitArguments

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.