Trait robusta_jni::convert::safe::TryIntoJavaValue [−][src]
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
Associated Constants
Required methods
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
)