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

Method read

crates/test-programs/src/preview1.rs:239–252  ·  view source on GitHub ↗
(
        &self,
        fd: wasip1::Fd,
        iovs: wasip1::IovecArray<'_>,
    )

Source from the content-addressed store, hash-verified

237 }
238
239 pub unsafe fn read(
240 &self,
241 fd: wasip1::Fd,
242 iovs: wasip1::IovecArray<'_>,
243 ) -> Result<wasip1::Size, wasip1::Errno> {
244 loop {
245 match (self, unsafe { wasip1::fd_read(fd, iovs) }) {
246 (BlockingMode::NonBlocking, Err(wasip1::ERRNO_AGAIN)) => {
247 Self::poll(fd, wasip1::EVENTTYPE_FD_READ)?;
248 }
249 (_, result) => break result,
250 }
251 }
252 }
253
254 pub unsafe fn write(
255 &self,

Callers 15

requestFunction · 0.45
test_path_open_lotsFunction · 0.45
incoming_bodyFunction · 0.45
test_tcp_ping_pongFunction · 0.45
test_tcp_receive_onceFunction · 0.45
test_tcp_busy_pollFunction · 0.45
mainFunction · 0.45
short_readsMethod · 0.45

Calls 2

fd_readFunction · 0.85
pollFunction · 0.50

Tested by 14

test_path_open_lotsFunction · 0.36
test_tcp_ping_pongFunction · 0.36
test_tcp_receive_onceFunction · 0.36
test_tcp_busy_pollFunction · 0.36
test_file_seek_tellFunction · 0.36
test_file_read_writeFunction · 0.36
test_tcp_busy_pollFunction · 0.36