compio_driver/
driver_type.rs1#[repr(u8)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4pub enum DriverType {
5 Poll,
7 IoUring,
9 IOCP,
11}
12
13impl DriverType {
14 #[cfg(fusion)]
19 pub(crate) fn suggest(additional: crate::op::OpCodeFlag) -> DriverType {
20 use crate::op::OpCodeFlag;
21
22 let flags = additional | OpCodeFlag::basic();
23
24 if flags.get_codes().all(crate::sys::is_op_supported) {
25 DriverType::IoUring
26 } else {
27 DriverType::Poll
28 }
29 }
30
31 pub fn is_polling(&self) -> bool {
33 *self == DriverType::Poll
34 }
35
36 pub fn is_iouring(&self) -> bool {
38 *self == DriverType::IoUring
39 }
40
41 pub fn is_iocp(&self) -> bool {
43 *self == DriverType::IOCP
44 }
45}