Cargo Features

[dependencies]
monoio = { version = "0.2.3", default-features = false, features = ["unstable", "async-cancel", "zero-copy", "splice", "macros", "sync", "utils", "debug", "legacy", "iouring", "tokio-compat", "poll-io", "signal", "signal-termination", "bytes", "lazy_static"] }
unstable

use nightly only feature flags

async-cancel default

async-cancel will push a async-cancel entry into sq when op is canceled

zero-copy

enanle zero copy(enable SOCK_ZEROCOPY + MSG_ZEROCOPY flag)
WARNING: this feature may cause performance degradation

splice

splice op(requires kernel 5.7+)

Affects io::splice, copy::zero_copy

macros default = monoio-macros

enable async main macros support

sync signal? = flume, once_cell, threadpool

allow waker to be sent across threads

Affects driver::Driver.unpark, monoio::blocking

utils default = nix

enable bind cpu set

debug = tracing

enable debug if you want to know what runtime does

legacy default = mio

enable legacy driver support(will make monoio available for older kernel and macOS)

Affects runtime::FusionRuntime, builder::FusionDriver

iouring default = io-uring

iouring support

Affects runtime::FusionRuntime, uring_detect::detect_uring, builder::FusionDriver

tokio-compat = tokio

tokio-compatible(only have effect when legacy is enabled and iouring is not)

poll-io = mio, tokio

(experimental)enable poll-io to convert structs to structs that impl tokio's poll io

Affects io::IntoPollIo, io::IntoCompIo, tcp::stream_poll, unix::stream_poll

signal signal-termination? = ctrlc, sync

signal enables setting ctrl_c handler

signal-termination = signal

Enables termination of ctrlc

default = async-cancel, bytes, iouring, legacy, macros, utils

by default both iouring and legacy are enabled

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

common dependencies

monoio-macros macros
bytes default
flume sync?
mio legacy poll-io?

Enables mio ^0.8

threadpool sync?
tokio poll-io? tokio-compat?
tracing debug?
ctrlc signal? signal-termination?
lazy_static implicit feature

Enables lazy_static

lazy_static:

A macro for declaring lazily evaluated statics in Rust

once_cell sync?
io-uring linux iouring
nix unix utils

Enables nix ^0.26