[][src]Struct iou::SubmissionQueue

pub struct SubmissionQueue<'ring> { /* fields omitted */ }

The queue of pending IO events.

Each element is a SQE. By default, events are processed in parallel after being submitted. You can modify this behavior for specific events using event SubmissionFlags.


Consider a read event that depends on a successful write beforehand.

We reify this relationship by using IO_LINK to link these events.

let mut write_event = sq.prepare_sqe().unwrap();

// -- write event prep elided

// set IO_LINK to link the next event to this one

let mut read_event = sq.prepare_sqe().unwrap();

// -- read event prep elided

// read_event only occurs if write_event was successful


impl<'ring> SubmissionQueue<'ring>[src]

pub fn prepare_sqe<'a>(&'a mut self) -> Option<SQE<'a>>[src]

Returns new SQEs until the queue size is reached. After that, will return None.

let mut ring = IoUring::new(ring_size)?;

let mut counter = 0;

while let Some(event) = ring.prepare_sqe() {
    counter += 1;

assert_eq!(counter, ring_size);

pub fn prepare_sqes<'a>(&'a mut self, count: u32) -> Option<SQEs<'a>>[src]

pub fn submit(&mut self) -> Result<u32>[src]

Submit all events in the queue. Returns the number of submitted events.

If this function encounters any IO errors an io::Error variant is returned.

pub fn submit_and_wait(&mut self, wait_for: u32) -> Result<u32>[src]

pub fn submit_and_wait_with_timeout(
    &mut self,
    wait_for: u32,
    duration: Duration
) -> Result<u32>

pub fn ready(&self) -> u32[src]

pub fn space_left(&self) -> u32[src]

Trait Implementations

impl<'_> Debug for SubmissionQueue<'_>[src]

impl<'ring> Send for SubmissionQueue<'ring>[src]

impl<'ring> Sync for SubmissionQueue<'ring>[src]

Auto Trait Implementations

impl<'ring> RefUnwindSafe for SubmissionQueue<'ring>

impl<'ring> Unpin for SubmissionQueue<'ring>

impl<'ring> !UnwindSafe for SubmissionQueue<'ring>

Blanket Implementations

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

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

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

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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.