MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / notified_future

Method notified_future

crates/wasi/src/cli/worker_thread_stdin.rs:299–309  ·  view source on GitHub ↗
(self: Pin<&mut Self>)

Source from the content-addressed store, hash-verified

297
298impl WasiStdinAsyncRead {
299 fn notified_future(self: Pin<&mut Self>) -> Option<Pin<&mut Notified<'static>>> {
300 // SAFETY: this is a pin-projection from `self` to the field `Notified`
301 // internally. Given that `self` is pinned it should be safe to acquire
302 // a pinned version of the internal field.
303 unsafe {
304 match self.get_unchecked_mut() {
305 WasiStdinAsyncRead::Ready => None,
306 WasiStdinAsyncRead::Waiting(notified) => Some(Pin::new_unchecked(notified)),
307 }
308 }
309 }
310}

Callers 1

poll_readMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected