MCPcopy Create free account
hub / github.com/bytecodealliance/system-interface / write_all_vectored_at

Method write_all_vectored_at

src/fs/file_io_ext.rs:221–235  ·  view source on GitHub ↗

Is to `write_all_vectored` what `write_all_at` is to `write_all`.

(&self, mut bufs: &mut [IoSlice], mut offset: u64)

Source from the content-addressed store, hash-verified

219
220 /// Is to `write_all_vectored` what `write_all_at` is to `write_all`.
221 fn write_all_vectored_at(&self, mut bufs: &mut [IoSlice], mut offset: u64) -> io::Result<()> {
222 while !bufs.is_empty() {
223 match self.write_vectored_at(bufs, offset) {
224 Ok(nwritten) => {
225 offset = offset
226 .checked_add(nwritten.try_into().unwrap())
227 .ok_or_else(|| io::Error::new(io::ErrorKind::Other, "offset overflow"))?;
228 bufs = advance(bufs, nwritten);
229 }
230 Err(ref e) if e.kind() == io::ErrorKind::Interrupted => (),
231 Err(e) => return Err(e),
232 }
233 }
234 Ok(())
235 }
236
237 /// Determines if this `FileIoExt` implementation has an efficient
238 /// `write_vectored_at` implementation.

Callers

nothing calls this directly

Implementers 1

file_io_ext.rssrc/fs/file_io_ext.rs

Calls 2

advanceFunction · 0.70
write_vectored_atMethod · 0.45

Tested by

no test coverage detected