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]
impl<'a> AioCb<'a>
pub fn from_fd(fd: RawFd, prio: c_int, sigev_notify: SigevNotify) -> AioCb<'a>
[src]
pub 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 minusprio
sigev_notify
Determines how you will be notified of event completion.
pub fn from_mut_slice(
fd: RawFd,
offs: off_t,
buf: &'a mut [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode
) -> AioCb<'a>
[src]
pub fn from_mut_slice(
fd: RawFd,
offs: off_t,
buf: &'a mut [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode
) -> AioCb<'a>
Constructs a new AioCb
.
fd
File descriptor. Required for all aio functions.offs
File offsetbuf
A memory bufferprio
If POSIX Prioritized IO is supported, then the operation will be prioritized at the process's priority level minusprio
sigev_notify
Determines how you will be notified of event completion.opcode
This field is only used forlio_listio
. It determines which operation to use for this individual aiocb
pub fn from_boxed_slice(
fd: RawFd,
offs: off_t,
buf: Rc<Box<[u8]>>,
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode
) -> AioCb<'a>
[src]
pub fn from_boxed_slice(
fd: RawFd,
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.
fd
File descriptor. Required for all aio functions.offs
File offsetbuf
A shared memory buffer on the heapprio
If POSIX Prioritized IO is supported, then the operation will be prioritized at the process's priority level minusprio
sigev_notify
Determines how you will be notified of event completion.opcode
This field is only used forlio_listio
. It determines which operation to use for this individual aiocb
pub fn from_slice(
fd: RawFd,
offs: off_t,
buf: &'a [u8],
prio: c_int,
sigev_notify: SigevNotify,
opcode: LioOpcode
) -> AioCb
[src]
pub fn from_slice(
fd: RawFd,
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.
pub fn set_sigev_notify(&mut self, sigev_notify: SigevNotify)
[src]
pub fn set_sigev_notify(&mut self, sigev_notify: SigevNotify)
Update the notification settings for an existing aiocb
pub fn cancel(&mut self) -> Result<AioCancelStat>
[src]
pub fn cancel(&mut self) -> Result<AioCancelStat>
Cancels an outstanding AIO request.
pub fn error(&mut self) -> Result<()>
[src]
pub 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.
pub fn fsync(&mut self, mode: AioFsyncMode) -> Result<()>
[src]
pub fn fsync(&mut self, mode: AioFsyncMode) -> Result<()>
An asynchronous version of fsync
.
pub fn read(&mut self) -> Result<()>
[src]
pub fn read(&mut self) -> Result<()>
Asynchronously reads from a file descriptor into a buffer
pub fn aio_return(&mut self) -> Result<isize>
[src]
pub 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
.
pub fn write(&mut self) -> Result<()>
[src]
pub 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> Debug for AioCb<'a>
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Drop for AioCb<'a>
[src]
impl<'a> Drop for AioCb<'a>