diff --git a/README.md b/README.md index a1e6b54..a546718 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,14 @@ To run the tests, you'll need to install: * [Cap'n Proto](https://capnproto.org/) * [Protocol Buffers](https://developers.google.com/protocol-buffers/?hl=en) +* [FlatBuffers](https://google.github.io/flatbuffers) * [Go](https://golang.org/) * [Rust](https://rust-lang.org/) On OS X and [Homebrew](http://brew.sh/), this can all be done with: ``` -brew install capnp protobuf rust go +brew install capnp protobuf flatbuffers rust go ``` I'm not yet sure what's needed for other operating systems. Once that is diff --git a/rust/Cargo.lock b/rust/Cargo.lock index d92c09a..a4f4711 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,482 +1,561 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "autocfg" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" [[package]] -name = "bincode" +name = "autocfg" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bincode" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "serde", ] [[package]] name = "bitflags" -version = "1.0.4" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "byteorder" -version = "1.2.7" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "capnp" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f3809f2a9dae96253a32f079db1d9887a495fa0e3181bc2a64476d7ff58eac8" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", ] [[package]] name = "capnpc" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def7dcaba60ae98fb6fd1614e141f7c9b98ac7dd5daddb9f79771c4296b1ed21" dependencies = [ - "capnp 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", + "capnp", ] [[package]] name = "cfg-if" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" [[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] name = "flatbuffers" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c34f669be9911826facafe996adfda978aeee67285a13556869e2d8b8331f" dependencies = [ - "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec", ] [[package]] name = "flatc-rust" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e69e3f68d91fa29633d1a463b10a65a8ae49d9bc6cccc00526ed8be9fa30c0f" dependencies = [ - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log", ] [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 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)", + "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 = "itoa" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" [[package]] name = "libc" -version = "0.2.47" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" [[package]] name = "log" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "num-derive" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af1847c907c2f04d7bfd572fb25bbb4385c637fe5be163cf2f8c5d778fe1e7d" dependencies = [ - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "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.26 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", + "proc-macro2 0.4.24", + "quote 0.6.10", + "syn 0.15.26", ] [[package]] name = "num-traits" -version = "0.1.43" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.1", ] [[package]] -name = "num-traits" -version = "0.2.6" +name = "proc-macro2" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" +dependencies = [ + "unicode-xid 0.1.0", +] [[package]] name = "proc-macro2" -version = "0.4.24" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1", ] [[package]] name = "protobuf" -version = "2.2.4" +version = "2.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da78e04bc0e40f36df43ecc6575e4f4b180e8156c4efd73f13d5619479b05696" [[package]] name = "protobuf-codegen" -version = "2.2.4" +version = "2.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b2b929363268881afe6d24351e8b711ea5a1901a5e1549d3723ebcc5d3696d" dependencies = [ - "protobuf 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf", ] [[package]] name = "protoc" -version = "2.2.4" +version = "2.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2dbb118371acf8c4d45c23ad8852ab3abb07f45758fdfede9e37cad1570bbef" dependencies = [ - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log", + "which", ] [[package]] name = "protoc-rust" -version = "2.2.4" +version = "2.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da243950eeb0d0d4893413ff7ea54aec009b3ac692cd0b3bb0884094a8a72417" dependencies = [ - "protobuf 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf-codegen 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protoc 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf", + "protobuf-codegen", + "protoc", + "tempfile", ] [[package]] name = "quote" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" +dependencies = [ + "proc-macro2 0.4.24", +] + +[[package]] +name = "quote" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" dependencies = [ - "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.24", ] [[package]] name = "rand" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3906503e80ac6cbcacb2c2973fa8e473f24d7e2747c8c92bb230c2441cad96b5" dependencies = [ - "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.1", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", + "rand_isaac", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi", ] [[package]] name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.1", + "rand_core", ] [[package]] name = "rand_core" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" [[package]] name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "rand_isaac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "rand_os" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46fbd5550acf75b0c2730f5dd1873751daf9beb8f11b44027778fae50d7feca" dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.47 (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)", + "cloudabi", + "fuchsia-zircon", + "libc", + "rand_core", + "rdrand", + "winapi", ] [[package]] name = "rand_pcg" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", + "rustc_version", ] [[package]] name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "redox_syscall" version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" [[package]] name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi", ] [[package]] name = "rmp" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "num-traits", ] [[package]] name = "rmp-serde" -version = "0.13.7" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2657c5ae22d7d73f8cebfa8bf69c851fb3aa4ba3fb09e59b87de88bd18ecbe01" dependencies = [ - "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rmpv" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601e306fb529fadf3faa482684fba756e1b93897864ef2ab2080b12775c04235" +dependencies = [ + "num-traits", + "rmp", + "serde", + "serde_bytes", ] [[package]] name = "rust-serde-benchmarks" version = "0.0.1" dependencies = [ - "bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "capnp 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "capnpc 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "flatbuffers 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "flatc-rust 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "protoc-rust 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp-serde 0.13.7 (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.35 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode", + "capnp", + "capnpc", + "flatbuffers", + "flatc-rust", + "num-derive", + "num-traits", + "protobuf", + "protoc-rust", + "rmp-serde", + "rmpv", + "serde", + "serde_derive", + "serde_json", ] [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver", ] [[package]] name = "ryu" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.84" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" + +[[package]] +name = "serde_bytes" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +dependencies = [ + "serde", +] [[package]] name = "serde_derive" version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4d6115a3ca25c224e409185325afc16a0d5aaaabc15c42b09587d6f1ba39a5b" 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.26 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.24", + "quote 0.6.10", + "syn 0.15.26", ] [[package]] name = "serde_json" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb1277d4d0563e4593e0b8b5d23d744d277b55d2bc0bf1c38d0d8a6589d38aa" 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)", + "itoa", + "ryu", + "serde", ] [[package]] name = "smallvec" -version = "0.6.7" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" dependencies = [ - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit", ] [[package]] name = "syn" version = "0.15.26" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" +dependencies = [ + "proc-macro2 0.4.24", + "quote 0.6.10", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9802ddde94170d186eeee5005b798d9c159fa970403f1be19976d0cfb939b72" 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)", + "proc-macro2 1.0.24", + "quote 1.0.8", + "unicode-xid 0.2.1", ] [[package]] name = "tempfile" version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2" dependencies = [ - "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "rand", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "thiserror" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +dependencies = [ + "thiserror-impl", +] [[package]] -name = "unreachable" -version = "1.0.0" +name = "thiserror-impl" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.56", ] [[package]] -name = "void" -version = "1.0.2" +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "which" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +dependencies = [ + "libc", + "thiserror", +] [[package]] name = "winapi" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" 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-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" -"checksum bincode 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9f2fb9e29e72fd6bc12071533d5dc7664cb01480c59406f656d7ac25c7bd8ff7" -"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 capnp 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5f3809f2a9dae96253a32f079db1d9887a495fa0e3181bc2a64476d7ff58eac8" -"checksum capnpc 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "def7dcaba60ae98fb6fd1614e141f7c9b98ac7dd5daddb9f79771c4296b1ed21" -"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum flatbuffers 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea0c34f669be9911826facafe996adfda978aeee67285a13556869e2d8b8331f" -"checksum flatc-rust 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e69e3f68d91fa29633d1a463b10a65a8ae49d9bc6cccc00526ed8be9fa30c0f" -"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 itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" -"checksum libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)" = "48450664a984b25d5b479554c29cc04e3150c97aa4c01da5604a2d4ed9151476" -"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" -"checksum num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8af1847c907c2f04d7bfd572fb25bbb4385c637fe5be163cf2f8c5d778fe1e7d" -"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" -"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" -"checksum protobuf 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9e18cbbffd1481c115cfb809816dbe6a8f53cf5b4ac6df03d1589d9ccb6c609a" -"checksum protobuf-codegen 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "eb6cb1a50e66ca517bd25cb871211be326fc5f9736b4a6eae7d277842d904e95" -"checksum protoc 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "183abe5a3ca0c2e7b4568514d70b2b8f0cf234c159925b2a376347da0e70dc6d" -"checksum protoc-rust 2.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "81f3950d2968a6d7f860fb8171383385b444902ed0323b6cdaa9556d8de474b1" -"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" -"checksum rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3906503e80ac6cbcacb2c2973fa8e473f24d7e2747c8c92bb230c2441cad96b5" -"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" -"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f46fbd5550acf75b0c2730f5dd1873751daf9beb8f11b44027778fae50d7feca" -"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" -"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"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 remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum rmp 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a3d45d7afc9b132b34a2479648863aa95c5c88e98b32285326a6ebadc80ec5c9" -"checksum rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"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.35 (registry+https://github.com/rust-lang/crates.io-index)" = "dfb1277d4d0563e4593e0b8b5d23d744d277b55d2bc0bf1c38d0d8a6589d38aa" -"checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db" -"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" -"checksum tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" -"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" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 5ab9544..70ce671 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -10,13 +10,14 @@ flatc-rust = "0.1" protoc-rust = "2.0" [dependencies] -bincode = "1.0" +bincode = "1.3" capnp = "0.9" flatbuffers = "0.5" num-derive = "0.2" num-traits = "0.2" -protobuf = "2.0" -rmp-serde = "0.13" +protobuf = "2.18" +rmp-serde = "0.15.0" +rmpv = { "version" = "0.4.6", "features" = ["with-serde"] } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/rust/benches/bench.rs b/rust/benches/bench.rs index ee0cbb6..9ae46ea 100644 --- a/rust/benches/bench.rs +++ b/rust/benches/bench.rs @@ -4,6 +4,7 @@ extern crate capnp; extern crate flatbuffers; extern crate protobuf; extern crate rmp_serde; +extern crate rmpv; extern crate rust_serde_benchmarks; extern crate serde; extern crate serde_json; @@ -11,8 +12,10 @@ extern crate test; use capnp::message::{Builder, ReaderOptions}; use protobuf::{Clear, Message}; -use rust_serde_benchmarks::{log_capnp, log_proto, log_flatbuffers, protocol_capnp, protocol_protobuf, protocol_flatbuffers, Log}; -use serde::{Deserialize, Serialize}; +use rust_serde_benchmarks::{ + log_capnp, log_flatbuffers, log_proto, protocol_capnp, protocol_flatbuffers, protocol_protobuf, + Log, +}; use test::Bencher; #[bench] @@ -53,6 +56,21 @@ fn serde_json_serialize(b: &mut Bencher) { }); } +#[bench] +fn serde_json_serialize_dynamic(b: &mut Bencher) { + let log = Log::new(); + let mut buf = Vec::new(); + + serde_json::to_writer(&mut buf, &log).unwrap(); + b.bytes = buf.len() as u64; + let val: serde_json::Value = serde_json::from_slice(&buf).unwrap(); + + b.iter(|| { + buf.clear(); + serde_json::to_writer(&mut buf, &val).unwrap(); + }); +} + #[bench] fn serde_json_deserialize(b: &mut Bencher) { let log = Log::new(); @@ -63,6 +81,16 @@ fn serde_json_deserialize(b: &mut Bencher) { b.iter(|| serde_json::from_str::(&json).unwrap()); } +#[bench] +fn serde_json_deserialize_dynamic(b: &mut Bencher) { + let log = Log::new(); + let json = serde_json::to_string(&log).unwrap(); + + b.bytes = json.len() as u64; + + b.iter(|| serde_json::from_str::(&json).unwrap()); +} + #[bench] fn capnp_populate(b: &mut Bencher) { let mut msg = Builder::new_default(); @@ -167,9 +195,7 @@ fn flatbuffers_serialize(b: &mut Bencher) { let buf = msg.finished_data(); b.bytes = buf.len() as u64; - b.iter(|| { - msg.finished_data() - }); + b.iter(|| msg.finished_data()); } #[bench] @@ -181,24 +207,36 @@ fn flatbuffers_deserialize(b: &mut Bencher) { let buf = msg.finished_data(); b.bytes = buf.len() as u64; + b.iter(|| log_flatbuffers::get_root_as_log(&buf)); +} + +#[bench] +fn rmp_serde_serialize(b: &mut Bencher) { + let mut buf = Vec::new(); + let log = Log::new(); + + rmp_serde::encode::write(&mut buf, &log).unwrap(); + b.bytes = buf.len() as u64; + b.iter(|| { - log_flatbuffers::get_root_as_log(&buf) + buf.clear(); + rmp_serde::encode::write(&mut buf, &log).unwrap(); }); } #[bench] -fn rmp_serde_serialize(b: &mut Bencher) { +fn rmp_serde_serialize_dynamic(b: &mut Bencher) { let mut buf = Vec::new(); let log = Log::new(); - log.serialize(&mut ::rmp_serde::Serializer::new(&mut buf)) - .unwrap(); + rmp_serde::encode::write(&mut buf, &log).unwrap(); b.bytes = buf.len() as u64; + let val: rmpv::Value = rmp_serde::from_read_ref(&buf).unwrap(); + b.iter(|| { buf.clear(); - log.serialize(&mut ::rmp_serde::Serializer::new(&mut buf)) - .unwrap(); + rmp_serde::encode::write(&mut buf, &val).unwrap(); }); } @@ -206,13 +244,24 @@ fn rmp_serde_serialize(b: &mut Bencher) { fn rmp_serde_deserialize(b: &mut Bencher) { let mut buf = Vec::new(); let log = Log::new(); - log.serialize(&mut ::rmp_serde::Serializer::new(&mut buf)) - .unwrap(); + rmp_serde::encode::write(&mut buf, &log).unwrap(); + b.bytes = buf.len() as u64; + + b.iter(|| { + let _log: Log = rmp_serde::from_read_ref(&buf).unwrap(); + }); +} + +#[bench] +fn rmp_serde_deserialize_dynamic(b: &mut Bencher) { + let mut buf = Vec::new(); + let log = Log::new(); + rmp_serde::encode::write(&mut buf, &log).unwrap(); b.bytes = buf.len() as u64; b.iter(|| { - let mut decoder = ::rmp_serde::Deserializer::new(&*buf); - let _log: Log = Deserialize::deserialize(&mut decoder).unwrap(); + let _val: rmpv::ValueRef = + rmpv::decode::read_value_ref(&mut std::io::Cursor::new(buf.as_slice())).unwrap(); }); } @@ -268,6 +317,6 @@ fn rust_bincode_deserialize(b: &mut Bencher) { b.bytes = buf.len() as u64; b.iter(|| { - let _log: Log = ::bincode::deserialize_from(&*buf).unwrap(); + let _log: Log = ::bincode::deserialize(&buf).unwrap(); }); } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index eed06e9..bfa2e0c 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -10,6 +10,9 @@ extern crate serde; extern crate serde_derive; extern crate serde_json; +use std::borrow::Cow; +use std::fmt; + pub mod log_capnp { include!(concat!(env!("OUT_DIR"), "/log_capnp.rs")); } @@ -21,8 +24,6 @@ pub mod log_proto; #[path = "../target/flatbuffers/log_generated.rs"] pub mod log_flatbuffers; -use std::fmt; - macro_rules! enum_number { ($name:ident { $($variant:ident = $value:expr, )* }) => { #[derive(Clone, Copy, Debug, FromPrimitive)] @@ -73,16 +74,20 @@ macro_rules! enum_number { } #[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Http { +pub struct Http<'a> { pub protocol: HttpProtocol, pub status: u32, pub host_status: u32, pub up_status: u32, pub method: HttpMethod, - pub content_type: String, - pub user_agent: String, - pub referer: String, - pub request_uri: String, + #[serde(borrow)] + pub content_type: Cow<'a, str>, + #[serde(borrow)] + pub user_agent: Cow<'a, str>, + #[serde(borrow)] + pub referer: Cow<'a, str>, + #[serde(borrow)] + pub request_uri: Cow<'a, str>, } enum_number!(HttpProtocol { @@ -113,10 +118,12 @@ enum_number!(CacheStatus { }); #[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Origin { - pub ip: String, +pub struct Origin<'a> { + #[serde(borrow)] + pub ip: Cow<'a, str>, pub port: u32, - pub hostname: String, + #[serde(borrow)] + pub hostname: Cow<'a, str>, pub protocol: OriginProtocol, } @@ -394,23 +401,29 @@ enum_number!(Country { }); #[derive(Clone, Serialize, Deserialize, Debug)] -pub struct Log { +pub struct Log<'a> { pub timestamp: i64, pub zone_id: u32, pub zone_plan: ZonePlan, - pub http: Http, - pub origin: Origin, + #[serde(borrow)] + pub http: Http<'a>, + #[serde(borrow)] + pub origin: Origin<'a>, pub country: Country, pub cache_status: CacheStatus, - pub server_ip: String, - pub server_name: String, - pub remote_ip: String, + #[serde(borrow)] + pub server_ip: Cow<'a, str>, + #[serde(borrow)] + pub server_name: Cow<'a, str>, + #[serde(borrow)] + pub remote_ip: Cow<'a, str>, pub bytes_dlv: u64, - pub ray_id: String, + #[serde(borrow)] + pub ray_id: Cow<'a, str>, } -impl Log { - pub fn new() -> Log { +impl<'a> Log<'a> { + pub fn new() -> Log<'a> { Log { timestamp: 2837513946597, zone_id: 123456, @@ -421,31 +434,31 @@ impl Log { host_status: 503, up_status: 520, method: HttpMethod::GET, - content_type: "text/html".to_string(), - user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36".to_string(), - referer: "https://www.cloudflare.com/".to_string(), - request_uri: "/cdn-cgi/trace".to_string(), + content_type: "text/html".into(), + user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36".into(), + referer: "https://www.cloudflare.com/".into(), + request_uri: "/cdn-cgi/trace".into(), }, origin: Origin { - ip: "1.2.3.4".to_string(), + ip: "1.2.3.4".into(), port: 8000, - hostname: "www.example.com".to_string(), + hostname: "www.example.com".into(), protocol: OriginProtocol::HTTPS, }, country: Country::US, cache_status: CacheStatus::Hit, - server_ip: "192.168.1.1".to_string(), - server_name: "metal.cloudflare.com".to_string(), - remote_ip: "10.1.2.3".to_string(), + server_ip: "192.168.1.1".into(), + server_name: "metal.cloudflare.com".into(), + remote_ip: "10.1.2.3".into(), bytes_dlv: 123456, - ray_id: "10c73629cce30078-LAX".to_string(), + ray_id: "10c73629cce30078-LAX".into(), } } } pub mod protocol_capnp { - use capnp::message::{Allocator, Builder}; use crate::log_capnp::{h_t_t_p, log, origin, CacheStatus, Country, ZonePlan}; + use capnp::message::{Allocator, Builder}; pub fn populate_log<'a, A: Allocator>(msg: &'a mut Builder) -> log::Builder<'a> { let mut log = msg.init_root::(); @@ -527,7 +540,9 @@ pub mod protocol_protobuf { pub mod protocol_flatbuffers { use crate::log_flatbuffers; - pub fn populate_log_with_args<'a, 'b>(msg: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> flatbuffers::WIPOffset> { + pub fn populate_log_with_args<'a, 'b>( + msg: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> flatbuffers::WIPOffset> { let content_type = msg.create_string("text/html"); let user_agent = msg.create_string("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"); let referer = msg.create_string("https://www.cloudflare.com/"); @@ -545,7 +560,7 @@ pub mod protocol_flatbuffers { referer: Some(referer), requestURI: Some(request_uri), ..Default::default() - } + }, ); let ip = Some(msg.create_string("1.2.3.4")); @@ -559,7 +574,7 @@ pub mod protocol_flatbuffers { hostname, protocol: log_flatbuffers::Origin_Protocol::https, ..Default::default() - } + }, ); let server_ip = msg.create_string("192.168.1.1"); @@ -583,11 +598,13 @@ pub mod protocol_flatbuffers { bytesDlv: 123456, rayId: Some(ray_id), ..Default::default() - } + }, ) } - pub fn populate_log_with_builder<'a, 'b>(msg: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> flatbuffers::WIPOffset> { + pub fn populate_log_with_builder<'a, 'b>( + msg: &'b mut flatbuffers::FlatBufferBuilder<'a>, + ) -> flatbuffers::WIPOffset> { let content_type = msg.create_string("text/html"); let user_agent = msg.create_string("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"); let referer = msg.create_string("https://www.cloudflare.com/");