IoBufMut

Trait IoBufMut 

Source
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 if self is moved.
  • This is automatically satisfied for heap-allocated buffers (Vec<u8>, Box<[u8]>, etc.) but NOT for stack-allocated arrays.

Required Methods§

Source

fn as_mut_ptr(&mut self) -> *mut u8

Returns a mutable pointer to the buffer’s data.

Source

fn capacity(&self) -> usize

Returns the buffer’s total capacity (maximum bytes that can be read into it).

Implementations on Foreign Types§

Source§

impl IoBufMut for Box<[u8]>

Source§

fn as_mut_ptr(&mut self) -> *mut u8

Source§

fn capacity(&self) -> usize

Source§

impl IoBufMut for Vec<u8>

Source§

fn as_mut_ptr(&mut self) -> *mut u8

Source§

fn capacity(&self) -> usize

Implementors§