pub unsafe trait IoBufMut: IoBuf {
// Required methods
fn stable_mut_ptr(&mut self) -> *mut u8;
unsafe fn set_init(&mut self, pos: usize);
}
Expand description
A mutableio-uring
compatible buffer.
The IoBufMut
trait is implemented by buffer types that can be passed to
io-uring operations. Users will not need to use this trait directly.
§Safety
Buffers passed to io-uring
operations must reference a stable memory
region. While the runtime holds ownership to a buffer, the pointer returned
by stable_mut_ptr
must remain valid even if the IoBufMut
value is moved.
Required Methods§
Sourcefn stable_mut_ptr(&mut self) -> *mut u8
fn stable_mut_ptr(&mut self) -> *mut u8
Returns a raw mutable pointer to the vector’s buffer.
This method is to be used by the tokio-uring
runtime and it is not
expected for users to call it directly.
The implementation must ensure that, while the tokio-uring
runtime
owns the value, the pointer returned by stable_mut_ptr
does not
change.