(&mut self, bytes: Bytes)
| 211 | #[async_trait::async_trait] |
| 212 | impl wasmtime_wasi::p2::OutputStream for CustomOutputStream { |
| 213 | fn write(&mut self, bytes: Bytes) -> Result<(), StreamError> { |
| 214 | let wrote = self |
| 215 | .inner |
| 216 | .raw_write(&bytes) |
| 217 | .map_err(|e| StreamError::LastOperationFailed(e.into()))?; |
| 218 | |
| 219 | if wrote != bytes.len() { |
| 220 | return Err(StreamError::LastOperationFailed(wasmtime::format_err!( |
| 221 | "Partial writes in wasip2 implementation are not allowed" |
| 222 | ))); |
| 223 | } |
| 224 | |
| 225 | Ok(()) |
| 226 | } |
| 227 | fn flush(&mut self) -> Result<(), StreamError> { |
| 228 | Ok(()) |
| 229 | } |
no test coverage detected