Trait toad_jni::java::Type

source ·
pub trait Type: TypeSealed {
    const SIG: Signature;

    // Required method
    fn jni() -> JavaType;

    // Provided method
    fn is_type_of(e: &mut Env<'_>, o: &JObject<'_>) -> bool { ... }
}
Expand description

A type that has a corresponding Java type

Sealed

You can’t implement this trait directly; instead you can define new java::Classes, which will then come with Type implementations for free.

Conversions

rust typejava typenotes
T where T: java::Classfully qualified class path
Result<T, java::lang::Throwable>T::PATHjava::Class must be implemented for T
java::Nullable<T>T::PATHjava::Class must be implemented for T
java::NoUpcast<T>java::lang::Objectjava::Class must be implemented for T. Used when a method should have the signature of returning T, but you would like the object reference without java::Object::upcasting.
java::lang::Objectjava.lang.Object
Vec<T>T[]T must be java::Type
Stringjava.lang.Stringjava::Class and java::Object implemented for String
()void
u16char
i8byte
i16short
i32int
i64long
f32float
f64double
fn(T,*) -> Rcorresponding java type signatureall argument types and return types must be java::Type

Required Associated Constants§

source

const SIG: Signature

The signature for this type

Required Methods§

source

fn jni() -> JavaType

Get the jni rep of this type

Provided Methods§

source

fn is_type_of(e: &mut Env<'_>, o: &JObject<'_>) -> bool

Determines whether an object is an instance of this type

Implementations on Foreign Types§

source§

impl Type for f64

source§

impl Type for i8

source§

impl<R, A, B, C, D, E> Type for fn(_: A, _: B, _: C, _: D, _: E) -> Rwhere R: Type, A: Type, B: Type, C: Type, D: Type, E: Type,

source§

impl Type for u16

source§

impl Type for GlobalRef

source§

const SIG: Signature = java::lang::Object::SIG

source§

fn jni() -> JavaType

source§

impl Type for ()

source§

impl Type for i32

source§

impl<T> Type for Vec<T>where T: Type,

source§

impl<T> Type for Result<T, Throwable>where T: Class,

source§

impl Type for i64

source§

impl<R> Type for fn() -> Rwhere R: Type,

source§

impl<R, A, B> Type for fn(_: A, _: B) -> Rwhere R: Type, A: Type, B: Type,

source§

impl<R, A, B, C, D> Type for fn(_: A, _: B, _: C, _: D) -> Rwhere R: Type, A: Type, B: Type, C: Type, D: Type,

source§

impl<R, A, B, C> Type for fn(_: A, _: B, _: C) -> Rwhere R: Type, A: Type, B: Type, C: Type,

source§

impl Type for i16

source§

impl Type for bool

source§

impl<R, A> Type for fn(_: A) -> Rwhere R: Type, A: Type,

source§

impl Type for f32

Implementors§

source§

impl<T> Type for Twhere T: Class,