[−][src]Struct rio::Rio
Nice bindings for the shiny new linux IO system
Methods
impl Uring
[src]
pub fn submit_all(&self) -> Result<()>
[src]
Block until all items in the submission queue
are submitted to the kernel. This can
be avoided by using the SQPOLL
mode
(a privileged operation) on the Config
struct.
pub fn fsync<'uring, 'file>(
&'uring self,
file: &'file File
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
[src]
&'uring self,
file: &'file File
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
Flushes all buffered writes, and associated metadata changes.
Warning
You usually don't want to do this without
linking to a previous write, because
io_uring
will execute operations out-of-order.
Without setting a Link
ordering on the previous
operation, or using fsync_ordered
with
the Drain
ordering, causing all previous
operations to complete before itself.
Additionally, fsync does not ensure that the file actually exists in its parent directory. So, for new files, you must also fsync the parent directory.
This does nothing for files opened in
O_DIRECT
mode.
pub fn fsync_ordered<'uring, 'file>(
&'uring self,
file: &'file File,
ordering: Ordering
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
[src]
&'uring self,
file: &'file File,
ordering: Ordering
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
Flushes all buffered writes, and associated metadata changes.
You probably want to
either use a Link
ordering on a previous
write (or chain of separate writes), or
use the Drain
ordering on this operation.
You may pass in an Ordering
to specify
two different optional behaviors:
Ordering::Link
causes the next submitted operation to wait until this one finishes. Useful for things like file copy, fsync-after-write, or proxies.Ordering::Drain
causes all previously submitted operations to complete before this one begins.
Warning
fsync does not ensure that
the file actually exists in its parent
directory. So, for new files, you must
also fsync the parent directory.
This does nothing for files opened in
O_DIRECT
mode.
pub fn fdatasync<'uring, 'file>(
&'uring self,
file: &'file File
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
[src]
&'uring self,
file: &'file File
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
Flushes all buffered writes, and the specific metadata required to access the data. This will skip syncing metadata like atime.
You probably want to
either use a Link
ordering on a previous
write (or chain of separate writes), or
use the Drain
ordering on this operation
with the fdatasync_ordered
method.
Warning
fdatasync does not ensure that
the file actually exists in its parent
directory. So, for new files, you must
also fsync the parent directory.
This does nothing for files opened in
O_DIRECT
mode.
pub fn fdatasync_ordered<'uring, 'file>(
&'uring self,
file: &'file File,
ordering: Ordering
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
[src]
&'uring self,
file: &'file File,
ordering: Ordering
) -> Result<Completion<'file, Result<io_uring_cqe>>> where
'file: 'uring,
'uring: 'file,
Flushes all buffered writes, and the specific metadata required to access the data. This will skip syncing metadata like atime.
You probably want to
either use a Link
ordering on a previous
write (or chain of separate writes), or
use the Drain
ordering on this operation.
You may pass in an Ordering
to specify
two different optional behaviors:
Ordering::Link
causes the next submitted operation to wait until this one finishes. Useful for things like file copy, fsync-after-write, or proxies.Ordering::Drain
causes all previously submitted operations to complete before this one begins.
Warning
fdatasync does not ensure that
the file actually exists in its parent
directory. So, for new files, you must
also fsync the parent directory.
This does nothing for files opened in
O_DIRECT
mode.
pub fn write_at<'uring, 'file, 'buf, F, B>(
&'uring self,
file: &'file F,
iov: B,
at: u64
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: 'buf + AsIoVec,
[src]
&'uring self,
file: &'file F,
iov: B,
at: u64
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: 'buf + AsIoVec,
Writes data at the provided buffer using
vectored IO. Be sure to check the returned
io_uring_cqe
's res
field to see if a
short write happened. This will contain
the number of bytes written.
Note that the file argument is generic for anything that supports AsRawFd: sockets, files, etc...
pub fn write_at_ordered<'uring, 'file, 'buf, F, B>(
&'uring self,
file: &'file F,
iov: B,
at: u64,
ordering: Ordering
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: 'buf + AsIoVec,
[src]
&'uring self,
file: &'file F,
iov: B,
at: u64,
ordering: Ordering
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: 'buf + AsIoVec,
Writes data at the provided buffer using vectored IO.
Be sure to check the returned
io_uring_cqe
's res
field to see if a
short write happened. This will contain
the number of bytes written.
You may pass in an Ordering
to specify
two different optional behaviors:
Ordering::Link
causes the next submitted operation to wait until this one finishes. Useful for things like file copy, fsync-after-write, or proxies.Ordering::Drain
causes all previously submitted operations to complete before this one begins.
Note that the file argument is generic for anything that supports AsRawFd: sockets, files, etc...
pub fn read_at<'uring, 'file, 'buf, F, B>(
&'uring self,
file: &'file F,
iov: &'buf B,
at: u64
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: AsIoVec + AsIoVecMut,
[src]
&'uring self,
file: &'file F,
iov: &'buf B,
at: u64
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: AsIoVec + AsIoVecMut,
Reads data into the provided buffer from the
given file-like object, at the given offest,
using vectored IO. Be sure to check the returned
io_uring_cqe
's res
field to see if a
short read happened. This will contain
the number of bytes read.
Note that the file argument is generic for anything that supports AsRawFd: sockets, files, etc...
pub fn read_at_ordered<'uring, 'file, 'buf, F, B>(
&'uring self,
file: &'file F,
iov: &'buf B,
at: u64,
ordering: Ordering
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: AsIoVec + AsIoVecMut,
[src]
&'uring self,
file: &'file F,
iov: &'buf B,
at: u64,
ordering: Ordering
) -> Result<Completion<'buf, Result<io_uring_cqe>>> where
'file: 'uring + 'buf,
'buf: 'uring + 'file,
'uring: 'buf + 'file,
F: AsRawFd,
B: AsIoVec + AsIoVecMut,
Reads data into the provided buffer using
vectored IO. Be sure to check the returned
io_uring_cqe
's res
field to see if a
short read happened. This will contain
the number of bytes read.
You may pass in an Ordering
to specify
two different optional behaviors:
Ordering::Link
causes the next submitted operation to wait until this one finishes. Useful for things like file copy, fsync-after-write, or proxies.Ordering::Drain
causes all previously submitted operations to complete before this one begins.
Note that the file argument is generic for anything that supports AsRawFd: sockets, files, etc...
pub fn nop<'uring>(
&'uring self
) -> Result<Completion<'uring, Result<io_uring_cqe>>>
[src]
&'uring self
) -> Result<Completion<'uring, Result<io_uring_cqe>>>
Don't do anything. This is mostly for debugging and tuning.
pub fn nop_ordered<'uring>(
&'uring self,
ordering: Ordering
) -> Result<Completion<'uring, Result<io_uring_cqe>>>
[src]
&'uring self,
ordering: Ordering
) -> Result<Completion<'uring, Result<io_uring_cqe>>>
Don't do anything. This is mostly for debugging and tuning.
Trait Implementations
Auto Trait Implementations
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>,