Trait IntoJava

Source
pub trait IntoJava<'borrow, 'env: 'borrow> {
    type JavaType: AsJValue<'env>;

    const JNI_SIGNATURE: &'static str;

    // Required method
    fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType;

    // Provided method
    fn jni_signature(&self) -> &'static str { ... }
}
Expand description

Conversion from a type into its Java representation.

A type that implements this trait has an equivalent Java representation.

Required Associated Constants§

Source

const JNI_SIGNATURE: &'static str

The JNI signature of the Java type.

Required Associated Types§

Source

type JavaType: AsJValue<'env>

The Rust type that wraps a reference to the Java type.

Required Methods§

Source

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Performs the conversion.

Provided Methods§

Source

fn jni_signature(&self) -> &'static str

Returns the JNI signature of the Java type.

This is a helper method to obtain the JNI_SIGNATURE from a value without knowing its exact type name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'borrow, 'env> IntoJava<'borrow, 'env> for Option<bool>
where 'env: 'borrow,

Source§

const JNI_SIGNATURE: &'static str = "Ljava/lang/Boolean;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env> IntoJava<'borrow, 'env> for Option<i32>
where 'env: 'borrow,

Source§

const JNI_SIGNATURE: &'static str = "Ljava/lang/Integer;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env, T> IntoJava<'borrow, 'env> for Option<T>
where T: IntoJava<'borrow, 'env, JavaType = AutoLocal<'env, 'borrow>>, 'env: 'borrow,

Source§

const JNI_SIGNATURE: &'static str = T::JNI_SIGNATURE

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env, T> IntoJava<'borrow, 'env> for Vec<T>
where T: IntoJava<'borrow, 'env, JavaType = AutoLocal<'env, 'borrow>>, 'env: 'borrow,

Source§

const JNI_SIGNATURE: &'static str = "Ljava/util/ArrayList;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env, T> IntoJava<'borrow, 'env> for HashSet<T>
where T: IntoJava<'borrow, 'env, JavaType = AutoLocal<'env, 'borrow>>, 'env: 'borrow,

Source§

const JNI_SIGNATURE: &'static str = "Ljava/util/HashSet;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for &[u8]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for IpAddr

Source§

const JNI_SIGNATURE: &'static str = "Ljava/net/InetAddress;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for SocketAddr

Source§

const JNI_SIGNATURE: &'static str = "Ljava/net/InetSocketAddress;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

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

Source§

const JNI_SIGNATURE: &'static str = "Z"

Source§

type JavaType = u8

Source§

fn into_java(self, _: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for f64

Source§

const JNI_SIGNATURE: &'static str = "D"

Source§

type JavaType = f64

Source§

fn into_java(self, _: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for i16

Source§

const JNI_SIGNATURE: &'static str = "S"

Source§

type JavaType = i16

Source§

fn into_java(self, _: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for i32

Source§

const JNI_SIGNATURE: &'static str = "I"

Source§

type JavaType = i32

Source§

fn into_java(self, _: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for i64

Source§

const JNI_SIGNATURE: &'static str = "J"

Source§

type JavaType = i64

Source§

fn into_java(self, _: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

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

Source§

const JNI_SIGNATURE: &'static str = "Ljava/lang/String;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for Ipv4Addr

Source§

const JNI_SIGNATURE: &'static str = "Ljava/net/InetAddress;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for Ipv6Addr

Source§

const JNI_SIGNATURE: &'static str = "Ljava/net/InetAddress;"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 0]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 1]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 2]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 3]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 4]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 5]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 6]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 7]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 8]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 9]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 10]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 11]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 12]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 13]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 14]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 15]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 16]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 17]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 18]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 19]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 20]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 21]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 22]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 23]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 24]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 25]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 26]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 27]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 28]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 29]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 30]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 31]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Source§

impl<'borrow, 'env: 'borrow> IntoJava<'borrow, 'env> for [u8; 32]

Source§

const JNI_SIGNATURE: &'static str = "[B"

Source§

type JavaType = AutoLocal<'env, 'borrow>

Source§

fn into_java(self, env: &'borrow JnixEnv<'env>) -> Self::JavaType

Implementors§