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§
Sourcetype Output
type Output
Return type of SourceApi::aio_return
.
Required Methods§
Sourcefn aio_return(self: Pin<&mut Self>) -> Result<Self::Output>
fn aio_return(self: Pin<&mut Self>) -> Result<Self::Output>
Read the final result of the operation
Sourcefn cancel(self: Pin<&mut Self>) -> Result<AioCancelStat>
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
.
Sourcefn error(self: Pin<&mut Self>) -> Result<()>
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.
Sourcefn in_progress(&self) -> bool
fn in_progress(&self) -> bool
Does this operation currently have any in-kernel state?