(env: &'b JNIEnv<'a>, obj: JObject<'a>)
| 25 | |
| 26 | impl<'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 |
nothing calls this directly
no test coverage detected