add Tokio dep

Release build only went from 1.9 to 2.0 MB, but that could cause I'm not really using Tokio yet
main
_ 2021-12-08 23:55:22 +00:00
parent 2b4695934e
commit 5d6c566317
3 changed files with 69 additions and 0 deletions

60
Cargo.lock generated
View File

@ -43,6 +43,15 @@ version = "0.2.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
[[package]]
name = "log"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
"cfg-if",
]
[[package]]
name = "lookaround"
version = "0.1.4"
@ -50,6 +59,7 @@ dependencies = [
"mac_address",
"rand",
"thiserror",
"tokio",
]
[[package]]
@ -71,6 +81,28 @@ dependencies = [
"autocfg",
]
[[package]]
name = "mio"
version = "0.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc"
dependencies = [
"libc",
"log",
"miow",
"ntapi",
"winapi",
]
[[package]]
name = "miow"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
dependencies = [
"winapi",
]
[[package]]
name = "nix"
version = "0.22.2"
@ -84,6 +116,21 @@ dependencies = [
"memoffset",
]
[[package]]
name = "ntapi"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
dependencies = [
"winapi",
]
[[package]]
name = "pin-project-lite"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
[[package]]
name = "ppv-lite86"
version = "0.2.15"
@ -179,6 +226,19 @@ dependencies = [
"syn",
]
[[package]]
name = "tokio"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144"
dependencies = [
"autocfg",
"libc",
"mio",
"pin-project-lite",
"winapi",
]
[[package]]
name = "unicode-xid"
version = "0.2.2"

View File

@ -15,6 +15,7 @@ version = "0.1.4"
mac_address = "1.1.2"
rand = "0.8.4"
thiserror = "1.0.30"
tokio = { version = "1.14.0", features = ["fs", "net", "rt", "time"] }
[profile.release]
codegen-units = 1

View File

@ -76,6 +76,14 @@ impl Default for CommonParams {
}
fn main () -> Result <(), AppError> {
let rt = tokio::runtime::Builder::new_current_thread ().build ()?;
rt.block_on (async_main ())?;
Ok (())
}
async fn async_main () -> Result <(), AppError> {
let mut args = env::args ();
let _exe_name = args.next ();