forked from compio-rs/compio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
35 lines (32 loc) · 903 Bytes
/
mod.rs
File metadata and controls
35 lines (32 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cfg_if::cfg_if! {
if #[cfg(io_uring)] {
cfg_if::cfg_if! {
if #[cfg(fusion)] {
mod fusion;
pub use fusion::*;
} else {
mod iour;
pub use iour::*;
}
}
} else {
mod fallback;
pub use fallback::*;
}
}
/// Trait to get the selected buffer of an io operation.
pub trait TakeBuffer {
/// Selected buffer type. It keeps the reference to the buffer pool and
/// returns the buffer back on drop.
type Buffer<'a>;
/// Buffer pool type.
type BufferPool;
/// Take the selected buffer with `buffer_pool`, io `result` and `flags`, if
/// io operation is success.
fn take_buffer(
self,
buffer_pool: &Self::BufferPool,
result: std::io::Result<usize>,
flags: u32,
) -> std::io::Result<Self::Buffer<'_>>;
}