From ad996643c9263412166388d9f8aab64ec6144cef Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Fri, 29 Oct 2021 20:10:06 -0700 Subject: [PATCH] Use notmuch crate in server and web. --- Cargo.lock | 889 +++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 6 + server/Cargo.toml | 11 +- server/src/main.rs | 35 +- web/Cargo.toml | 9 +- web/src/lib.rs | 164 ++++++--- 6 files changed, 894 insertions(+), 220 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4ac668..05d0e8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,7 +17,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] @@ -36,9 +36,9 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -47,9 +47,9 @@ version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -69,7 +69,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -84,6 +84,22 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +dependencies = [ + "byteorder", + "safemem", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "binascii" version = "0.1.4" @@ -102,6 +118,12 @@ version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + [[package]] name = "bytes" version = "1.1.0" @@ -135,16 +157,16 @@ dependencies = [ "libc", "num-integer", "num-traits", - "winapi", + "winapi 0.3.9", ] [[package]] name = "console_error_panic_hook" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "wasm-bindgen", ] @@ -153,7 +175,7 @@ name = "console_log" version = "0.1.0" source = "git+http://git.z.xinu.tv/wathiede/console_log#1c235d5a7bae685dfff05bc9162abb049beefb7d" dependencies = [ - "log", + "log 0.4.14", "wasm-bindgen", "web-sys", ] @@ -164,14 +186,24 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28" +[[package]] +name = "cookie" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80f6044740a4a516b8aac14c140cdf35c1a640b1bd6b98b6224e49143b2f1566" +dependencies = [ + "percent-encoding 2.1.0", + "time 0.1.43", +] + [[package]] name = "cookie" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" dependencies = [ - "percent-encoding", - "time", + "percent-encoding 2.1.0", + "time 0.2.26", "version_check 0.9.3", ] @@ -181,11 +213,21 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d" dependencies = [ - "percent-encoding", - "time", + "percent-encoding 2.1.0", + "time 0.2.26", "version_check 0.9.3", ] +[[package]] +name = "ctor" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +dependencies = [ + "quote 1.0.9", + "syn 1.0.80", +] + [[package]] name = "dbg" version = "1.0.4" @@ -195,14 +237,34 @@ dependencies = [ "version_check 0.1.5", ] +[[package]] +name = "devise" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e04ba2d03c5fa0d954c061fc8c9c288badadffc272ebb87679a89846de3ed3" +dependencies = [ + "devise_codegen 0.2.0", + "devise_core 0.2.0", +] + [[package]] name = "devise" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" dependencies = [ - "devise_codegen", - "devise_core", + "devise_codegen 0.3.1", + "devise_core 0.3.1", +] + +[[package]] +name = "devise_codegen" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "066ceb7928ca93a9bedc6d0e612a8a0424048b0ab1f75971b203d01420c055d7" +dependencies = [ + "devise_core 0.2.0", + "quote 0.6.13", ] [[package]] @@ -211,8 +273,20 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" dependencies = [ - "devise_core", - "quote", + "devise_core 0.3.1", + "quote 1.0.9", +] + +[[package]] +name = "devise_core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf41c59b22b5e3ec0ea55c7847e5f358d340f3a8d6d53a5cf4f1564967f96487" +dependencies = [ + "bitflags", + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -222,12 +296,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" dependencies = [ "bitflags", - "proc-macro2", + "proc-macro2 1.0.30", "proc-macro2-diagnostics", - "quote", - "syn", + "quote 1.0.9", + "syn 1.0.80", ] +[[package]] +name = "diff" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" + [[package]] name = "discard" version = "1.0.4" @@ -262,13 +342,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df" dependencies = [ "atomic", - "pear", + "pear 0.2.3", "serde", - "toml", + "toml 0.5.8", "uncased", "version_check 0.9.3", ] +[[package]] +name = "filetime" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "winapi 0.3.9", +] + [[package]] name = "fnv" version = "1.0.7" @@ -282,9 +374,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", - "percent-encoding", + "percent-encoding 2.1.0", ] +[[package]] +name = "fsevent" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +dependencies = [ + "bitflags", + "fsevent-sys", +] + +[[package]] +name = "fsevent-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +dependencies = [ + "libc", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + [[package]] name = "futures" version = "0.3.13" @@ -340,9 +467,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" dependencies = [ "proc-macro-hack", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -385,9 +512,9 @@ checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" dependencies = [ "cc", "libc", - "log", + "log 0.4.14", "rustversion", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -535,6 +662,25 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +[[package]] +name = "hyper" +version = "0.10.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" +dependencies = [ + "base64 0.9.3", + "httparse", + "language-tags", + "log 0.3.9", + "mime 0.2.6", + "num_cpus", + "time 0.1.43", + "traitobject", + "typeable", + "unicase 1.4.2", + "url 1.7.2", +] + [[package]] name = "hyper" version = "0.14.14" @@ -559,6 +705,17 @@ dependencies = [ "want", ] +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.2.3" @@ -587,6 +744,26 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" +[[package]] +name = "inotify" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "instant" version = "0.1.12" @@ -596,6 +773,15 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + [[package]] name = "itoa" version = "0.4.7" @@ -604,26 +790,49 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.50" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "letterbox" version = "0.1.0" dependencies = [ "console_error_panic_hook", "console_log", - "log", + "log 0.4.14", + "notmuch", "seed", "serde", "wasm-bindgen-test", @@ -644,6 +853,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +dependencies = [ + "log 0.4.14", +] + [[package]] name = "log" version = "0.4.14" @@ -689,12 +907,40 @@ version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +dependencies = [ + "log 0.3.9", +] + [[package]] name = "mime" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log 0.4.14", + "miow 0.2.2", + "net2", + "slab", + "winapi 0.2.8", +] + [[package]] name = "mio" version = "0.7.14" @@ -702,10 +948,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", - "log", - "miow", + "log 0.4.14", + "miow 0.3.7", "ntapi", - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log 0.4.14", + "mio 0.6.23", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", ] [[package]] @@ -714,7 +984,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] @@ -728,8 +998,8 @@ dependencies = [ "futures-util", "http", "httparse", - "log", - "mime", + "log 0.4.14", + "mime 0.3.16", "spin", "tokio", "tokio-util", @@ -737,13 +1007,53 @@ dependencies = [ "version_check 0.9.3", ] +[[package]] +name = "net2" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "notify" +version = "4.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +dependencies = [ + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio 0.6.23", + "mio-extras", + "walkdir", + "winapi 0.3.9", +] + +[[package]] +name = "notmuch" +version = "0.1.0" +dependencies = [ + "log 0.4.14", + "pretty_assertions", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "ntapi" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] @@ -781,6 +1091,15 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +[[package]] +name = "output_vt100" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -803,7 +1122,16 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "pear" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a" +dependencies = [ + "pear_codegen 0.1.4", ] [[package]] @@ -813,7 +1141,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" dependencies = [ "inlinable_string", - "pear_codegen", + "pear_codegen 0.2.3", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", + "version_check 0.9.3", "yansi", ] @@ -823,12 +1164,18 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.30", "proc-macro2-diagnostics", - "quote", - "syn", + "quote 1.0.9", + "syn 1.0.80", ] +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -853,6 +1200,18 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +[[package]] +name = "pretty_assertions" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0cfe1b2403f172ba0f234e500906ee0a3e493fb81092dac23ebefe129301cc" +dependencies = [ + "ansi_term", + "ctor", + "diff", + "output_vt100", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -865,13 +1224,22 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ - "unicode-xid", + "unicode-xid 0.2.1", ] [[package]] @@ -880,9 +1248,9 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", "version_check 0.9.3", "yansi", ] @@ -896,7 +1264,16 @@ dependencies = [ "bitflags", "getopts", "memchr", - "unicase", + "unicase 2.6.0", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", ] [[package]] @@ -905,7 +1282,7 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.30", ] [[package]] @@ -1023,9 +1400,9 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -1060,7 +1437,28 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "rocket" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a7ab1dfdc75bb8bd2be381f37796b1b300c45a3c9145b34d86715e8dd90bf28" +dependencies = [ + "atty", + "base64 0.13.0", + "log 0.4.14", + "memchr", + "num_cpus", + "pear 0.1.4", + "rocket_codegen 0.4.10", + "rocket_http 0.4.10", + "state 0.4.2", + "time 0.1.43", + "toml 0.4.10", + "version_check 0.9.3", + "yansi", ] [[package]] @@ -1079,7 +1477,7 @@ dependencies = [ "figment", "futures", "indexmap", - "log", + "log 0.4.14", "memchr", "multer", "num_cpus", @@ -1087,12 +1485,13 @@ dependencies = [ "pin-project-lite", "rand 0.8.4", "ref-cast", - "rocket_codegen", - "rocket_http", + "rocket_codegen 0.5.0-rc.1", + "rocket_http 0.5.0-rc.1", "serde", - "state", + "serde_json", + "state 0.5.2", "tempfile", - "time", + "time 0.2.26", "tokio", "tokio-stream", "tokio-util", @@ -1101,20 +1500,48 @@ dependencies = [ "yansi", ] +[[package]] +name = "rocket_codegen" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729e687d6d2cf434d174da84fb948f7fef4fac22d20ce94ca61c28b72dbcf9f" +dependencies = [ + "devise 0.2.0", + "glob", + "indexmap", + "quote 0.6.13", + "rocket_http 0.4.10", + "version_check 0.9.3", + "yansi", +] + [[package]] name = "rocket_codegen" version = "0.5.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb" dependencies = [ - "devise", + "devise 0.3.1", "glob", "indexmap", - "proc-macro2", - "quote", - "rocket_http", - "syn", - "unicode-xid", + "proc-macro2 1.0.30", + "quote 1.0.9", + "rocket_http 0.5.0-rc.1", + "syn 1.0.80", + "unicode-xid 0.2.1", +] + +[[package]] +name = "rocket_contrib" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b6303dccab46dce6c7ac26c9b9d8d8cde1b19614b027c3f913be6611bff6d9b" +dependencies = [ + "log 0.4.14", + "notify", + "rocket 0.4.10", + "serde", + "serde_json", ] [[package]] @@ -1122,14 +1549,31 @@ name = "rocket_cors" version = "0.5.2" source = "git+https://github.com/lawliet89/rocket_cors?branch=master#a062933c1b109949c618b0dba296ac33e4b1a105" dependencies = [ - "log", + "log 0.4.14", "regex", - "rocket", + "rocket 0.5.0-rc.1", "serde", "serde_derive", - "unicase", + "unicase 2.6.0", "unicase_serde", - "url", + "url 2.2.2", +] + +[[package]] +name = "rocket_http" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6131e6e6d38a9817f4a494ff5da95971451c2eb56a53915579fc9c80f6ef0117" +dependencies = [ + "cookie 0.11.4", + "hyper 0.10.16", + "indexmap", + "pear 0.1.4", + "percent-encoding 1.0.1", + "smallvec", + "state 0.4.2", + "time 0.1.43", + "unicode-xid 0.1.0", ] [[package]] @@ -1141,21 +1585,21 @@ dependencies = [ "cookie 0.15.1", "either", "http", - "hyper", + "hyper 0.14.14", "indexmap", - "log", + "log 0.4.14", "memchr", - "mime", + "mime 0.3.16", "parking_lot", - "pear", - "percent-encoding", + "pear 0.2.3", + "percent-encoding 2.1.0", "pin-project-lite", "ref-cast", "serde", "smallvec", "stable-pattern", - "state", - "time", + "state 0.5.2", + "time 0.2.26", "tokio", "uncased", ] @@ -1181,6 +1625,21 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scoped-tls" version = "1.0.0" @@ -1249,16 +1708,16 @@ version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1269,8 +1728,14 @@ dependencies = [ name = "server" version = "0.1.0" dependencies = [ - "rocket", + "log 0.4.14", + "notmuch", + "rocket 0.5.0-rc.1", + "rocket_contrib", "rocket_cors", + "serde", + "serde_json", + "thiserror", ] [[package]] @@ -1316,7 +1781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1343,6 +1808,12 @@ dependencies = [ "version_check 0.9.3", ] +[[package]] +name = "state" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483" + [[package]] name = "state" version = "0.5.2" @@ -1372,11 +1843,11 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.30", + "quote 1.0.9", "serde", "serde_derive", - "syn", + "syn 1.0.80", ] [[package]] @@ -1386,13 +1857,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", - "proc-macro2", - "quote", + "proc-macro2 1.0.30", + "quote 1.0.9", "serde", "serde_derive", "serde_json", "sha1", - "syn", + "syn 1.0.80", ] [[package]] @@ -1401,15 +1872,26 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + [[package]] name = "syn" version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "proc-macro2 1.0.30", + "quote 1.0.9", + "unicode-xid 0.2.1", ] [[package]] @@ -1423,7 +1905,27 @@ dependencies = [ "rand 0.8.4", "redox_syscall", "remove_dir_all", - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -1435,6 +1937,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "time" version = "0.2.26" @@ -1447,7 +1959,7 @@ dependencies = [ "stdweb", "time-macros", "version_check 0.9.3", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1467,10 +1979,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" dependencies = [ "proc-macro-hack", - "proc-macro2", - "quote", + "proc-macro2 1.0.30", + "quote 1.0.9", "standback", - "syn", + "syn 1.0.80", ] [[package]] @@ -1498,13 +2010,13 @@ dependencies = [ "bytes", "libc", "memchr", - "mio", + "mio 0.7.14", "num_cpus", "once_cell", "pin-project-lite", "signal-hook-registry", "tokio-macros", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1513,9 +2025,9 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2dd85aeaba7b68df939bd357c6afb36c87951be9e80bf9c859f2fc3e9fca0fd" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -1538,11 +2050,20 @@ dependencies = [ "bytes", "futures-core", "futures-sink", - "log", + "log 0.4.14", "pin-project-lite", "tokio", ] +[[package]] +name = "toml" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.5.8" @@ -1576,9 +2097,9 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", ] [[package]] @@ -1597,7 +2118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ "lazy_static", - "log", + "log 0.4.14", "tracing-core", ] @@ -1633,6 +2154,12 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" + [[package]] name = "try-lock" version = "0.2.3" @@ -1649,6 +2176,12 @@ dependencies = [ "unchecked-index", ] +[[package]] +name = "typeable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" + [[package]] name = "ubyte" version = "0.10.1" @@ -1674,6 +2207,15 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +dependencies = [ + "version_check 0.1.5", +] + [[package]] name = "unicase" version = "2.6.0" @@ -1690,7 +2232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ef53697679d874d69f3160af80bc28de12730a985d57bdf2b47456ccb8b11f1" dependencies = [ "serde", - "unicase", + "unicase 2.6.0", ] [[package]] @@ -1710,9 +2252,15 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" @@ -1720,6 +2268,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + [[package]] name = "url" version = "2.2.2" @@ -1727,9 +2286,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", - "idna", + "idna 0.2.3", "matches", - "percent-encoding", + "percent-encoding 2.1.0", ] [[package]] @@ -1753,13 +2312,24 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + [[package]] name = "want" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log", + "log 0.4.14", "try-lock", ] @@ -1777,9 +2347,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.73" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if 1.0.0", "serde", @@ -1789,24 +2359,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.73" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", + "log 0.4.14", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.23" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1816,38 +2386,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.73" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ - "quote", + "quote 1.0.9", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.73" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.30", + "quote 1.0.9", + "syn 1.0.80", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.73" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wasm-bindgen-test" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e972e914de63aa53bd84865e54f5c761bd274d48e5be3a6329a662c0386aa67a" +checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1859,24 +2429,30 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6153a8f9bf24588e9f25c87223414fff124049f68d3a442a0f0eab4768a8b6" +checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.30", + "quote 1.0.9", ] [[package]] name = "web-sys" -version = "0.3.50" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -1887,18 +2463,43 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] 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-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "yansi" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index e4cdec7..3e80e42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,4 +2,10 @@ members = [ "web", "server", + "notmuch", ] + +[profile.release] +lto = true +opt-level = 'z' +codegen-units = 1 diff --git a/server/Cargo.toml b/server/Cargo.toml index 31efbbc..4a772f9 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -6,6 +6,15 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rocket = "0.5.0-rc.1" +rocket = { version = "0.5.0-rc.1", features = [ "json" ] } rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" } +notmuch = { path = "../notmuch" } +serde_json = "1.0.64" +thiserror = "1.0.26" +serde = { version = "1.0", features = ["derive"] } +log = "0.4.14" +[dependencies.rocket_contrib] +version = "0.4.10" +default-features = false +features = ["json"] diff --git a/server/src/main.rs b/server/src/main.rs index 9a10ead..89c728a 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,12 +1,12 @@ #[macro_use] extern crate rocket; -use std::error::Error; -use std::process::{Command, Output}; -use std::str::FromStr; +use std::{error::Error, process::Command, str::FromStr}; -use rocket::{http::Method, Route}; -use rocket_cors::{AllowedHeaders, AllowedOrigins, Guard, Responder}; +use rocket::{response::Debug, serde::json::Json, State}; +use rocket_cors::{AllowedHeaders, AllowedOrigins}; + +use notmuch::{Notmuch, NotmuchError, SearchSummary, ThreadSet}; #[get("/")] fn hello() -> &'static str { @@ -14,29 +14,23 @@ fn hello() -> &'static str { } #[get("/search/")] -async fn search(query: &str) -> std::io::Result> { - //format!("Search for '{}'", query) - let mut cmd = Command::new("notmuch"); - let cmd = cmd.args(["search", "--format=json", "--limit=20", query]); - dbg!(&cmd); - let out = cmd.output()?; - Ok(out.stdout) +async fn search( + nm: &State, + query: &str, +) -> Result, Debug> { + let res = nm.search(query)?; + Ok(Json(res)) } #[get("/show/")] -async fn show(query: &str) -> std::io::Result> { - //format!("Search for '{}'", query) - let mut cmd = Command::new("notmuch"); - let cmd = cmd.args(["show", "--format=json", "--body=true", query]); - dbg!(&cmd); - let out = cmd.output()?; - Ok(out.stdout) +async fn show(nm: &State, query: &str) -> Result, Debug> { + let res = nm.show(query)?; + Ok(Json(res)) } #[rocket::main] async fn main() -> Result<(), Box> { let allowed_origins = AllowedOrigins::all(); - // You can also deserialize this let cors = rocket_cors::CorsOptions { allowed_origins, allowed_methods: vec!["Get"] @@ -52,6 +46,7 @@ async fn main() -> Result<(), Box> { rocket::build() .mount("/", routes![hello, search, show]) .attach(cors) + .manage(Notmuch::with_config("../notmuch/testdata/notmuch.config")) .launch() .await?; diff --git a/web/Cargo.toml b/web/Cargo.toml index 8107b5a..e681c2e 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -20,13 +20,8 @@ console_error_panic_hook = "0.1.6" log = "0.4.14" seed = "0.8.0" console_log = {git = "http://git.z.xinu.tv/wathiede/console_log"} -serde = "1.0.126" - - -[profile.release] -lto = true -opt-level = 'z' -codegen-units = 1 +serde = { version = "1.0", features = ["derive"] } +notmuch = {path = "../notmuch"} [package.metadata.wasm-pack.profile.release] wasm-opt = ['-Os'] diff --git a/web/src/lib.rs b/web/src/lib.rs index e99e3b7..90df90b 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -6,7 +6,8 @@ use log::{error, info, Level}; use seed::{prelude::*, *}; use serde::Deserialize; -use web_sys::HtmlInputElement; + +use notmuch::{Message, SearchSummary, ThreadSet}; // ------ ------ // Init @@ -19,6 +20,7 @@ fn init(_: Url, orders: &mut impl Orders) -> Model { .perform_cmd(async { Msg::SearchResult(search_request("is:unread").await) }); Model { search_results: None, + show_results: None, } } @@ -28,41 +30,8 @@ fn init(_: Url, orders: &mut impl Orders) -> Model { // `Model` describes our app state. struct Model { - search_results: Option>, -} - -/* -[ -{ -"thread": "0000000000022fa5", -"timestamp": 1634947104, -"date_relative": "Yest. 16:58", -"matched": 1, -"total": 1, -"authors": "Blue Cross Blue Shield Claims Administrator", -"subject": "BCBS Settlement Claim Received", -"query": [ -"id:20211022235824.232afe38e3e07950@bcbssettlement.com", -null -], -"tags": [ -"inbox" -] -} -] -*/ -#[derive(Deserialize, Debug)] -struct SearchResult { - thread: String, - timestamp: u64, - date_relative: String, - matched: isize, - total: isize, - authors: String, - subject: String, - // TODO(wathiede): what are these? - //query:Vec<_>, - tags: Vec, + search_results: Option, + show_results: Option, } // ------ ------ @@ -73,31 +42,48 @@ struct SearchResult { // `Msg` describes the different events you can modify state with. enum Msg { SearchRequest(String), - // TODO(wathiede): replace String with serde json decoded struct - SearchResult(fetch::Result>), + SearchResult(fetch::Result), + ShowRequest(String), + ShowResult(fetch::Result), } // `update` describes how to handle each `Msg`. fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders) { match msg { Msg::SearchRequest(query) => { + model.show_results = None; orders .skip() .perform_cmd(async move { Msg::SearchResult(search_request(&query).await) }); } Msg::SearchResult(Ok(response_data)) => { - info!("fetch ok {:?}", response_data); + info!("fetch ok {:#?}", response_data); model.search_results = Some(response_data); } Msg::SearchResult(Err(fetch_error)) => { error!("fetch failed {:?}", fetch_error); } + Msg::ShowRequest(query) => { + model.show_results = None; + orders + .skip() + .perform_cmd(async move { Msg::ShowResult(show_request(&query).await) }); + } + + Msg::ShowResult(Ok(response_data)) => { + info!("fetch ok {:#?}", response_data); + model.show_results = Some(response_data); + } + + Msg::ShowResult(Err(fetch_error)) => { + error!("fetch failed {:?}", fetch_error); + } } } -async fn search_request(query: &str) -> fetch::Result> { +async fn search_request(query: &str) -> fetch::Result { Request::new(get_search_request_url(query)) .method(Method::Get) .fetch() @@ -111,22 +97,104 @@ fn get_search_request_url(query: &str) -> String { format!("http://nixos-07:9345/search/{}", query) } +async fn show_request(query: &str) -> fetch::Result { + Request::new(get_show_request_url(query)) + .method(Method::Get) + .fetch() + .await? + .check_status()? + .json() + .await +} + +fn get_show_request_url(query: &str) -> String { + format!("http://nixos-07:9345/show/{}", query) +} + // ------ ------ // View // ------ ------ +fn view_message(msg: Option<&Message>) -> Node { + if let Some(msg) = msg { + div![ + dl![ + dt!["Subject"], + dd![&msg.headers.subject], + dt!["From"], + dd![&msg.headers.from], + dt!["To"], + dd![&msg.headers.to], + dt!["CC"], + dd![&msg.headers.cc], + dt!["BCC"], + dd![&msg.headers.bcc], + dt!["Reply-To"], + dd![&msg.headers.reply_to], + dt!["Date"], + dd![&msg.headers.date], + ], + dl![ + dt!["MessageId"], + dd![&msg.id], + dt!["Match"], + dd![if msg.r#match { "true" } else { "false" }], + dt!["Excluded"], + dd![if msg.excluded { "true" } else { "false" }], + dt!["Filename"], + dd![&msg.filename], + dt!["Timestamp"], + dd![msg.timestamp.to_string()], + dt!["Date"], + dd![&msg.date_relative], + dt!["Tags"], + dd![format!("{:?}", msg.tags)], + ], + // msg.body.iter().map(|part| pre![part]) + pre![format!("{:#?}", msg.body)] + ] + } else { + div![h2!["No message"]] + } +} + // `view` describes what to display. fn view(model: &Model) -> Node { - let results = if let Some(res) = &model.search_results { - div![res.iter().map(|r| p![ - h3![&r.subject, " ", small![&r.date_relative]], - div![span![&r.authors]] - ])] + let content = if let Some(show_results) = &model.show_results { + div![show_results + .0 + .iter() + .enumerate() + .map(|(thread_idx, thread)| div![ + h2![format!("thread {}", thread_idx)], + thread + .0 + .iter() + .enumerate() + .map(|(thread_node_idx, thread_node)| div![ + h3![format!("thread node {}", thread_node_idx)], + view_message(thread_node.0.as_ref()) + ]) + ])] + } else if let Some(search_results) = &model.search_results { + let rows = search_results.0.iter().map(|r| { + let tid = r.thread.clone(); + tr![ + td![ + &r.authors, + IF!(r.total>1 => small![" ", r.total.to_string()]), + IF!(r.tags.contains(&"attachment".to_string()) => "📎"), + ], + td![&r.subject], + td![&r.date_relative], + ev(Ev::Click, move |_| Msg::ShowRequest(tid)), + ] + }); + div![table![tr![th!["From"], th!["Subject"], th!["Date"]], rows]] } else { - div![] + div![h1!["Loading"]] }; div![ - "Do Something: ", button![ "Unread", ev(Ev::Click, |_| Msg::SearchRequest("is:unread".to_string())), @@ -138,7 +206,7 @@ fn view(model: &Model) -> Node { }, input_ev(Ev::Input, Msg::SearchRequest), ], - results, + content ] }