Struct io_uring::squeue::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(&mut 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.

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(&mut 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(&mut 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<E: EntryMarker> Debug for SubmissionQueue<'_, E>

source§

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

Formats the value using the given formatter. Read more
source§

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

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

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

§

impl<'a, E> RefUnwindSafe for SubmissionQueue<'a, E>
where E: RefUnwindSafe,

§

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

§

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

§

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

§

impl<'a, E> UnwindSafe for SubmissionQueue<'a, E>
where E: RefUnwindSafe,

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.