MCPcopy Create free account
hub / github.com/deviceplug/btleplug / from_env

Method from_env

src/droidplug/jni_utils/future.rs:29–44  ·  view source on GitHub ↗
(env: &'b JNIEnv<'a>, obj: JObject<'a>)

Source from the content-addressed store, hash-verified

27
28impl<'a: 'b, 'b> JFuture<'a, 'b> {
29 pub fn from_env(env: &'b JNIEnv<'a>, obj: JObject<'a>) -> Result<Self> {
30 let poll = env.get_method_id(
31 JClass::from(
32 super::classcache::get_class("io/github/gedgygedgy/rust/future/Future")
33 .unwrap()
34 .as_obj(),
35 ),
36 "poll",
37 "(Lio/github/gedgygedgy/rust/task/Waker;)Lio/github/gedgygedgy/rust/task/PollResult;",
38 )?;
39 Ok(Self {
40 internal: obj,
41 poll,
42 env,
43 })
44 }
45
46 pub fn poll(&self, waker: JObject<'a>) -> Result<JPollResult<'a, 'b>> {
47 let result = self

Callers

nothing calls this directly

Calls 1

get_classFunction · 0.85

Tested by

no test coverage detected