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

Method check_write

crates/wasi/src/p2/write_stream.rs:54–65  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

52 }
53 }
54 fn check_write(&self) -> Result<usize, StreamError> {
55 let mut state = self.state();
56 if let Err(e) = state.check_error() {
57 return Err(e);
58 }
59
60 if state.flush_pending || state.write_budget == 0 {
61 return Ok(0);
62 }
63
64 Ok(state.write_budget)
65 }
66 fn state(&self) -> std::sync::MutexGuard<'_, WorkerState> {
67 self.state.lock().unwrap()
68 }

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
check_errorMethod · 0.80
stateMethod · 0.45

Tested by

no test coverage detected