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

Method write

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

Source from the content-addressed store, hash-verified

252 }
253
254 pub unsafe fn write(
255 &self,
256 fd: wasip1::Fd,
257 iovs: wasip1::CiovecArray<'_>,
258 ) -> Result<wasip1::Size, wasip1::Errno> {
259 loop {
260 match (self, unsafe { wasip1::fd_write(fd, iovs) }) {
261 (BlockingMode::NonBlocking, Err(wasip1::ERRNO_AGAIN)) => {
262 Self::poll(fd, wasip1::EVENTTYPE_FD_WRITE)?;
263 }
264 (_, result) => break result,
265 }
266 }
267 }
268}

Callers 15

blocking_write_utilMethod · 0.45
requestFunction · 0.45
test_path_open_lotsFunction · 0.45
outgoing_bodyFunction · 0.45
test_tcp_send_onceFunction · 0.45
handleMethod · 0.45
mainFunction · 0.45
handleMethod · 0.45

Calls 2

fd_writeFunction · 0.85
pollFunction · 0.50

Tested by 12

test_path_open_lotsFunction · 0.36
test_tcp_send_onceFunction · 0.36
test_file_seek_tellFunction · 0.36
test_file_read_writeFunction · 0.36
test_file_truncationFunction · 0.36
test_file_long_writeFunction · 0.36