Trait mio_aio::SourceApi

source ·
pub trait SourceApi {
    type Output;

    // Required methods
    fn aio_return(self: Pin<&mut Self>) -> Result<Self::Output>;
    fn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>;
    fn error(self: Pin<&mut Self>) -> Result<()>;
    fn in_progress(&self) -> bool;
    fn submit(self: Pin<&mut Self>) -> Result<()>;
}
Expand description

Common methods supported by all POSIX AIO Mio sources

Required Associated Types§

source

type Output

Return type of SourceApi::aio_return.

Required Methods§

source

fn aio_return(self: Pin<&mut Self>) -> Result<Self::Output>

Read the final result of the operation

source

fn cancel(self: Pin<&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.

source

fn error(self: Pin<&mut Self>) -> Result<()>

Retrieve the status of an in-progress or complete operation.

Not usually needed, since mio_aio always uses kqueue for notification.

source

fn in_progress(&self) -> bool

Does this operation currently have any in-kernel state?

source

fn submit(self: Pin<&mut Self>) -> Result<()>

Actually start the I/O operation.

After calling this method and until SourceApi::aio_return returns Ok, the structure may not be moved in memory.

Implementors§

source§

impl<T: Aio> SourceApi for Source<T>

§

type Output = <T as Aio>::Output