pub struct InitArguments { /* private fields */ }
Expand description
Arguments for creating a Java VM.
§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
impl InitArguments
Sourcepub fn get_default(version: JniVersion) -> Option<Self>
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
.
Sourcepub fn get_default_or_closest_supported(version: JniVersion) -> Self
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.
Sourcepub fn get_latest_default() -> Self
pub fn get_latest_default() -> Self
Get default init arguments for the latest supported JNI version.
Sourcepub fn with_options(self, options: &[JvmOption]) -> Self
pub fn with_options(self, options: &[JvmOption]) -> Self
Add init options to the Java VM init arguments.
Sourcepub fn with_option(self, option: JvmOption) -> Self
pub fn with_option(self, option: JvmOption) -> Self
Add an init option to the Java VM init arguments.
Sourcepub fn checked(self) -> Self
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.
Sourcepub fn ignore_unrecognized_options(self) -> Self
pub fn ignore_unrecognized_options(self) -> Self
Request for JVM to ignore unrecognized options on startup.
Sourcepub fn fail_on_unrecognized_options(self) -> Self
pub fn fail_on_unrecognized_options(self) -> Self
Request for JVM to fail in presence of unrecognized options on startup.
Sourcepub fn version(&self) -> JniVersion
pub fn version(&self) -> JniVersion
Return the JNI version these arguments will request when creating a Java VM.
Trait Implementations§
Source§impl Clone for InitArguments
impl Clone for InitArguments
Source§fn clone(&self) -> InitArguments
fn clone(&self) -> InitArguments
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more