Trait robusta_jni::convert::safe::TryIntoJavaValue
source · [−]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
sourceimpl<'env> TryIntoJavaValue<'env> for String
impl<'env> TryIntoJavaValue<'env> for String
sourceimpl<'env> TryIntoJavaValue<'env> for bool
impl<'env> TryIntoJavaValue<'env> for bool
sourceimpl<'env> TryIntoJavaValue<'env> for char
impl<'env> TryIntoJavaValue<'env> for char
sourceimpl<'env, T> TryIntoJavaValue<'env> for Vec<T> where
T: TryIntoJavaValue<'env>,
impl<'env, T> TryIntoJavaValue<'env> for Vec<T> where
T: TryIntoJavaValue<'env>,
sourceimpl<'env, T> TryIntoJavaValue<'env> for Result<T> where
T: TryIntoJavaValue<'env>,
impl<'env, T> TryIntoJavaValue<'env> for Result<T> where
T: TryIntoJavaValue<'env>,
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
)