Struct tokio_linux_aio::AioContext[][src]

pub struct AioContext { /* fields omitted */ }

AioContext provides a submission queue for asycnronous I/O operations to block devices within the Linux kernel.

Methods

impl AioContext
[src]

Create a new AioContext that is driven by the provided event loop.

Params

  • executor: The executor used to spawn the background polling task
  • nr: Number of submission slots for IO requests

Initiate an asynchronous read operation on the given file descriptor for reading data from the provided absolute file offset into the buffer. The buffer also determines the number of bytes to be read, which should be a multiple of the underlying device block size.

Params:

  • fd: The file descriptor of the file from which to read
  • offset: The file offset where we want to read from
  • buffer: A buffer to receive the read results

Initiate an asynchronous write operation on the given file descriptor for writing data to the provided absolute file offset from the buffer. The buffer also determines the number of bytes to be written, which should be a multiple of the underlying device block size.

Params:

  • fd: The file descriptor of the file to which to write
  • offset: The file offset where we want to write to
  • buffer: A buffer holding the data to be written

Initiate an asynchronous write operation on the given file descriptor for writing data to the provided absolute file offset from the buffer. The buffer also determines the number of bytes to be written, which should be a multiple of the underlying device block size.

Params:

  • fd: The file descriptor of the file to which to write
  • offset: The file offset where we want to write to
  • buffer: A buffer holding the data to be written
  • sync_level: A synchronization level to apply for this write operation

Initiate an asynchronous sync operation on the given file descriptor.

Caveat: While this operation is defined in the ABI, this command is known to fail with an invalid argument error (EINVAL) in many, if not all, cases. You are kind of on your own.

Params:

  • fd: The file descriptor of the file to which to write

Initiate an asynchronous data sync operation on the given file descriptor.

Caveat: While this operation is defined in the ABI, this command is known to fail with an invalid argument error (EINVAL) in many, if not all, cases. You are kind of on your own.

Params:

  • fd: The file descriptor of the file to which to write

Trait Implementations

impl Clone for AioContext
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for AioContext
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for AioContext

impl Sync for AioContext