Struct io_uring::types::BufRingEntry

source ·
pub struct BufRingEntry(/* private fields */);

Implementations§

source§

impl BufRingEntry

An entry in a buf_ring that allows setting the address, length and buffer id.

source

pub fn set_addr(&mut self, addr: u64)

Sets the entry addr.

source

pub fn addr(&self) -> u64

Returns the entry addr.

source

pub fn set_len(&mut self, len: u32)

Sets the entry len.

source

pub fn len(&self) -> u32

Returns the entry len.

source

pub fn set_bid(&mut self, bid: u16)

Sets the entry bid.

source

pub fn bid(&self) -> u16

Returns the entry bid.

source

pub unsafe fn tail(ring_base: *const BufRingEntry) -> *const u16

The offset to the ring’s tail field given the ring’s base address.

The caller should ensure the ring’s base address is aligned with the system’s page size, per the uring interface requirements.

§Safety

The ptr will be dereferenced in order to determine the address of the resv field, so the caller is responsible for passing in a valid pointer. And not just a valid pointer type, but also the argument must be the address to the first entry of the buf_ring for the resv field to even be considered the tail field of the ring. The entry must also be properly initialized.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.