pub trait TryIntoJavaValue<'env>: Signature {
    type Target: JavaValue<'env>;

    const SIG_TYPE: &'static str;

    fn try_into(self, env: &JNIEnv<'env>) -> Result<Self::Target>;
}
Expand description

Conversion trait from Rust values to Java values, analogous to TryInto. Used when converting types returned from JNI-available functions.

This is the default trait used when converting values from Rust to Java.

Notes on derive macro

The same notes on TryFromJavaValue apply.

Note that when autoderiving TryIntoJavaValue for T, an implementation for all of T, &T and &mut T is generated (for ergonomics).

Associated Types

Conversion target type.

Associated Constants

Signature of the source type. By default, use the one defined on the Signature trait for the implementing type.

Required methods

Perform the conversion.

Implementations on Foreign Types

When returning a jni::errors::Result, if the returned variant is Ok(v) then the value v is returned as usual.

If the returned value is Err, the Java exception specified in the #[call_type(safe)] attribute is thrown (by default java.lang.RuntimeException)

Implementors