Trait a10::io::BufMutSlice
source · pub unsafe trait BufMutSlice<const N: usize>: 'static {
// Required methods
unsafe fn as_iovecs_mut(&mut self) -> [iovec; N];
unsafe fn set_init(&mut self, n: usize);
}
Expand description
Required Methods§
sourceunsafe fn as_iovecs_mut(&mut self) -> [iovec; N]
unsafe fn as_iovecs_mut(&mut self) -> [iovec; N]
Returns the writable buffers as iovec
structures.
§Safety
This has the same safety requirements as BufMut::parts_mut
, but then
for all buffers used.
sourceunsafe fn set_init(&mut self, n: usize)
unsafe fn set_init(&mut self, n: usize)
Mark n
bytes as initialised.
§Safety
The caller must ensure that n
bytes are initialised in the vectors
return by BufMutSlice::as_iovecs_mut
.
The implementation must ensure that that proper buffer(s) are
initialised. For example when this is called with n = 10
with two
buffers of size 8
the implementation should initialise the first
buffer with n = 8
and the second with n = 10 - 8 = 2
.