pub trait FromJavaValue<'env: 'borrow, 'borrow>: Signature {
    type Source: JavaValue<'env>;

    const SIG_TYPE: &'static str = <Self as Signature>::SIG_TYPE;

    // Required method
    fn from(s: Self::Source, env: &'borrow JNIEnv<'env>) -> Self;
}
Expand description

Conversion trait from Java values to Rust values, analogous to From. Used when converting types that are input to JNI-available functions.

Notes on derive macro

The same notes on TryFromJavaValue apply.

Required Associated Types§

source

type Source: JavaValue<'env>

Conversion source type.

Provided Associated Constants§

source

const SIG_TYPE: &'static str = <Self as Signature>::SIG_TYPE

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

Required Methods§

source

fn from(s: Self::Source, env: &'borrow JNIEnv<'env>) -> Self

Perform the conversion.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'env: 'borrow, 'borrow> FromJavaValue<'env, 'borrow> for bool

§

type Source = u8

source§

fn from(s: Self::Source, _env: &JNIEnv<'env>) -> Self

source§

impl<'env: 'borrow, 'borrow> FromJavaValue<'env, 'borrow> for char

§

type Source = u16

source§

fn from(s: Self::Source, _env: &JNIEnv<'env>) -> Self

source§

impl<'env: 'borrow, 'borrow> FromJavaValue<'env, 'borrow> for Box<[bool]>

§

type Source = *mut _jobject

source§

fn from(s: Self::Source, env: &'borrow JNIEnv<'env>) -> Self

source§

impl<'env: 'borrow, 'borrow> FromJavaValue<'env, 'borrow> for String

§

type Source = JString<'env>

source§

fn from(s: Self::Source, env: &'borrow JNIEnv<'env>) -> Self

source§

impl<'env: 'borrow, 'borrow, T, U> FromJavaValue<'env, 'borrow> for Vec<T>where T: FromJavaValue<'env, 'borrow, Source = U>, U: JavaValue<'env>,

§

type Source = JObject<'env>

source§

fn from(s: Self::Source, env: &'borrow JNIEnv<'env>) -> Self

Implementors§

source§

impl<'env: 'borrow, 'borrow, T> FromJavaValue<'env, 'borrow> for Twhere T: JavaValue<'env> + Signature,

§

type Source = T