MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / read_iovec

Function read_iovec

performance-metrics/src/util.rs:85–90  ·  view source on GitHub ↗

Build an iovec suitable for a read into `buf`.

(buf: &mut [u8])

Source from the content-addressed store, hash-verified

83
84/// Build an iovec suitable for a read into `buf`.
85pub fn read_iovec(buf: &mut [u8]) -> libc::iovec {
86 libc::iovec {
87 iov_base: buf.as_mut_ptr().cast(),
88 iov_len: buf.len(),
89 }
90}
91
92/// Build an iovec suitable for a write from `buf`.
93pub fn write_iovec(buf: &[u8]) -> libc::iovec {

Calls 2

as_mut_ptrMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected