Struct nix::sys::aio::AioCb
[−]
[src]
pub struct AioCb<'a> { /* fields omitted */ }The basic structure used by all aio functions. Each aiocb represents one
I/O request.
Methods
impl<'a> AioCb<'a>[src]
fn from_fd(fd: RawFd, prio: c_int, sigev_notify: SigevNotify) -> AioCb<'a>
Constructs a new AioCb with no associated buffer.
The resulting AioCb structure is suitable for use with AioCb::fsync.
* fd File descriptor. Required for all aio functions.
* prio If POSIX Prioritized IO is supported, then the operation will
be prioritized at the process's priority level minus prio
* sigev_notify Determines how you will be notified of event
completion.
fn from_mut_slice(fd: RawFd,
offs: off_t,
buf: &'a mut [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb<'a>
offs: off_t,
buf: &'a mut [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb<'a>
Constructs a new AioCb.
fdFile descriptor. Required for all aio functions.offsFile offsetbufA memory bufferprioIf POSIX Prioritized IO is supported, then the operation will be prioritized at the process's priority level minuspriosigev_notifyDetermines how you will be notified of event completion.opcodeThis field is only used forlio_listio. It determines which operation to use for this individual aiocb
fn from_boxed_slice(fd: RawFd,
offs: off_t,
buf: Rc<Box<[u8]>>,
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb<'a>
offs: off_t,
buf: Rc<Box<[u8]>>,
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb<'a>
Constructs a new AioCb.
Unlike from_mut_slice, this method returns a structure suitable for
placement on the heap.
fdFile descriptor. Required for all aio functions.offsFile offsetbufA shared memory buffer on the heapprioIf POSIX Prioritized IO is supported, then the operation will be prioritized at the process's priority level minuspriosigev_notifyDetermines how you will be notified of event completion.opcodeThis field is only used forlio_listio. It determines which operation to use for this individual aiocb
fn from_slice(fd: RawFd,
offs: off_t,
buf: &'a [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb
offs: off_t,
buf: &'a [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode)
-> AioCb
Like from_mut_slice, but works on constant slices rather than
mutable slices.
An AioCb created this way cannot be used with read, and its
LioOpcode cannot be set to LIO_READ. This method is useful when
writing a const buffer with AioCb::write, since from_mut_slice can't
work with const buffers.
fn set_sigev_notify(&mut self, sigev_notify: SigevNotify)
Update the notification settings for an existing aiocb
fn cancel(&mut self) -> Result<AioCancelStat>
Cancels an outstanding AIO request.
fn error(&mut self) -> Result<()>
Retrieve error status of an asynchronous operation. If the request has
not yet completed, returns EINPROGRESS. Otherwise, returns Ok or
any other error.
fn fsync(&mut self, mode: AioFsyncMode) -> Result<()>
An asynchronous version of fsync.
fn read(&mut self) -> Result<()>
Asynchronously reads from a file descriptor into a buffer
fn aio_return(&mut self) -> Result<isize>
Retrieve return status of an asynchronous operation. Should only be
called once for each AioCb, after AioCb::error indicates that it has
completed. The result is the same as for read, write, of fsync.
fn write(&mut self) -> Result<()>
Asynchronously writes from a buffer to a file descriptor
Trait Implementations
impl<'a> Debug for AioCb<'a>[src]
impl<'a> Drop for AioCb<'a>[src]
fn drop(&mut self)
If the AioCb has no remaining state in the kernel, just drop it.
Otherwise, collect its error and return values, so as not to leak
resources.