Skip to main content

IoBuf

Trait IoBuf 

Source
pub unsafe trait IoBuf: Unpin + 'static {
    // Required methods
    fn stable_ptr(&self) -> *const u8;
    fn bytes_init(&self) -> usize;
    fn bytes_total(&self) -> usize;
}

Required Methods§

Source

fn stable_ptr(&self) -> *const u8

Returns a raw 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_ptr does not change.

Source

fn bytes_init(&self) -> usize

Number of initialized bytes.

This method is to be used by the tokio-uring runtime and it is not expected for users to call it directly.

For Vec, this is identical to len().

Source

fn bytes_total(&self) -> usize

Total size of the buffer, including uninitialized memory, if any.

This method is to be used by the tokio-uring runtime and it is not expected for users to call it directly.

For Vec, this is identical to capacity().

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IoBuf for BytesMut

Source§

impl IoBuf for Vec<u8>

Source§

impl<T: IoBuf> IoBuf for Box<T>

Implementors§

Source§

impl<T, F> IoBuf for MapSlice<T, F>
where for<'a> F: Fn(&'a ZeroCopyBuf<T>) -> &'a [u8] + Unpin + 'static, T: Unpin + 'static + AsBytes,

Source§

impl<T: AsBytes + Unpin + 'static> IoBuf for ZeroCopyBoxIoBuf<T>

Source§

impl<T: AsBytes + Unpin + 'static> IoBuf for ZeroCopyBuf<T>