[][src]Struct jni_glue::Argument

#[repr(transparent)]
pub struct Argument<Class: AsValidJObjectAndEnv> { /* fields omitted */ }

FFI: Use Argument<java::lang::Object> instead of jobject. This represents a (null?) function argument.

Unlike most Java reference types from this library, this can be null.

FFI safe where a jobject is safe, assuming you match your types correctly. Using the wrong type may result in soundness issues, but at least on Android mostly seems to just result in JNI aborting execution for the current process when calling methods on an instance of the wrong type.

Methods

impl<Class: AsValidJObjectAndEnv> Argument<Class>[src]

pub unsafe fn from_unchecked(object: jobject) -> Self[src]

unsafe: There's no guarantee the jobject being passed is valid or null, nor any means of checking it.

pub unsafe fn with_unchecked<'env>(
    &'env self,
    env: &'env Env
) -> Option<ArgumentRef<'env, Class>>
[src]

unsafe: This assumes the argument belongs to the given Env/VM, which is technically unsound. However, the intended use case of immediately converting any Argument s into ArgumentRef s at the start of a JNI callback, where Java directly invoked your function with an Env + arguments, is sound.

Auto Trait Implementations

impl<Class> !Sync for Argument<Class>

impl<Class> !Send for Argument<Class>

impl<Class> Unpin for Argument<Class> where
    Class: Unpin

impl<Class> RefUnwindSafe for Argument<Class> where
    Class: RefUnwindSafe

impl<Class> UnwindSafe for Argument<Class> where
    Class: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]