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

Method poll_read

crates/wasi/src/cli/file.rs:141–153  ·  view source on GitHub ↗
(
        self: Pin<&mut Self>,
        _cx: &mut Context<'_>,
        buf: &mut io::ReadBuf<'_>,
    )

Source from the content-addressed store, hash-verified

139
140impl AsyncRead for InputFile {
141 fn poll_read(
142 self: Pin<&mut Self>,
143 _cx: &mut Context<'_>,
144 buf: &mut io::ReadBuf<'_>,
145 ) -> Poll<io::Result<()>> {
146 match (&*self.file).read(buf.initialize_unfilled()) {
147 Ok(n) => {
148 buf.advance(n);
149 Poll::Ready(Ok(()))
150 }
151 Err(e) => Poll::Ready(Err(e)),
152 }
153 }
154}

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
advanceMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected