mirror of https://github.com/fafhrd91/actix-net
Merge 26289b8427
into 8204690568
This commit is contained in:
commit
4b5399d377
|
@ -15,15 +15,16 @@ rust-version.workspace = true
|
||||||
allowed_external_types = ["actix_macros::*", "tokio::*"]
|
allowed_external_types = ["actix_macros::*", "tokio::*"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["macros"]
|
default = ["macros", "net"]
|
||||||
macros = ["actix-macros"]
|
macros = ["actix-macros"]
|
||||||
io-uring = ["tokio-uring"]
|
io-uring = ["tokio-uring"]
|
||||||
|
net = ["tokio/net", "tokio/signal"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-macros = { version = "0.2.3", optional = true }
|
actix-macros = { version = "0.2.3", optional = true }
|
||||||
|
|
||||||
futures-core = { version = "0.3", default-features = false }
|
futures-core = { version = "0.3", default-features = false }
|
||||||
tokio = { version = "1.23.1", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] }
|
tokio = { version = "1.23.1", features = ["rt", "parking_lot", "sync", "time"] }
|
||||||
|
|
||||||
# runtime for `io-uring` feature
|
# runtime for `io-uring` feature
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#![allow(clippy::type_complexity)]
|
#![allow(clippy::type_complexity)]
|
||||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
|
||||||
#[cfg(all(not(target_os = "linux"), feature = "io-uring"))]
|
#[cfg(all(not(target_os = "linux"), feature = "io-uring"))]
|
||||||
compile_error!("io_uring is a linux only feature.");
|
compile_error!("io_uring is a linux only feature.");
|
||||||
|
@ -70,6 +71,7 @@ pub use self::{
|
||||||
system::{System, SystemRunner},
|
system::{System, SystemRunner},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "net")]
|
||||||
pub mod signal {
|
pub mod signal {
|
||||||
//! Asynchronous signal handling (Tokio re-exports).
|
//! Asynchronous signal handling (Tokio re-exports).
|
||||||
|
|
||||||
|
@ -81,6 +83,7 @@ pub mod signal {
|
||||||
pub use tokio::signal::ctrl_c;
|
pub use tokio::signal::ctrl_c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "net")]
|
||||||
pub mod net {
|
pub mod net {
|
||||||
//! TCP/UDP/Unix bindings (mostly Tokio re-exports).
|
//! TCP/UDP/Unix bindings (mostly Tokio re-exports).
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,7 @@ pub struct Runtime {
|
||||||
|
|
||||||
pub(crate) fn default_tokio_runtime() -> io::Result<tokio::runtime::Runtime> {
|
pub(crate) fn default_tokio_runtime() -> io::Result<tokio::runtime::Runtime> {
|
||||||
tokio::runtime::Builder::new_current_thread()
|
tokio::runtime::Builder::new_current_thread()
|
||||||
.enable_io()
|
.enable_all()
|
||||||
.enable_time()
|
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue