#[repr(transparent)]
pub struct JMethodID { /* private fields */ }
Expand description
Wrapper around jmethodID
that implements Send
+ Sync
since method IDs
are valid across threads (not tied to a JNIEnv
).
There is no lifetime associated with these since they aren’t garbage
collected like objects and their lifetime is not implicitly connected with
the scope in which they are queried.
It matches C’s representation of the raw pointer, so it can be used in any
of the extern function argument positions that would take a jmethodID
.
According to the JNI spec method IDs may be invalidated when the
corresponding class is unloaded.
Since this constraint can’t be encoded as a Rust lifetime, and to avoid the
excessive cost of having every Method ID be associated with a global
reference to the corresponding class then it is the developers
responsibility to ensure they hold some class reference for the lifetime of
cached method IDs.
Unwrap to the internal jni type.
Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
The type that this Desc
returns.
Look up the concrete type from the JVM.
Read more
The type that this Desc
returns.
Look up the concrete type from the JVM.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.