[−][src]Struct io_uring::UringQueue
UringQueue provides safe access to io_uring features.
Methods
impl UringQueue
[src]
pub fn new(queue_depth: u32) -> Result<Self, Error>
[src]
Create a new UringQueue with a fixed queue depth.
pub fn register_eventfd(&mut self, efd: RawFd) -> Result<(), Error>
[src]
Register an eventfd with the underlying io_uring to be notified when there's a pending completion in the queue.
pub fn prepare_read(
&mut self,
fd: RawFd,
buf: &mut [u8],
offset: i64,
cookie: u64
) -> Result<(), Error>
[src]
&mut self,
fd: RawFd,
buf: &mut [u8],
offset: i64,
cookie: u64
) -> Result<(), Error>
Prepare and queue a request for reading from fd
, starting at offset
, and
storing the result in buf
. cookie
is an arbitrary u64 value that can be
used to keep track of the request.
pub fn prepare_write(
&mut self,
fd: RawFd,
buf: &[u8],
offset: i64,
cookie: u64
) -> Result<(), Error>
[src]
&mut self,
fd: RawFd,
buf: &[u8],
offset: i64,
cookie: u64
) -> Result<(), Error>
Prepare and queue a request for writing the contents of buf
to fd
,
starting at offset
. cookie
is an arbitrary u64 value that can be
used to keep track of the request.
pub fn submit_requests(&mut self) -> Result<(), Error>
[src]
Notify the kernel that there are pending requests in the queue.
pub fn get_completion(&mut self, wait: bool) -> Result<Option<u64>, Error>
[src]
Check the completion queue and, if there's completion available to be
retrieved, process it and return the u64 value specified as cookie
in the request.
If there are no completions available in the queue and wait
is
true
, keep waiting until there's a completion available, otherwise
return None
.
Trait Implementations
impl Drop for UringQueue
[src]
Auto Trait Implementations
impl !Send for UringQueue
impl !Sync for UringQueue
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,