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>
impl<E: EntryMarker> SubmissionQueue<'_, E>
sourcepub fn sync(&mut self)
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.
sourcepub fn need_wakeup(&self) -> bool
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.
sourcepub fn dropped(&self) -> u32
pub fn dropped(&self) -> u32
The number of invalid submission queue entries that have been encountered in the ring buffer.
sourcepub fn cq_overflow(&self) -> bool
pub fn cq_overflow(&self) -> bool
Returns true
if the completion queue ring is overflown.
sourcepub fn taskrun(&self) -> bool
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.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Get the total number of entries in the submission queue ring buffer.
sourcepub fn is_full(&self) -> bool
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.
sourcepub unsafe fn push(&mut self, entry: &E) -> Result<(), PushError>
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.
sourcepub unsafe fn push_multiple(&mut self, entries: &[E]) -> Result<(), PushError>
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.