Trait IoVecBufMut

Source
pub unsafe trait IoVecBufMut: Unpin + 'static {
    // Required methods
    fn write_iovec_ptr(&mut self) -> *mut iovec;
    fn write_iovec_len(&mut self) -> usize;
    unsafe fn set_init(&mut self, pos: usize);
}
Expand description

A mutable io_uring compatible iovec buffer.

§Safety

See the safety note of the methods.

Required Methods§

Source

fn write_iovec_ptr(&mut self) -> *mut iovec

Returns a raw mutable pointer to iovec struct. struct iovec { void iov_base; / Starting address / size_t iov_len; / Number of bytes to transfer */ }; [iovec1][iovec2][iovec3]… ^ The pointer

§Safety

The implementation must ensure that, while the runtime owns the value, the pointer returned by write_iovec_ptr does not change. Also, the value pointed must be a valid iovec struct.

Source

fn write_iovec_len(&mut self) -> usize

Returns the count of iovec struct behind the pointer.

Source

unsafe fn set_init(&mut self, pos: usize)

Updates the number of initialized bytes.

The specified pos becomes the new value returned by IoBuf::bytes_init.

§Safety

The caller must ensure that there are really pos data initialized.

Implementors§