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

Function blocking_write_and_flush

crates/wasi/src/cli.rs:357–368  ·  view source on GitHub ↗
(s: &mut dyn OutputStream, mut bytes: Bytes)

Source from the content-addressed store, hash-verified

355 }
356
357 async fn blocking_write_and_flush(s: &mut dyn OutputStream, mut bytes: Bytes) -> Result<()> {
358 while !bytes.is_empty() {
359 let permit = s.write_ready().await?;
360 let len = bytes.len().min(permit);
361 let chunk = bytes.split_to(len);
362 s.write(chunk)?;
363 }
364
365 s.flush()?;
366 s.write_ready().await?;
367 Ok(())
368 }
369}

Callers 3

writeMethod · 0.85

Calls 7

OkFunction · 0.85
write_readyMethod · 0.80
is_emptyMethod · 0.45
minMethod · 0.45
lenMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected