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

Method from_env

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

get_classFunction · 0.85

Tested by

no test coverage detected