[][src]Struct io_uring::UringQueue

pub struct UringQueue { /* fields omitted */ }

UringQueue provides safe access to io_uring features.

Methods

impl UringQueue[src]

pub fn new(queue_depth: u32) -> Result<Self, Error>[src]

Create a new UringQueue with a fixed queue depth.

pub fn register_eventfd(&mut self, efd: RawFd) -> Result<(), Error>[src]

Register an eventfd with the underlying io_uring to be notified when there's a pending completion in the queue.

pub fn prepare_read(
    &mut self,
    fd: RawFd,
    buf: &mut [u8],
    offset: i64,
    cookie: u64
) -> Result<(), Error>
[src]

Prepare and queue a request for reading from fd, starting at offset, and storing the result in buf. cookie is an arbitrary u64 value that can be used to keep track of the request.

pub fn prepare_write(
    &mut self,
    fd: RawFd,
    buf: &[u8],
    offset: i64,
    cookie: u64
) -> Result<(), Error>
[src]

Prepare and queue a request for writing the contents of buf to fd, starting at offset. cookie is an arbitrary u64 value that can be used to keep track of the request.

pub fn submit_requests(&mut self) -> Result<(), Error>[src]

Notify the kernel that there are pending requests in the queue.

pub fn get_completion(&mut self, wait: bool) -> Result<Option<u64>, Error>[src]

Check the completion queue and, if there's completion available to be retrieved, process it and return the u64 value specified as cookie in the request.

If there are no completions available in the queue and wait is true, keep waiting until there's a completion available, otherwise return None.

Trait Implementations

impl Drop for UringQueue[src]

Auto Trait Implementations

impl !Send for UringQueue

impl !Sync for UringQueue

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]