diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3df847d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: rust - -os: linux - -# Doesn't seem to do much. -# Always rebuilds everything. -# cache: cargo - -before_install: - - sudo apt-get install libudev-dev - -rust: - - nightly - - stable - -matrix: - fast_finish: true - allow_failures: - - rust: nightly - -script: - - cargo build --verbose - - RUST_BACKTRACE=1 cargo test --verbose diff --git a/Cargo.lock b/Cargo.lock index 2a04290..f3f04d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,830 +1,1725 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "CoreFoundation-sys" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0e9889e6db118d49d88d84728d0e964d973a5680befb5f85f55141beea5c20b" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "mach 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "mach 0.1.2", ] [[package]] name = "IOKit-sys" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99696c398cbaf669d2368076bdb3d627fb0ce51a26899d7c61228c5c0af3bf4a" dependencies = [ - "CoreFoundation-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "mach 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "CoreFoundation-sys", + "libc", + "mach 0.1.2", ] +[[package]] +name = "addr2line" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" -version = "0.6.9" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" + +[[package]] +name = "argparse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47" + +[[package]] +name = "async-trait" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "atomic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" +dependencies = [ + "autocfg", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "boxfnonce" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5988cb1d626264ac94100be357308f29ff7cbdd3b36bda27f450a4ee3f713426" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + +[[package]] +name = "cc" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "winapi", +] + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + +[[package]] +name = "daemonize" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70c24513e34f53b640819f0ac9f705b673fcf4006d7aab8778bee72ebfc89815" +dependencies = [ + "boxfnonce", + "libc", +] + +[[package]] +name = "darling" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d6ddad5866bb2170686ed03f6839d31a76e5407d80b1c334a2c24618543ffa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9ced1fd13dc386d5a8315899de465708cf34ee2a6d9394654515214e67bb846" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote 1.0.9", + "strsim", + "syn 1.0.68", +] + +[[package]] +name = "darling_macro" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7a1445d54b2f9792e3b31a3e715feabbace393f38dc4ffd49d94ee9bc487d5" +dependencies = [ + "darling_core", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "debug_stub_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496b7f8a2f853313c3ca370641d7ff3e42c32974fdccda8f0684599ed0a3ff6b" +dependencies = [ + "quote 0.3.15", + "syn 0.11.11", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "env_logger" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "backtrace", + "version_check", +] + +[[package]] +name = "figment" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca029e813a72b7526d28273d25f3e4a2f365d1b7a1018a6f93ec9053a119763" +dependencies = [ + "atomic", + "pear", + "serde", + "serde_json", + "serde_yaml", + "toml", + "uncased", + "version_check", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" + +[[package]] +name = "futures-macro" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] + +[[package]] +name = "futures-sink" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" + +[[package]] +name = "futures-task" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" + +[[package]] +name = "futures-util" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" + +[[package]] +name = "h2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + +[[package]] +name = "heck" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tungstenite" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8caf279e78ecd352de6e0568e24cf4e70292e649fa1a9065850172d46f7c804" +dependencies = [ + "base64", + "hyper", + "pin-project", + "sha-1", + "tokio", + "tokio-tungstenite", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "inlinable_string" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" + +[[package]] +name = "input_buffer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" +dependencies = [ + "bytes", +] + +[[package]] +name = "instant" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" + +[[package]] +name = "libudev" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe" +dependencies = [ + "libc", + "libudev-sys", +] + +[[package]] +name = "libudev-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + +[[package]] +name = "lock_api" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "mach" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd13ee2dd61cc82833ba05ade5a30bb3d63f7ced605ef827063c63078302de9" +dependencies = [ + "libc", +] + +[[package]] +name = "mach" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" +dependencies = [ + "libc", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "mio" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" +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.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0eaf8df8bab402257e0a5c17a254e4cc1f72a93588a1ddfb5d356c801aa7cb" +dependencies = [ + "bitflags", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "num-traits", ] [[package]] -name = "argparse" -version = "0.2.2" +name = "num-traits" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] [[package]] -name = "autocfg" -version = "0.1.1" +name = "num_cpus" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] [[package]] -name = "backtrace" -version = "0.3.13" +name = "object" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" + +[[package]] +name = "once_cell" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parking_lot" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ - "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "instant", + "lock_api", + "parking_lot_core", ] [[package]] -name = "backtrace-sys" -version = "0.1.28" +name = "parking_lot_core" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", ] [[package]] -name = "base64" -version = "0.5.2" +name = "pear" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ab3a2b792945ed67eadbbdcbd2898f8dd2319392b2a45ac21adea5245cb113" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "inlinable_string", + "pear_codegen", + "yansi", ] [[package]] -name = "base64" -version = "0.9.3" +name = "pear_codegen" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620c9c4776ba41b59ab101360c9b1419c0c8c81cd2e6e39fae7109e7425994cb" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "proc-macro2-diagnostics", + "quote 1.0.9", + "syn 1.0.68", ] [[package]] -name = "bitflags" -version = "0.8.2" +name = "percent-encoding" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "bitflags" -version = "0.9.1" +name = "pin-project" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" +dependencies = [ + "pin-project-internal", +] [[package]] -name = "bitflags" -version = "1.0.4" +name = "pin-project-internal" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" +dependencies = [ + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] [[package]] -name = "byteorder" -version = "1.2.7" +name = "pin-project-lite" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" [[package]] -name = "bytes" -version = "0.4.11" +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "cc" -version = "1.0.28" +name = "pkg-config" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] -name = "cfg-if" -version = "0.1.6" +name = "ppv-lite86" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] -name = "daemonize" -version = "0.2.3" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error-attr", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", + "version_check", ] [[package]] -name = "debug_stub_derive" -version = "0.3.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "version_check", ] [[package]] -name = "env_logger" -version = "0.4.3" +name = "proc-macro-hack" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] -name = "error-chain" -version = "0.10.0" +name = "proc-macro-nested" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" + +[[package]] +name = "proc-macro2" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ - "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1", ] [[package]] -name = "foreign-types" -version = "0.3.2" +name = "proc-macro2-diagnostics" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", + "version_check", + "yansi", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "quote" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" +name = "quote" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "rand" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] [[package]] -name = "gcc" -version = "0.3.55" +name = "rand_chacha" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] [[package]] -name = "httparse" -version = "1.3.3" +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core", +] [[package]] -name = "hyper" -version = "0.10.15" +name = "redox_syscall" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" dependencies = [ - "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] -name = "idna" -version = "0.1.5" +name = "regex" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "iovec" -version = "0.1.2" +name = "regex-automata" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "regex-syntax", ] [[package]] -name = "itoa" -version = "0.4.3" +name = "regex-syntax" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi", ] [[package]] -name = "language-tags" -version = "0.2.2" +name = "routerify" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c18f54182904acfbd8082adb04985c59eb037027105631e3a68a5a51de31294d" +dependencies = [ + "http", + "hyper", + "lazy_static", + "percent-encoding", + "regex", +] [[package]] -name = "lazy_static" -version = "1.2.0" +name = "rustc-demangle" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] -name = "libc" -version = "0.2.46" +name = "rustversion" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" [[package]] -name = "libudev" -version = "0.2.0" +name = "ryu" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "libudev-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] -name = "libudev-sys" -version = "0.1.4" +name = "scopeguard" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "log" -version = "0.3.9" +name = "serde" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" dependencies = [ - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] -name = "log" -version = "0.4.6" +name = "serde_derive" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", ] [[package]] -name = "mach" -version = "0.0.5" +name = "serde_json" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] -name = "mach" -version = "0.1.2" +name = "serde_with" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e557c650adfb38b32a5aec07082053253c703bc3cec654b27a5dbcf61995bb9b" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "rustversion", + "serde", + "serde_with_macros", ] [[package]] -name = "matches" -version = "0.1.8" +name = "serde_with_macros" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48b35457e9d855d3dc05ef32a73e0df1e2c0fd72c38796a4ee909160c8eeec2" +dependencies = [ + "darling", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] [[package]] -name = "memchr" -version = "2.1.2" +name = "serde_yaml" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", ] [[package]] -name = "mime" -version = "0.2.6" +name = "serialport" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f37409d980045734250d679750bdf11bd875fec5bb5417dd21bb75d04d31a1" dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "CoreFoundation-sys", + "IOKit-sys", + "bitflags", + "cfg-if 0.1.10", + "libudev", + "mach 0.2.3", + "nix", + "regex", + "winapi", ] [[package]] -name = "nix" -version = "0.10.0" +name = "sha-1" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "block-buffer", + "cfg-if 1.0.0", + "cpuid-bool", + "digest", + "opaque-debug", ] [[package]] -name = "num_cpus" -version = "1.9.0" +name = "sharded-slab" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] -name = "openssl" -version = "0.9.24" +name = "signal-hook-registry" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] -name = "openssl-sys" -version = "0.9.40" +name = "slab" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] -name = "percent-encoding" -version = "1.0.1" +name = "smallvec" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] -name = "pkg-config" -version = "0.3.14" +name = "socket2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi", +] [[package]] -name = "proc-macro2" -version = "0.4.24" +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "structopt" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap", + "lazy_static", + "structopt-derive", ] [[package]] -name = "quote" -version = "0.3.15" +name = "structopt-derive" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", +] [[package]] -name = "quote" -version = "0.6.10" +name = "syn" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.3.15", + "synom", + "unicode-xid 0.0.4", ] [[package]] -name = "rand" -version = "0.3.22" +name = "syn" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "unicode-xid 0.2.1", ] [[package]] -name = "rand" -version = "0.4.5" +name = "synom" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4", ] [[package]] -name = "rand_core" -version = "0.3.0" +name = "tempfile" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "rand", + "redox_syscall", + "remove_dir_all", + "winapi", +] [[package]] -name = "rdrand" -version = "0.4.0" +name = "termcolor" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util", ] [[package]] -name = "redox_syscall" -version = "0.1.50" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] [[package]] -name = "regex" -version = "0.2.11" +name = "thiserror" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" dependencies = [ - "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror-impl", ] [[package]] -name = "regex-syntax" -version = "0.5.6" +name = "thiserror-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ - "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", ] [[package]] -name = "rustc-demangle" -version = "0.1.13" +name = "thread-control" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e002431352cce4e76fd6fe77d5bf1b75ff790ea790602f0579ce58641c2eea" [[package]] -name = "ryu" -version = "0.2.7" +name = "thread_local" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +dependencies = [ + "once_cell", +] [[package]] -name = "safemem" -version = "0.3.0" +name = "tinyvec" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +dependencies = [ + "tinyvec_macros", +] [[package]] -name = "serde" -version = "1.0.84" +name = "tinyvec_macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] -name = "serde_derive" -version = "1.0.84" +name = "tokio" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", ] [[package]] -name = "serde_json" -version = "1.0.34" +name = "tokio-macros" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" dependencies = [ - "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", ] [[package]] -name = "serialport" -version = "2.3.0" +name = "tokio-tungstenite" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e96bb520beab540ab664bd5a9cfeaa1fcd846fa68c830b42e2c8963071251d2" dependencies = [ - "CoreFoundation-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "IOKit-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "mach 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util", + "log", + "pin-project", + "tokio", + "tungstenite", ] [[package]] -name = "sha1" -version = "0.2.0" +name = "tokio-util" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] [[package]] -name = "syn" -version = "0.11.11" +name = "toml" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] -name = "syn" -version = "0.15.24" +name = "tower-service" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "synom" -version = "0.11.3" +name = "tracing-attributes" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote 1.0.9", + "syn 1.0.68", ] [[package]] -name = "tempfile" -version = "2.2.0" +name = "tracing-core" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] -name = "thread-control" -version = "0.1.2" +name = "tracing-futures" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] [[package]] -name = "thread_local" -version = "0.3.6" +name = "tracing-log" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "log", + "tracing-core", ] [[package]] -name = "time" -version = "0.1.42" +name = "tracing-serde" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" dependencies = [ - "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "tracing-core", ] [[package]] -name = "toml" -version = "0.4.10" +name = "tracing-subscriber" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" dependencies = [ - "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", ] [[package]] -name = "traitobject" -version = "0.1.0" +name = "try-lock" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "typeable" -version = "0.1.2" +name = "tungstenite" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand", + "sha-1", + "thiserror", + "url", + "utf-8", +] [[package]] -name = "ucd-util" -version = "0.1.3" +name = "typenum" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] -name = "unicase" -version = "1.4.2" +name = "uncased" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300932469d646d39929ffe84ad5c1837beecf602519ef5695e485b472de4082b" dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check", ] [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.7" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" + +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" [[package]] name = "unicode-xid" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "url" -version = "1.7.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" dependencies = [ - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "form_urlencoded", + "idna", + "matches", + "percent-encoding", ] [[package]] -name = "utf8-ranges" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "vcpkg" -version = "0.2.6" +name = "utf-8" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "version_check" -version = "0.1.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] -name = "websocket" -version = "0.19.2" +name = "want" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log", + "try-lock", ] [[package]] -name = "websocket_serial_server" -version = "0.2.0" -dependencies = [ - "argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "daemonize 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "debug_stub_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", - "serialport 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thread-control 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "websocket 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "websocket_serial_port_server" +version = "0.2.0-dev" +dependencies = [ + "anyhow", + "argparse", + "async-trait", + "base64", + "daemonize", + "debug_stub_derive", + "env_logger", + "error-chain", + "figment", + "futures-util", + "hyper", + "hyper-tungstenite", + "log", + "rand", + "routerify", + "serde", + "serde_derive", + "serde_json", + "serde_with", + "serialport", + "structopt", + "tempfile", + "thiserror", + "thread-control", + "tokio", + "tracing", + "tracing-futures", + "tracing-subscriber", +] [[package]] name = "winapi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "winapi-build" -version = "0.1.1" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "winapi-util" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[metadata] -"checksum CoreFoundation-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e9889e6db118d49d88d84728d0e964d973a5680befb5f85f55141beea5c20b" -"checksum IOKit-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "99696c398cbaf669d2368076bdb3d627fb0ce51a26899d7c61228c5c0af3bf4a" -"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e" -"checksum argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47" -"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" -"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5" -"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" -"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" -"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" -"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" -"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" -"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d" -"checksum bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa" -"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" -"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" -"checksum daemonize 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0239832c1b4ca406d5ec73728cf4c7336d25cf85dd32db9e047e9e706ee0e935" -"checksum debug_stub_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "496b7f8a2f853313c3ca370641d7ff3e42c32974fdccda8f0684599ed0a3ff6b" -"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" -"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" -"checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c" -"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" -"checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd" -"checksum libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe" -"checksum libudev-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" -"checksum mach 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "196697f416cf23cf0d3319cf5b2904811b035c82df1dfec2117fb457699bf277" -"checksum mach 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2fd13ee2dd61cc82833ba05ade5a30bb3d63f7ced605ef827063c63078302de9" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "db4c41318937f6e76648f42826b1d9ade5c09cafb5aef7e351240a70f39206e9" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" -"checksum num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5a69d464bdc213aaaff628444e99578ede64e9c854025aa43b9796530afa9238" -"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" -"checksum openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)" = "1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" -"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" -"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" -"checksum rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dee497e66d8d76bf08ce20c8d36e16f93749ab0bf89975b4f8ae5cee660c2da2" -"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" -"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" -"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" -"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" -"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" -"checksum serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "0e732ed5a5592c17d961555e3b552985baf98d50ce418b7b655f31f6ba7eb1b7" -"checksum serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d6115a3ca25c224e409185325afc16a0d5aaaabc15c42b09587d6f1ba39a5b" -"checksum serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)" = "bdf540260cfee6da923831f4776ddc495ada940c30117977c70f1313a6130545" -"checksum serialport 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "426edd50ed1192f9fb2405b713583567b85ac801fafb7476252ad7d7b1509453" -"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)" = "734ecc29cd36e8123850d9bf21dfd62ef8300aaa8f879aabaa899721808be37c" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum tempfile 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11ce2fe9db64b842314052e2421ac61a73ce41b898dc8e3750398b219c5fc1e0" -"checksum thread-control 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22e002431352cce4e76fd6fe77d5bf1b75ff790ea790602f0579ce58641c2eea" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" -"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum websocket 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)" = "004a6a4bcc225ab013b0552d723e9d672a455c461151e7ee191dc3483dcb856e" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" diff --git a/Cargo.toml b/Cargo.toml index fe19dc8..4e646df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,37 +1,48 @@ [package] edition = "2018" -name = "websocket_serial_server" -version = "0.2.0" +name = "websocket_serial_port_server" +version = "0.2.0-dev" authors = ["Daniel Joyce "] description = "A websocket server providing access to local serial ports" readme = "README.md" license-file = "LICENSE" [dependencies] -argparse = "0.2.1" -base64 = "0.5.1" -daemonize = "0.2.3" +anyhow = "1.0.40" +argparse = "0.2.2" +async-trait = "0.1.48" +base64 = "0.13.0" +daemonize = "0.4.1" debug_stub_derive = "0.3.0" -env_logger = "0.4.2" -error-chain = "0.10.0" -hyper = "0.10.9" -log = "0.3.7" -rand = "0.3.15" -serde = "1.0.2" -serde_derive = "1.0.2" -serde_json = "1.0.2" -serialport = "2.3.0" +env_logger = "0.8.3" +error-chain = "0.12.4" +figment = { version = "0.10.5", features = ["env", "json", "toml", "yaml"] } +futures-util = "0.3" +hyper = "0.14.5" +hyper-tungstenite = "0.3.1" +log = "0.4.14" +rand = "0.8.3" +routerify = "2.0.0" +serde = "1.0.125" +serde_with = "1.8.0" +serde_derive = "1.0.125" +serde_json = "1.0.64" +serialport = "4.0.0" +structopt = { version = "0.3", default-features = false } +tracing = "0.1" +tracing-futures = "0.2" +tracing-subscriber = "0.2" +thiserror = "1.0.24" thread-control = "0.1.2" -toml = "0.4.1" -websocket = "0.19.1" +tokio = { version = "1.4.0", features = ["full"] } [dev-dependencies] -tempfile = "2.1.5" +tempfile = "3.2.0" [lib] -name="lib" -path="src/lib/mod.rs" +name = "wssps" +path = "src/lib/mod.rs" [[bin]] -name = "wsss" +name = "wssps" path = "src/bin/main.rs" diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e0a7da2..70b0102 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -2,21 +2,18 @@ ## Configuration -wsss supports configuration in several different ways, by commandline parameters, env variables, and config files +wssps supports configuration in several different ways, by commandline parameters, env variables, and config files commandline options override env variables, which overrides file based config. Currently the following values may be specified -* `http_port` The HTTP port to bind to, defaults to 10080 -* `ws_port` The port the websocket listens on, defaults to 10081 -* `bind_address` The ip address the server binds to, defaults to 127.0.0.1 ( localhost ) +* `port` The HTTP /WS port to bind to, defaults to 10080 +* `address` The ip address the server binds to, defaults to 127.0.0.1 ( localhost ) -When wsss starts, it first tries to load configuration information from the following files: +When wssps starts, it first tries to load configuration information from the following files: -1. The file specified by the environment variable `WSS_CONF_FILE` -1. It then tries to load the file in `/etc/wsss/wsss_conf.toml` -1. It then tries to load a `wsss_conf.toml` file located in the same directory as the wsss executable +TODO UPDATE **Only the first file found is loaded.** @@ -25,39 +22,22 @@ The configuration file makes use of [TOML](https://github.com/toml-lang/toml). H ``` toml # Sample config. Hashes mark comments -http_port = 10090 -ws_port = 10095 -bind_address = "10.1.101.26" +port = 10090 +address = "10.1.101.26" ``` Next, it tries to pull in config from the environment. These values will override any values found in any loaded configuration files. The following env variable names are searched: -* `WSSS_HTTP_PORT` Specifies the HTTP port -* `WSSS_WS_PORT` Specifies the Websocket port -* `WSSS_BIND_ADDRESS` Specifies the ip address to bind to +* `WSSPS_PORT` Specifies the HTTP/WS port +* `WSSPS_ADDRESS` Specifies the ip address to bind to Finally it parses and uses any configuration passed in via commandline arguments -Available commandline arguments can be found via running `wsss -h` or `wsss --help` +Available commandline arguments can be found via running `wssps -h` or `wssps --help` -sample output: - -``` -Usage: - ./target/debug/wsss [OPTIONS] - -Provide access to serial ports over JSON Websockets - -optional arguments: - -h,--help show this help message and exit - -p,--http_port HTTP_PORT - Http Port - -w,--ws_port WS_PORT Websocket Port - -a,--bind_address BIND_ADDRESS - Bind Address -``` +TODO UPDATE Finally, any item not specified in any of these steps is given the default value mentioned at the beginning of this section. diff --git a/README.md b/README.md index aa16124..f1eddd6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# websocket-serial-server (wsss) +# websocket-serial-server (wssps) [![Build Status](https://travis-ci.org/DanielJoyce/websocket-serial-server.svg?branch=master)](https://travis-ci.org/DanielJoyce/websocket-serial-server) @@ -41,7 +41,7 @@ such use case, this is fine. Once Websocket-rs moves to tokio, this limitation can be removed -*There is no support for custom protocol or buffer handlers.* That should be handled by client libraries. The purpose of wsss is to simply get data from a serial port to clients and vice-versa. +*There is no support for custom protocol or buffer handlers.* That should be handled by client libraries. The purpose of wssps is to simply get data from a serial port to clients and vice-versa. ## Developing @@ -49,9 +49,7 @@ Once Websocket-rs moves to tokio, this limitation can be removed #### Linux -1. `sudo apt-get install libudev-dev` -1. `sudo apt-get install libssl-dev` -1. `sudo apt-get install pkg-config` +1. `sudo apt-get install -y libudev-dev libssl-dev pkg-config` #### Windows @@ -93,7 +91,7 @@ build: run: -`./target/debug/wsss`, or if built with `--release`, `./target/release/wsss` +`./target/debug/wssps`, or if built with `--release`, `./target/release/wssps` use `-p` or `--port` to set http port (default is 8080) @@ -101,11 +99,11 @@ then browse to `http://localhost:PORT` to find the test page. ### Logging -Wsss makes extensive use of logging and the [env_logger](https://crates.io/crates/env_logger) crate +Wssps makes extensive use of logging and the [env_logger](https://crates.io/crates/env_logger) crate Please read the env_logger docs for more information, but here is a quick example: -```RUST_LOG=debug ./target/debug/wsss``` +```RUST_LOG=debug ./target/debug/wssps``` ## TODO diff --git a/rustfmt.toml b/rustfmt.toml index a564429..41d9b1a 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,7 +1,7 @@ -tab_spaces = 2 -fn_args_layout = "Block" -array_layout = "Block" -control_style = "Rfc" -where_style = "Rfc" -generics_indent = "Block" -fn_call_style = "Block" \ No newline at end of file +edition = "2018" +merge_derives = true +reorder_imports = true +reorder_modules = true +tab_spaces = 4 +use_field_init_shorthand = true +use_try_shorthand = true diff --git a/src/bin/main.rs b/src/bin/main.rs index 385b6dd..649f0b8 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -7,7 +7,7 @@ //! //! ## Running //! -//! ```./wsss``` +//! ```./wssps``` //! //! For information on configuration please check out //! the [cfg](../lib/cfg/index.html) package in serialsupport @@ -15,266 +15,346 @@ //! You can open/close ports, read and write data, and see the //! responses. All messages are in JSON format -#[macro_use] -extern crate log; - -use std::io::Write; -use std::net::TcpStream; -use std::sync::mpsc::{channel, Sender}; -use std::thread; - -use hyper::net::Fresh; -use hyper::server::request::Request; -use hyper::server::response::Response; -use hyper::Server as HttpServer; -use rand::{thread_rng, Rng}; -use websocket::client::Writer; -use websocket::message::Type; -use websocket::result::WebSocketError; -use websocket::server::upgrade::WsUpgrade; -use websocket::{Message, Server}; - -use lib::cfg::*; -use lib::dynamic_sleep::DynamicSleep; -use lib::errors as e; -use lib::manager::Manager; -use lib::messages::*; +use futures_util::sink::SinkExt; +use futures_util::stream::StreamExt; +use hyper_tungstenite::tungstenite::Message; +use std::net::SocketAddr; + +use hyper::StatusCode; +use hyper::{Body, Request, Response, Server}; +use hyper_tungstenite::HyperWebsocket; +use routerify::{RequestInfo, Router, RouterService}; +use tracing::*; + +use wssps::configuration::WsspsConfig; +use wssps::errors::*; /// Max number of failures we allow when trying to send /// data to client before exiting /// TODO: Make configurable -pub const MAX_SEND_ERROR_COUNT: u32 = 5; - -/// Launches wsss -pub fn main() { - // Init logger - env_logger::init().expect("Initialization of logging system failed!"); - - // Grab config - let cfg = WsssConfig::load(); - - // html file for landing page - let websocket_html = include_str!("websockets.html").replace( - "__WS_PORT__ = 8081", - &format!("__WS_PORT__ = {}", cfg.ws_port), - ); - - // The HTTP server handler - let http_handler = move |_: Request, response: Response| { - let mut response = response.start().expect(&"Could not start response"); - // Send a client webpage - response - .write_all(websocket_html.as_bytes()) - .expect(&"Could not get template as bytes"); - response.end().expect(&"Send response failed"); - }; - - info!("Using ports {} {}", cfg.http_port, cfg.ws_port); - - // Set up channels and Manager - let (sub_tx, sub_rx) = channel::(); - let (sreq_tx, sreq_rx) = channel::<(String, SerialRequest)>(); - Manager::spawn(sreq_rx, sub_rx); - - // Start listening for http connections - let http_server = HttpServer::http(format!("{}:{}", cfg.bind_address, cfg.http_port)).expect( - &format!("Failed to create http server on port {}", cfg.http_port), - ); - - thread::spawn(move || { - http_server.handle(http_handler).expect(&"Failed to listen"); - }); - - // Start listening for WebSocket connections - let ws_server = Server::bind(format!("{}:{}", cfg.bind_address, cfg.ws_port)) - .expect(&format!("Failed bind on websocket port {}", cfg.ws_port)); - - // Continuously iterate over connections, - // spawning handlers - for connection in ws_server.filter_map(Result::ok) { - // Set up subscription id - // let ts = SystemTime::now() - UNIX_EPOCH - let prefix: String = thread_rng().gen_ascii_chars().take(8).collect(); - let sub_id = format!("thread-{}-{}", prefix, rand::random::()); - debug!("{}: spawned.", sub_id); - - // Spawn a new thread for each connection. - let sub_tx_clone = sub_tx.clone(); - let sreq_tx_clone = sreq_tx.clone(); - spawn_ws_handler(sub_id, sub_tx_clone, sreq_tx_clone, connection); - } -} - -/// Spawn a websocket handler into its own thread -fn spawn_ws_handler( - sub_id: String, - sub_tx_clone: Sender, - sreq_tx_clone: Sender<(String, SerialRequest)>, - connection: WsUpgrade, -) { - thread::spawn(move || ws_handler(sub_id, &sub_tx_clone, &sreq_tx_clone, connection)); -} - -/// Websocket handler -fn ws_handler( - sub_id: String, - sub_tx: &Sender, - sreq_tx: &Sender<(String, SerialRequest)>, - connection: WsUpgrade, -) { - if !connection - .protocols() - .contains(&"websocket-serial-json".to_string()) - { - connection.reject().expect(&"Connection rejection failed."); - return; - } - - connection - .tcp_stream() - .set_nonblocking(true) - .expect(&"Setting stream non-blocking failed."); - - // Create response channel - let (sub_resp_tx, sub_resp_rx) = channel::(); - - // Register sub_id with manager - sub_tx - .send(SubscriptionRequest { - sub_id: sub_id.clone(), - subscriber: sub_resp_tx, - }) - .expect(&format!("{}: Registering with manager failed.", sub_id)); - - let client = connection - .use_protocol(format!("websocket-serial-json")) - .accept() - .expect(&format!("{}: Accept protocol failed.", sub_id)); - - let ip = client - .peer_addr() - .expect(&format!("{}: Could not get peer address", sub_id)); - - info!("{}: Connection from {}", sub_id, ip); - - let (mut receiver, mut sender) = client - .split() - .expect(&format!("{}: WS client error", sub_id)); - - let mut send_error_count = 0; - - let mut dynamic_sleep = DynamicSleep::new("main"); - - 'msg_loop: loop { - dynamic_sleep.sleep(); - - // Try and read a WS message - match receiver.recv_message::() { - Ok(message) => { - match message.opcode { - Type::Close => { - let message = Message::close(); - sender - .send_message(&message) - .unwrap_or(info!("{}: Client {} hung up!", sub_id, ip)); - // Send close request to cleanup resources - sreq_tx - .send((sub_id.clone(), SerialRequest::Close { port: None })) - .unwrap_or_else(|e| { - warn!( - "Client exit cleanup failed for sub_id '{}', cause '{}'", - sub_id, e - ) - }); - info!("{}: Client {} disconnected", sub_id, ip); - break 'msg_loop; - } - - Type::Ping => { - let message = Message::pong(message.payload); - sender - .send_message(&message) - .unwrap_or(info!("{}: Could not ping client {}!", sub_id, ip)); - } - - _ => { - // Get the payload, in a lossy manner - let msg = String::from_utf8_lossy(&message.payload); - - // So we will get a result back - match serde_json::from_str(&msg) { - Ok(req) => { - match sreq_tx.send((sub_id.clone(), req)) { - Err(err) => { - let error = e::ErrorKind::SendRequest(err).into(); - send_serial_response_error(&sub_id, &mut sender, error); - } - _ => {} - }; - } - Err(err) => { - let error = e::ErrorKind::Json(err).into(); - send_serial_response_error(&sub_id, &mut sender, error); - } - }; - } - }; - } - Err(e) => { - match e { - WebSocketError::NoDataAvailable => { /*Logging?*/ } - _ => { /*Logging?*/ } - }; - } +const MAX_SEND_ERROR_COUNT: u32 = 5; + +const INDEX_PAGE_HTML: &'static str = include_str!("websockets.html"); + +/// Handle a HTTP or WebSocket request. +#[instrument] +async fn index_page_handler(request: Request) -> Result> { + // Check if the request is a websocket upgrade request. + if hyper_tungstenite::is_upgrade_request(&request) { + let (response, websocket) = hyper_tungstenite::upgrade(request, None)?; + + // Spawn a task to handle the websocket connection. + tokio::spawn(async move { + if let Err(e) = serve_websocket(websocket).await { + eprintln!("Error in websocket connection: {}", e); + } + }); + + // Return the response so the spawned future can continue. + Ok(response) + } else { + let response = Response::builder() + .header("Content-Type", "text/html; charset=UTF-8") + .body(INDEX_PAGE_HTML.into()) + .expect("Wow, this should not fail"); + Ok(response) } +} - // Send on any serial responses - match sub_resp_rx.try_recv() { - Ok(resp) => match serde_json::to_string(&resp) { - Ok(json) => { - let reply = Message::text(json.clone()); - sender.send_message(&reply).unwrap_or_else(|e| { - send_error_count += 1; - info!( - "{}: Could not send message '{}' to client '{}', cause '{}'", - sub_id, json, ip, e - ) - }); +/// Handle a websocket connection. +// #[instrument] +async fn serve_websocket(websocket: HyperWebsocket) -> Result<()> { + let mut websocket = websocket.await?; + while let Some(message) = websocket.next().await { + let message = message?; + + if let Some(reply) = match message { + Message::Ping(payload) => Some(Message::Pong(payload)), + Message::Pong(_) => { + // Didn't send a ping, somehow got a pong. + info!("Got pong, didn't send ping. Weird!"); + None + } + message @ Message::Text(_) => Some(message), + message @ Message::Binary(_) => Some(message), + Message::Close(_) => { + info!("Remote end closed connection!"); + break; + } + } { + // echo it back for now + websocket.send(reply).await?; } - Err(_) => {} - }, - _ => { /*Logging*/ } - }; - - if send_error_count > MAX_SEND_ERROR_COUNT { - warn!( - "{}: Client send error count exceeded! Shutting down msg loop.", - &sub_id - ); - break 'msg_loop; } - } - info!("{}: Shutting down!", sub_id); + Ok(()) +} + +#[instrument] +async fn error_handler(err: routerify::RouteError, _: RequestInfo) -> Response { + Response::builder() + .status(StatusCode::INTERNAL_SERVER_ERROR) + .body(Body::from(format!( + "Server encountered an error: {:?}", + err + ))) + .unwrap() } -/// Send an error to the given subscriber -/// Log a warning if the message can't be sent -/// This is usually ok as it means the client -/// has simply disconnected -fn send_serial_response_error(sub_id: &String, sender: &mut Writer, error: e::Error) { - let error = e::to_serial_response_error(error); - serde_json::to_string(&error) - .map_err(|err| e::ErrorKind::Json(err)) - .map(|json| Message::text(json)) - .map(|msg| { - sender - .send_message::(&msg) - .map_err::(|err| e::ErrorKind::SendWsMessage(err).into()) - }) - .unwrap_or_else(|_| { - warn!("{}: Problem sending bad json error response", sub_id); - Ok(()) - }) - .is_ok(); // This shouldn't be needed? +// Create a `Router` for response body type `hyper::Body` +// and for handler error type `Infallible`. +fn router() -> Router { + // Create a router and specify the logger middleware and the handlers. + // Here, "Middleware::pre" means we're adding a pre middleware which will be executed + // before any route handlers. + Router::builder() + .get("/", index_page_handler) + .err_handler_with_info(error_handler) + .build() + .unwrap() +} + +/// Launches wssps +#[tokio::main] +#[instrument] +async fn main() { + // init tracing/logging + tracing_subscriber::fmt::init(); + + // Grab config + let cfg = WsspsConfig::get(); + + let router = router(); + + // Create a Service from the router above to handle incoming requests. + let service = RouterService::new(router).unwrap(); + + // The address on which the server will be listening. + let addr = SocketAddr::new(cfg.address, cfg.port); + + // Create a server by passing the created service to `.serve` method. + let server = Server::bind(&addr).serve(service); + + println!("WSSPS is running on: {}", addr); + if let Err(err) = server.await { + eprintln!("Server error: {}", err); + } + // // The HTTP server handler + // let http_handler = move |_: Request, response: Response| { + // let mut response = response.start().expect(&"Could not start response"); + // // Send a client webpage + // response + // .write_all(websocket_html.as_bytes()) + // .expect(&"Could not get template as bytes"); + // response.end().expect(&"Send response failed"); + // }; + + // info!("Using ports {} {}", cfg.http_port, cfg.ws_port); + + // // Set up channels and Manager + // let (sub_tx, sub_rx) = channel::(); + // let (sreq_tx, sreq_rx) = channel::<(String, SerialRequest)>(); + // Manager::spawn(sreq_rx, sub_rx); + + // // Start listening for http connections + // let http_server = HttpServer::http(format!("{}:{}", cfg.bind_address, cfg.http_port)).expect( + // &format!("Failed to create http server on port {}", cfg.http_port), + // ); + + // thread::spawn(move || { + // http_server.handle(http_handler).expect(&"Failed to listen"); + // }); + + // // Start listening for WebSocket connections + // let ws_server = Server::bind(format!("{}:{}", cfg.bind_address, cfg.ws_port)) + // .expect(&format!("Failed bind on websocket port {}", cfg.ws_port)); + + // // Continuously iterate over connections, + // // spawning handlers + // for connection in ws_server.filter_map(Result::ok) { + // // Set up subscription id + // // let ts = SystemTime::now() - UNIX_EPOCH + // let prefix: String = thread_rng().gen_ascii_chars().take(8).collect(); + // let sub_id = format!("thread-{}-{}", prefix, rand::random::()); + // debug!("{}: spawned.", sub_id); + + // // Spawn a new thread for each connection. + // let sub_tx_clone = sub_tx.clone(); + // let sreq_tx_clone = sreq_tx.clone(); + // spawn_ws_handler(sub_id, sub_tx_clone, sreq_tx_clone, connection); + // } + // } + + // /// Spawn a websocket handler into its own thread + // fn spawn_ws_handler( + // sub_id: String, + // sub_tx_clone: Sender, + // sreq_tx_clone: Sender<(String, SerialRequest)>, + // connection: WsUpgrade, + // ) { + // thread::spawn(move || ws_handler(sub_id, &sub_tx_clone, &sreq_tx_clone, connection)); + // } + + // /// Websocket handler + // fn ws_handler( + // sub_id: String, + // sub_tx: &Sender, + // sreq_tx: &Sender<(String, SerialRequest)>, + // connection: WsUpgrade, + // ) { + // if !connection + // .protocols() + // .contains(&"websocket-serial-json".to_string()) + // { + // connection.reject().expect(&"Connection rejection failed."); + // return; + // } + + // connection + // .tcp_stream() + // .set_nonblocking(true) + // .expect(&"Setting stream non-blocking failed."); + + // // Create response channel + // let (sub_resp_tx, sub_resp_rx) = channel::(); + + // // Register sub_id with manager + // sub_tx + // .send(SubscriptionRequest { + // sub_id: sub_id.clone(), + // subscriber: sub_resp_tx, + // }) + // .expect(&format!("{}: Registering with manager failed.", sub_id)); + + // let client = connection + // .use_protocol(format!("websocket-serial-json")) + // .accept() + // .expect(&format!("{}: Accept protocol failed.", sub_id)); + + // let ip = client + // .peer_addr() + // .expect(&format!("{}: Could not get peer address", sub_id)); + + // info!("{}: Connection from {}", sub_id, ip); + + // let (mut receiver, mut sender) = client + // .split() + // .expect(&format!("{}: WS client error", sub_id)); + + // let mut send_error_count = 0; + + // let mut dynamic_sleep = DynamicSleep::new("main"); + + // 'msg_loop: loop { + // dynamic_sleep.sleep(); + + // // Try and read a WS message + // match receiver.recv_message::() { + // Ok(message) => { + // match message.opcode { + // Type::Close => { + // let message = Message::close(); + // sender + // .send_message(&message) + // .unwrap_or(info!("{}: Client {} hung up!", sub_id, ip)); + // // Send close request to cleanup resources + // sreq_tx + // .send((sub_id.clone(), SerialRequest::Close { port: None })) + // .unwrap_or_else(|e| { + // warn!( + // "Client exit cleanup failed for sub_id '{}', cause '{}'", + // sub_id, e + // ) + // }); + // info!("{}: Client {} disconnected", sub_id, ip); + // break 'msg_loop; + // } + + // Type::Ping => { + // let message = Message::pong(message.payload); + // sender + // .send_message(&message) + // .unwrap_or(info!("{}: Could not ping client {}!", sub_id, ip)); + // } + + // _ => { + // // Get the payload, in a lossy manner + // let msg = String::from_utf8_lossy(&message.payload); + + // // So we will get a result back + // match serde_json::from_str(&msg) { + // Ok(req) => { + // match sreq_tx.send((sub_id.clone(), req)) { + // Err(err) => { + // let error = e::ErrorKind::SendRequest(err).into(); + // send_serial_response_error(&sub_id, &mut sender, error); + // } + // _ => {} + // }; + // } + // Err(err) => { + // let error = e::ErrorKind::Json(err).into(); + // send_serial_response_error(&sub_id, &mut sender, error); + // } + // }; + // } + // }; + // } + // Err(e) => { + // match e { + // WebSocketError::NoDataAvailable => { /*Logging?*/ } + // _ => { /*Logging?*/ } + // }; + // } + // } + + // // Send on any serial responses + // match sub_resp_rx.try_recv() { + // Ok(resp) => match serde_json::to_string(&resp) { + // Ok(json) => { + // let reply = Message::text(json.clone()); + // sender.send_message(&reply).unwrap_or_else(|e| { + // send_error_count += 1; + // info!( + // "{}: Could not send message '{}' to client '{}', cause '{}'", + // sub_id, json, ip, e + // ) + // }); + // } + // Err(_) => {} + // }, + // _ => { /*Logging*/ } + // }; + + // if send_error_count > MAX_SEND_ERROR_COUNT { + // warn!( + // "{}: Client send error count exceeded! Shutting down msg loop.", + // &sub_id + // ); + // break 'msg_loop; + // } + // } + + // info!("{}: Shutting down!", sub_id); + // } + + // /// Send an error to the given subscriber + // /// Log a warning if the message can't be sent + // /// This is usually ok as it means the client + // /// has simply disconnected + // fn send_serial_response_error(sub_id: &String, sender: &mut Writer, error: e::Error) { + // let error = e::to_serial_response_error(error); + // serde_json::to_string(&error) + // .map_err(|err| e::ErrorKind::Json(err)) + // .map(|json| Message::text(json)) + // .map(|msg| { + // sender + // .send_message::(&msg) + // .map_err::(|err| e::ErrorKind::SendWsMessage(err).into()) + // }) + // .unwrap_or_else(|_| { + // warn!("{}: Problem sending bad json error response", sub_id); + // Ok(()) + // }) + // .is_ok(); // This shouldn't be needed? } diff --git a/src/bin/websockets.html b/src/bin/websockets.html index ddb9d9d..7f685bc 100644 --- a/src/bin/websockets.html +++ b/src/bin/websockets.html @@ -97,8 +97,7 @@