#![deny(unsafe_op_in_unsafe_fn)]
#![warn(missing_docs, unreachable_pub)]
pub mod addr;
pub mod blocking;
pub mod buf;
pub mod compat;
pub mod executor;
#[cfg(all(nexio_uring, not(nexio_runtime_fallback)))]
pub mod fs;
#[cfg(nexio_poll)]
#[path = "poll/fs.rs"]
pub mod fs;
#[cfg(nexio_runtime_fallback)]
#[path = "fallback/fs.rs"]
pub mod fs;
mod fs_ops;
#[cfg(feature = "http")]
pub mod http;
#[macro_use]
mod net_split;
#[cfg(all(nexio_uring, not(nexio_runtime_fallback)))]
pub mod net;
#[cfg(nexio_poll)]
#[path = "poll/net.rs"]
pub mod net;
#[cfg(nexio_runtime_fallback)]
#[path = "fallback/net.rs"]
pub mod net;
pub mod process;
pub mod profile;
#[cfg(all(nexio_uring, not(nexio_runtime_fallback)))]
pub mod reactor;
#[cfg(nexio_poll)]
#[path = "poll/reactor.rs"]
pub mod reactor;
#[cfg(nexio_runtime_fallback)]
#[path = "fallback/reactor.rs"]
pub mod reactor;
mod shard;
pub mod signal;
pub mod sync;
pub mod time;
#[cfg(feature = "tls")]
pub mod tls;
pub use blocking::spawn_blocking;
pub use executor::{block_on, join2, select2, spawn, yield_now, JoinSet};
#[cfg(feature = "macros")]
pub use nexio_macros::{main, test};
pub use profile::HardwareProfile;
pub use reactor::Reactor;
pub use shard::{run_sharded, run_sharded_auto};
pub fn io_uring_available() -> bool {
#[cfg(nexio_uring)]
{
static AVAILABLE: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*AVAILABLE.get_or_init(|| {
if std::env::var_os("NEXIO_FORCE_POLL").is_some() {
return false;
}
io_uring::IoUring::new(2).is_ok()
})
}
#[cfg(not(nexio_uring))]
{
false
}
}