pub struct AioCb<'a> { /* private fields */ }
Expand description
A single asynchronous I/O operation
Implementations
sourceimpl<'a> AioCb<'a>
impl<'a> AioCb<'a>
Wrapper around nix::sys::aio::AioCb.
Implements mio::Source. After creation, use mio::Source::register to connect to the event loop
sourcepub fn from_mut_slice(
fd: RawFd,
offs: u64,
buf: &'a mut [u8],
prio: c_int,
opcode: LioOpcode
) -> AioCb<'_>
pub fn from_mut_slice(
fd: RawFd,
offs: u64,
buf: &'a mut [u8],
prio: c_int,
opcode: LioOpcode
) -> AioCb<'_>
Wraps nix::sys::aio::from_mut_slice
Not as useful as it sounds, because in typical mio use cases, the compiler can’t guarantee that the slice’s lifetime is respected.
sourcepub fn from_slice(
fd: RawFd,
offs: u64,
buf: &'a [u8],
prio: c_int,
opcode: LioOpcode
) -> AioCb<'_>
pub fn from_slice(
fd: RawFd,
offs: u64,
buf: &'a [u8],
prio: c_int,
opcode: LioOpcode
) -> AioCb<'_>
Wraps nix::sys::aio::from_slice
Mostly useful for writing constant slices
sourcepub fn aio_return(&mut self) -> Result<isize>
pub fn aio_return(&mut self) -> Result<isize>
Read the final result of the operation
sourcepub fn cancel(&mut self) -> Result<AioCancelStat>
pub fn cancel(&mut self) -> Result<AioCancelStat>
Ask the operating system to cancel the operation
Most file systems on most operating systems don’t actually support
cancellation; they’ll just return AIO_NOTCANCELED
.
sourcepub fn error(&mut self) -> Result<()>
pub fn error(&mut self) -> Result<()>
Retrieve the status of an in-progress or complete operation.
Not usually needed, since mio_aio
always uses kqueue for notification.
sourcepub fn fsync(&mut self, mode: AioFsyncMode) -> Result<()>
pub fn fsync(&mut self, mode: AioFsyncMode) -> Result<()>
Asynchronously fsync a file.
Trait Implementations
sourceimpl<'a> Source for AioCb<'a>
impl<'a> Source for AioCb<'a>
sourcefn register(
&mut self,
registry: &Registry,
token: Token,
interests: Interest
) -> Result<()>
fn register(
&mut self,
registry: &Registry,
token: Token,
interests: Interest
) -> Result<()>
Register self
with the given Registry
instance. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for AioCb<'a>
impl<'a> Send for AioCb<'a>
impl<'a> Sync for AioCb<'a>
impl<'a> Unpin for AioCb<'a>
impl<'a> UnwindSafe for AioCb<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more