[][src]Struct rio::Rio

pub struct Rio { /* fields omitted */ }

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

Don't do anything. This is mostly for debugging and tuning.

Trait Implementations

impl Debug for Uring[src]

impl Drop for Uring[src]

impl Send for Uring[src]

impl Sync for Uring[src]

Auto Trait Implementations

impl !RefUnwindSafe for Uring

impl Unpin for Uring

impl !UnwindSafe for Uring

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.