io-uring: add readable/writable
This commit is contained in:
parent
25d817b722
commit
dcdd91c0b0
31 changed files with 285 additions and 189 deletions
|
|
@ -1,2 +1,21 @@
|
|||
use crate::{io_uring::IoUringError, utils::oserror::OsError};
|
||||
|
||||
pub mod async_cancel;
|
||||
pub mod poll;
|
||||
pub mod write;
|
||||
|
||||
pub type TaskResult<T> = Result<Result<T, OsError>, IoUringError>;
|
||||
|
||||
pub trait TaskResultExt<T> {
|
||||
fn merge(self) -> Result<T, IoUringError>;
|
||||
}
|
||||
|
||||
impl<T> TaskResultExt<T> for TaskResult<T> {
|
||||
fn merge(self) -> Result<T, IoUringError> {
|
||||
match self {
|
||||
Ok(Ok(t)) => Ok(t),
|
||||
Ok(Err(e)) => Err(IoUringError::OsError(e)),
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue