pub struct CachedIfaceMethod { /* private fields */ }Expand description
A (pinned interface class, method ID) pair resolved once per process.
Declare as static; the embedded OnceLock handles the one-time
resolution race (both winners produce equivalent values).
Implementations§
Source§impl CachedIfaceMethod
impl CachedIfaceMethod
pub const fn new() -> Self
Sourcepub fn call_object<'local>(
&self,
env: &mut JNIEnv<'local>,
class_fqn: &str,
method: &str,
descr: &str,
obj: &JObject<'_>,
args: &[jvalue],
) -> Result<JObject<'local>, String>
pub fn call_object<'local>( &self, env: &mut JNIEnv<'local>, class_fqn: &str, method: &str, descr: &str, obj: &JObject<'_>, args: &[jvalue], ) -> Result<JObject<'local>, String>
Invoke the interface method on obj, returning its Object result.
Resolves (and pins) the interface class on first use.
SAFETY contract carried for the caller: obj must implement the
interface named by class_fqn, and descr must be the method’s
exact JVM descriptor — both are generated from the same plan, so
they agree by construction.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CachedIfaceMethod
impl RefUnwindSafe for CachedIfaceMethod
impl Send for CachedIfaceMethod
impl Sync for CachedIfaceMethod
impl Unpin for CachedIfaceMethod
impl UnsafeUnpin for CachedIfaceMethod
impl UnwindSafe for CachedIfaceMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more