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