[−][src]Struct iou::SubmissionQueue
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
.
Examples
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 write_event.set_flags(SubmissionFlags::IO_LINK); let mut read_event = sq.prepare_sqe().unwrap(); // -- read event prep elided // read_event only occurs if write_event was successful sq.submit()?;
Implementations
impl<'ring> SubmissionQueue<'ring>
[src]
pub fn prepare_sqe<'a>(&'a mut self) -> Option<SQE<'a>>
[src]
Returns new SQE
s 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); assert!(ring.prepare_sqe().is_none());
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>
[src]
&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,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,