Skip to main content

compio_driver/sys/
mod.rs

1mod buffer_pool;
2mod driver;
3mod extra;
4mod pal;
5mod sys_slice;
6
7// Publicly visible items
8pub mod op;
9pub use driver::*;
10pub use extra::Extra;
11pub use op::{ResultTakeBuffer, TakeBuffer};
12#[allow(unused_imports)]
13pub use pal::reexport::*;
14pub use pal::{AsFd, AsRawFd, AsSocketState, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
15#[cfg(windows)]
16#[doc(hidden)]
17pub use pal::{win32_result, winsock_result};
18
19// Crate-internal items
20#[allow(unused_imports)]
21pub(crate) use self::buffer_pool::BufControl;
22#[allow(unused_imports)]
23#[cfg(io_uring)]
24pub(crate) use self::pal::is_op_supported;
25
26/// Internal prelude module that includes all necessary utils for sys module
27#[allow(unused_imports)]
28mod prelude {
29    pub(super) use std::{
30        collections::VecDeque,
31        ffi::{CStr, CString},
32        io,
33        marker::PhantomData,
34        mem::ManuallyDrop,
35        ptr::{NonNull, null, null_mut, read_unaligned},
36        task::{Poll, Wake, Waker},
37        time::Duration,
38    };
39
40    #[cfg(any(windows, io_uring))]
41    cfg_select! {
42        feature = "once_cell_try" => {
43            pub(super) use std::sync::OnceLock;
44        }
45        _ => {
46            pub(super) use once_cell::sync::OnceCell as OnceLock;
47        }
48    }
49
50    pub(super) use compio_buf::*;
51    pub(super) use compio_log::*;
52    pub(super) use mod_use::mod_use;
53    pub(super) use socket2::{SockAddr, SockAddrStorage, Socket as Socket2, socklen_t};
54
55    pub(super) use crate::{
56        BufferPool, BufferRef, DriverType, ProactorBuilder, SharedFd, ToSharedFd,
57        control::Carrier,
58        key::ErasedKey,
59        sys::{
60            extra::Extra,
61            pal::{self, *},
62            sys_slice::{
63                IoBufExt as _, IoBufMutExt as _, IoVectoredBufExt, IoVectoredBufMutExt, SysSlice,
64                io_slice, io_slice_mut,
65            },
66        },
67        syscall,
68    };
69}