Attempts one poll of `f` to see if its output is available. This function is intended for a few minor entrypoints into the Wasmtime API where a synchronous function is documented to work even when `async_support` is enabled. For example growing a `Memory` can be done with a synchronous function, but it's documented to panic with an async resource limiter. This function provides the opportunity t
(f: F)
| 479 | /// message should be generated recommending to use an async function (e.g. |
| 480 | /// `grow_async` instead of `grow`). |
| 481 | fn one_poll<F: Future>(f: F) -> Option<F::Output> { |
| 482 | let mut context = Context::from_waker(&Waker::noop()); |
| 483 | match pin!(f).poll(&mut context) { |
| 484 | Poll::Ready(output) => Some(output), |
| 485 | Poll::Pending => None, |
| 486 | } |
| 487 | } |