Skip to main content

SubmissionQueue

Struct SubmissionQueue 

Source
pub struct SubmissionQueue<'a, E: EntryMarker = Entry> { /* private fields */ }
Expand description

An io_uring instance’s submission queue. This is used to send I/O requests to the kernel.

Implementations§

Source§

impl<E: EntryMarker> SubmissionQueue<'_, E>

Source

pub fn sync(&self)

Synchronize this type with the real submission queue.

This will flush any entries added by push or push_multiple and will update the queue’s length if the kernel has consumed some entries in the meantime.

Source

pub fn need_wakeup(&self) -> bool

When is_setup_sqpoll is set, whether the kernel threads has gone to sleep and requires a system call to wake it up.

A result of false is only meaningful if the function was called after the latest update to the queue head. Other interpretations could lead to a race condition where the kernel concurrently put the device to sleep and no further progress is made.

Source

pub fn need_wakeup_after_intermittent_seqcst(&self) -> bool

The effect of Self::need_wakeup, after synchronization work performed by the caller.

This function should only be called if the caller can guarantee that a SeqCst fence has been inserted after the last write to the queue’s head. The function is then a little more efficient by avoiding to perform one itself.

Failure to uphold the precondition can result in an effective dead-lock due to a sleeping device.

Source

pub fn dropped(&self) -> u32

The number of invalid submission queue entries that have been encountered in the ring buffer.

Source

pub fn cq_overflow(&self) -> bool

Returns true if the completion queue ring is overflown.

Source

pub fn taskrun(&self) -> bool

Returns true if completions are pending that should be processed. Only relevant when used in conjuction with the setup_taskrun_flag function. Available since 5.19.

Source

pub fn capacity(&self) -> usize

Get the total number of entries in the submission queue ring buffer.

Source

pub fn len(&self) -> usize

Get the number of submission queue events in the ring buffer.

Source

pub fn is_empty(&self) -> bool

Returns true if the submission queue ring buffer is empty.

Source

pub fn is_full(&self) -> bool

Returns true if the submission queue ring buffer has reached capacity, and no more events can be added before the kernel consumes some.

Source

pub unsafe fn push_inline<F>(&self, f: F) -> Result<(), PushError>
where F: FnOnce(&mut E),

Attempts to push an entry into the queue. If the queue is full, an error is returned.

§Safety

Developers must ensure that parameters of the entry (such as buffer) are valid and will be valid for the entire duration of the operation, otherwise it may cause memory problems.

Source

pub unsafe fn push(&self, entry: &E) -> Result<(), PushError>

Attempts to push an entry into the queue. If the queue is full, an error is returned.

§Safety

Developers must ensure that parameters of the entry (such as buffer) are valid and will be valid for the entire duration of the operation, otherwise it may cause memory problems.

Source

pub unsafe fn push_multiple(&self, entries: &[E]) -> Result<(), PushError>

Attempts to push several entries into the queue. If the queue does not have space for all of the entries, an error is returned.

§Safety

Developers must ensure that parameters of all the entries (such as buffer) are valid and will be valid for the entire duration of the operation, otherwise it may cause memory problems.

Trait Implementations§

Source§

impl<'a, E: Clone + EntryMarker> Clone for SubmissionQueue<'a, E>

Source§

fn clone(&self) -> SubmissionQueue<'a, E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, E: EntryMarker> Copy for SubmissionQueue<'a, E>

Source§

impl<E: EntryMarker> Debug for SubmissionQueue<'_, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, E = Entry> !RefUnwindSafe for SubmissionQueue<'a, E>

§

impl<'a, E = Entry> !Send for SubmissionQueue<'a, E>

§

impl<'a, E = Entry> !Sync for SubmissionQueue<'a, E>

§

impl<'a, E = Entry> !UnwindSafe for SubmissionQueue<'a, E>

§

impl<'a, E> Freeze for SubmissionQueue<'a, E>

§

impl<'a, E> Unpin for SubmissionQueue<'a, E>

§

impl<'a, E> UnsafeUnpin for SubmissionQueue<'a, E>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.