pub unsafe trait IoBufMut: Send + 'static {
// Required methods
fn as_mut_ptr(&mut self) -> *mut u8;
fn capacity(&self) -> usize;
}Expand description
A buffer that can be used for io_uring read operations.
§Safety
Implementors must guarantee that:
- The pointer returned by
as_mut_ptr()remains valid and at a stable address until the I/O operation completes, even ifselfis moved. - This is automatically satisfied for heap-allocated buffers (
Vec<u8>,Box<[u8]>, etc.) but NOT for stack-allocated arrays.
Required Methods§
Sourcefn as_mut_ptr(&mut self) -> *mut u8
fn as_mut_ptr(&mut self) -> *mut u8
Returns a mutable pointer to the buffer’s data.