diff --git a/.gitignore b/.gitignore index 50242a6a..1ca8ef72 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ target .cargo spotify_appkey.key .vagrant/ +.project +.history \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 94da7c93..6a28f10a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: rust rust: - - 1.17.0 + - 1.32.0 - stable - beta - nightly @@ -14,6 +14,8 @@ addons: - libc6-dev-armhf-cross - libpulse-dev - portaudio19-dev + - libasound2-dev + - libsdl2-dev before_script: - mkdir -p ~/.cargo @@ -22,15 +24,22 @@ before_script: - rustup target add armv7-unknown-linux-gnueabihf script: - - cargo build --no-default-features - - cargo build --no-default-features --features "with-tremor" - - cargo build --no-default-features --features "portaudio-backend" - - cargo build --no-default-features --features "pulseaudio-backend" - - cargo build --no-default-features --features "alsa-backend" - - cargo build --no-default-features --target armv7-unknown-linux-gnueabihf - - if [[ $TRAVIS_RUST_VERSION != *"1.17.0"* ]]; then - cargo build --no-default-features --features "with-lewton"; - fi + - cargo build --locked --no-default-features + - cargo build --locked --no-default-features --features "with-tremor" + - cargo build --locked --no-default-features --features "with-vorbis" + - cargo build --locked --no-default-features --features "alsa-backend" + - cargo build --locked --no-default-features --features "portaudio-backend" + - cargo build --locked --no-default-features --features "pulseaudio-backend" + - cargo build --locked --no-default-features --features "jackaudio-backend" + - cargo build --locked --no-default-features --features "rodio-backend" + - cargo build --locked --no-default-features --features "sdl-backend" + - cargo build --locked --no-default-features --target armv7-unknown-linux-gnueabihf notifications: - email: false + email: false + webhooks: + urls: + - https://webhooks.gitter.im/e/780b178b15811059752e + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: never # options: [always|never|change] default: always diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ff35f036 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,165 @@ +# Contributing + +## Setup + +In order to contribute to librespot, you will first need to set up a suitable rust build environment, with the necessary dependenices installed. These instructions will walk you through setting up a simple build environment. + +You will need to have C compiler, rust, and portaudio installed. + +### Install Rust + +The easiest, and recommended way to get rust setu is to use [rustup](https://rustup.rs). You can install rustup with this command: + +```bash +curl https://sh.rustup.rs -sSf | sh +``` + +Follow any prompts it gives you to install rust. Once that’s done, rust is ready to use. + +### Install Other Dependencies +On debian / ubuntu, the following command will install these dependencies : + +```bash +sudo apt-get install build-essential portaudio19-dev +``` + +On Fedora systems, the following command will install these dependencies : + +```bash +sudo dnf install portaudio-devel make gcc +``` + +On macOS, using homebrew : + +```bash +brew install portaudio +``` + +### Getting the Source + +The recommended method is to first fork the repo, so that you have a copy that you have read/write access to. After that, it’s a simple case of git cloning. + +```bash +git clone git@github.com:YOURUSERNAME/librespot.git +``` + +CD to the newly cloned repo... + +```bash +cd librespot +``` + +### Development Extra Steps + +If you are looking to carry out development on librespot: + +```bash +rustup override set nightly +``` + +The command above overrides the default rust in the directory housing librespot to use the ```nightly``` version, as opposed to the ```stable``` version. + +Then, run the command below to install [rustfmt](https://github.com/rust-lang-nursery/rustfmt) for the ```nightly``` toolchain. This is not optional, as Travis CI is set up to check that code is compliant with rustfmt. + +```bash +rustup component add rustfmt-preview +``` + +## Compiling & Running + +Once your build environment is setup, compiling the code is pretty simple. + +### Compiling + +To build a ```debug``` build, from the project root: + +```bash +cargo build +``` + +And for ```release```: + +```bash +cargo build --release +``` + +You will most likely want to build debug builds when developing, as they are faster, and more verbose, for the purposes of debugging. + +There are also a number of compiler feature flags that you can add, in the event that you want to have certain additional features also compiled. The list of these is available on the [wiki](https://github.com/librespot-org/librespot/wiki/Compiling#addition-features). + +By default, librespot compiles with the ```portaudio-backend``` feature. To compile without default features, you can run with: + +```bash +cargo build --no-default-features +``` + +### Running + +Assuming you just compiled a ```debug``` build, you can run librespot with the following command: + +```bash +./target/debug/librespot -n Librespot +``` + +There are various runtime options, documented in the wiki, and visible by running librespot with the ```-h``` argument. + +## Reporting an Issue + +Issues are tracked in the Github issue tracker of the librespot repo. + +If you have encountered a bug, please report it, as we rely on user reports to fix them. + +Please also make sure that your issues are helpful. To ensure that your issue is helpful, please read over this brief checklist to avoid the more common pitfalls: + + - Please take a moment to search/read previous similar issues to ensure you aren’t posting a duplicate. Duplicates will be closed immediately. + - Please include a clear description of what the issue is. Issues with descriptions such as ‘It hangs after 40 minutes’ will be closed immediately. + - Please include, where possible, steps to reproduce the bug, along with any other material that is related to the bug. For example, if librespot consistently crashes when you try to play a song, please include the Spotify URI of that song. This can be immensely helpful in quickly pinpointing and resolving issues. + - Lastly, and perhaps most importantly, please include a backtrace where possible. Recent versions of librespot should produce these automatically when it crashes, and print them to the console, but in some cases, you may need to run ‘export RUST_BACKTRACE=full’ before running librespot to enable backtraces. + +## Contributing Code + +If there is an issue that you would like to write a fix for, or a feature you would like to implement, we use the following flow for updating code in the librespot repo: + +``` +Fork -> Fix -> PR -> Review -> Merge +``` + +This is how all code is added to the repository, even by those with write access. + +#### Steps before Commiting + +In order to prepare for a PR, you will need to do a couple of things first: + +Make any changes that you are going to make to the code, but do not commit yet. + +Make sure you are using rust ```nightly``` to build librespot. Once this is confirmed, you will need to run the following command: + +```bash +cargo fmt --all +``` + +This command runs the previously installed ```rustfmt```, a code formatting tool that will automatically correct any formatting that you have used that does not conform with the librespot code style. Once that command has run, you will need to rebuild the project: + +```bash +cargo build +``` + +Once it has built, and you have confirmed there are no warnings or errors, you should commit your changes. + +```bash +git commit -a -m “My fancy fix” +``` + +**N.B.** Please, for the sake of a readable history, do not bundle multipe major changes into a single commit. Instead, break it up into multiple commits. + +Once you have made the commits you wish to have merged, push them to your forked repo: + +```bash +git push +``` + +Then open a pull request on the main librespot repo. + +Once a pull request is under way, it will be reviewed by one of the project maintainers, and either approved for merging, or have changes requested. Please be alert in the review period for possible questions about implementation decisions, implemented behaviour, and requests for changes. Once the PR is approved, it will be merged into the main repo. + +Happy Contributing :) diff --git a/Cargo.lock b/Cargo.lock index d8128db1..d50a0ac4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,902 +1,2213 @@ -[root] +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aes" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aes-ctr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aes-soft" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aesni" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "alga" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "alsa" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "alsa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "approx" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arc-swap" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bindgen" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-set" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-vec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-cipher-trait" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-modes" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "c2-chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "c_linked_list" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cexpr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "chrono" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clang-sys" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "coreaudio-rs" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "coreaudio-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cpal" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ctr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dns-parser" +version = "0.3.2" +source = "git+https://github.com/plietar/dns-parser#1d3e5a5591bc72eb061c23bd426c4a25f2f73791" +dependencies = [ + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dns-sd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.4.3" +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)", +] + +[[package]] +name = "env_logger" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "extprim" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure_derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "get_if_addrs" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "get_if_addrs-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getopts" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hmac" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "humantime" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (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.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-proxy" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +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.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "jack" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jack-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jack-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +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)", +] + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lewton" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.60" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libloading" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libpulse-sys" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot" +version = "0.1.0" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-audio 0.1.0", + "librespot-connect 0.1.0", + "librespot-core 0.1.0", + "librespot-metadata 0.1.0", + "librespot-playback 0.1.0", + "librespot-protocol 0.1.0", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rpassword 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-process 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot-audio" +version = "0.1.0" +dependencies = [ + "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-core 0.1.0", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tremor 0.1.0 (git+https://github.com/plietar/rust-tremor)", + "vorbis 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot-connect" +version = "0.1.0" +dependencies = [ + "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block-modes 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dns-sd 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-core 0.1.0", + "librespot-playback 0.1.0", + "librespot-protocol 0.1.0", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mdns 0.2.0 (git+https://github.com/plietar/rust-mdns)", + "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot-core" +version = "0.1.0" +dependencies = [ + "aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "extprim 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-protocol 0.1.0", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot-metadata" +version = "0.1.0" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-core 0.1.0", + "librespot-protocol 0.1.0", + "linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librespot-playback" +version = "0.1.0" +dependencies = [ + "alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cpal 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-audio 0.1.0", + "librespot-core 0.1.0", + "librespot-metadata 0.1.0", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "portaudio-rs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rodio 0.9.0 (git+https://github.com/tomaka/rodio)", + "sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "librespot-protocol" version = "0.1.0" dependencies = [ - "protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf-codegen-pure 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "linear-map" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lock_api" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "matrixmultiply" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mdns" +version = "0.2.0" +source = "git+https://github.com/plietar/rust-mdns#66a74033da6c9f1a06e7b0a29f4544fd189d6479" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dns-parser 0.3.2 (git+https://github.com/plietar/dns-parser)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "multimap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "socket2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-named-pipes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "socket2 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multimap" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nalgebra" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "alga 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nix" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nix" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "aho-corasick" -version = "0.6.3" +name = "nodrop" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nom" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "alsa" -version = "0.0.1" -source = "git+https://github.com/plietar/rust-alsa#8c63543fa0ccd971cf15f5675293d19febd6f79e" +name = "num" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "aster" -version = "0.41.0" +name = "num-bigint" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "base64" -version = "0.5.2" +name = "num-complex" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "base64" -version = "0.6.0" +name = "num-integer" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "bit-set" -version = "0.4.0" +name = "num-iter" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "bit-vec" -version = "0.4.4" +name = "num-traits" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "bitflags" -version = "0.3.3" +name = "num_cpus" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "bitflags" +name = "ogg" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "bitflags" -version = "0.8.2" +name = "ogg-sys" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "byteorder" -version = "0.5.3" +name = "opaque-debug" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "byteorder" -version = "1.1.0" +name = "owning_ref" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "bytes" -version = "0.4.4" +name = "parking_lot" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "cfg-if" -version = "0.1.2" +name = "parking_lot_core" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "conv" -version = "0.3.3" +name = "pbkdf2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "custom_derive" -version = "0.1.7" +name = "peeking_take_while" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "dns-parser" -version = "0.3.2" -source = "git+https://github.com/plietar/dns-parser#1d3e5a5591bc72eb061c23bd426c4a25f2f73791" +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "portaudio-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "portaudio-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "dtoa" -version = "0.4.1" +name = "portaudio-sys" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "env_logger" -version = "0.4.3" +name = "ppv-lite86" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "error-chain" -version = "0.9.0" +name = "proc-macro2" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "futures" -version = "0.1.14" +name = "protobuf" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-cpupool" -version = "0.1.5" +name = "protobuf-codegen" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "gcc" -version = "0.3.51" +name = "protobuf-codegen-pure" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf-codegen 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "getopts" -version = "0.2.14" +name = "quick-error" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "httparse" -version = "1.2.3" +name = "quote" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "hyper" -version = "0.11.2" +name = "quote" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.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.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "idna" -version = "0.1.4" +name = "rand" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (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.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "iovec" -version = "0.1.0" +name = "rand" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "itoa" -version = "0.3.1" +name = "rand" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "rand" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (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.4.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_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (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.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "language-tags" -version = "0.2.2" +name = "rand" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "lazy_static" -version = "0.2.8" +name = "rand_chacha" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "lazycell" -version = "0.5.1" +name = "rand_chacha" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "lewton" -version = "0.6.2" +name = "rand_core" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ogg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "libc" -version = "0.2.29" +name = "rand_core" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "libpulse-sys" -version = "0.0.0" +name = "rand_core" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "librespot" +name = "rand_hc" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "alsa 0.0.1 (git+https://github.com/plietar/rust-alsa)", - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.0", - "librespot-core 0.1.0", - "librespot-metadata 0.1.0", - "librespot-protocol 0.1.0", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mdns 0.2.0 (git+https://github.com/plietar/rust-mdns)", - "num-bigint 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "portaudio-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf_macros 0.6.0 (git+https://github.com/plietar/rust-protobuf-macros)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rpassword 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.36 (git+https://github.com/awmath/rust-crypto.git?branch=avx2)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-signal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "librespot-audio" -version = "0.1.0" +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "lewton 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.0", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num-bigint 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.36 (git+https://github.com/awmath/rust-crypto.git?branch=avx2)", - "tempfile 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tremor 0.1.0 (git+https://github.com/plietar/rust-tremor)", - "vorbis 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "librespot-core" -version = "0.1.0" +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-protocol 0.1.0", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num-bigint 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf_macros 0.6.0 (git+https://github.com/plietar/rust-protobuf-macros)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rpassword 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-crypto 0.2.36 (git+https://github.com/awmath/rust-crypto.git?branch=avx2)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", - "shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "librespot-metadata" -version = "0.1.0" +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.0", - "librespot-protocol 0.1.0", - "linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "linear-map" -version = "1.2.0" +name = "rand_os" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.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.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "log" -version = "0.3.8" +name = "rand_pcg" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "magenta" +name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "magenta-sys" -version = "0.1.1" +name = "rawpointer" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "matches" -version = "0.1.6" +name = "redox_syscall" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "mdns" -version = "0.2.0" -source = "git+https://github.com/plietar/rust-mdns#c0fc73502d7d752a4ffeb5268a017561405e218c" +name = "regex" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dns-parser 0.3.2 (git+https://github.com/plietar/dns-parser)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "multimap 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (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.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "memchr" -version = "1.0.1" +name = "regex" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.10 (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.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "mime" -version = "0.3.2" +name = "regex-syntax" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "mio" +name = "regex-syntax" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "relay" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rodio" +version = "0.9.0" +source = "git+https://github.com/tomaka/rodio#655d05100f1ba695bcc93b8733216de37d0c5432" +dependencies = [ + "cpal 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rpassword" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "mio-uds" -version = "0.6.4" +name = "rustc-demangle" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safemem" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "miow" -version = "0.2.1" +name = "scoped-tls" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "multimap" -version = "0.3.0" +name = "scopeguard" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "net2" -version = "0.2.30" +name = "scopeguard" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "nix" -version = "0.8.1" +name = "sdl2" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "num-bigint" -version = "0.1.40" +name = "sdl2-sys" +version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "num-integer" -version = "0.1.35" +name = "semver" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "num-traits" -version = "0.1.40" +name = "semver-parser" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "num_cpus" -version = "1.6.2" +name = "serde" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "ogg" -version = "0.5.0" +name = "serde_derive" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "ogg-sys" -version = "0.0.9" +name = "serde_json" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "percent-encoding" -version = "1.0.0" +name = "sha-1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "pkg-config" -version = "0.3.9" +name = "sha2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "portaudio-rs" -version = "0.3.0" +name = "shannon" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "portaudio-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "portaudio-sys" -version = "0.1.1" +name = "signal-hook" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "protobuf" -version = "1.4.1" +name = "signal-hook-registry" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "protobuf_macros" -version = "0.6.0" -source = "git+https://github.com/plietar/rust-protobuf-macros#f186dc5a16c0d79f14c319ac8ce30b06de0cefee" dependencies = [ - "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "quick-error" -version = "1.2.0" +name = "slab" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "quote" -version = "0.3.15" +name = "slab" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "rand" -version = "0.3.16" +name = "smallvec" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "redox_syscall" -version = "0.1.29" +name = "smallvec" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "regex" -version = "0.2.2" +name = "socket2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "regex-syntax" -version = "0.4.1" +name = "socket2" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "rpassword" -version = "0.3.1" +name = "spin" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "rust-crypto" -version = "0.2.36" -source = "git+https://github.com/awmath/rust-crypto.git?branch=avx2#394c247254dbe2ac5d44483232cf335d10cf0260" -dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", -] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "rustc-serialize" -version = "0.3.24" +name = "stdweb" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "rustc_version" -version = "0.1.7" +name = "stream-cipher" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "safemem" -version = "0.2.0" +name = "strsim" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "scoped-tls" -version = "0.1.0" +name = "subtle" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "semver" -version = "0.1.20" +name = "syn" +version = "0.15.42" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "serde" -version = "0.9.15" +name = "synstructure" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "serde_codegen_internals" -version = "0.14.2" +name = "tempfile" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "serde_derive" -version = "0.9.15" +name = "termcolor" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen_internals 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "serde_json" -version = "0.9.10" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "shannon" -version = "0.2.0" +name = "thread_local" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "slab" -version = "0.3.0" +name = "time" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "smallvec" -version = "0.2.1" +name = "tokio" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "syn" -version = "0.11.11" +name = "tokio-codec" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "synom" -version = "0.11.3" +name = "tokio-core" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "syntex" -version = "0.58.1" +name = "tokio-current-thread" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "syntex_errors" -version = "0.58.1" +name = "tokio-executor" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "syntex_pos" -version = "0.58.1" +name = "tokio-fs" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "syntex_syntax" -version = "0.58.1" +name = "tokio-io" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "take" -version = "0.1.0" +name = "tokio-process" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "tempfile" -version = "2.1.6" +name = "tokio-proto" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "term" -version = "0.4.6" +name = "tokio-reactor" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "termios" -version = "0.2.2" +name = "tokio-service" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "thread_local" -version = "0.3.4" +name = "tokio-signal" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "time" -version = "0.1.38" +name = "tokio-sync" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-core" -version = "0.1.9" +name = "tokio-tcp" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-io" -version = "0.1.2" +name = "tokio-threadpool" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-proto" -version = "0.1.1" +name = "tokio-timer" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-service" -version = "0.1.0" +name = "tokio-udp" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-signal" -version = "0.1.2" +name = "tokio-uds" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -904,7 +2215,7 @@ name = "tremor" version = "0.1.0" source = "git+https://github.com/plietar/rust-tremor#5958cc302e78f535dad90e9665da981ddff4000a" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "tremor-sys 0.1.0 (git+https://github.com/plietar/rust-tremor)", ] @@ -913,18 +2224,33 @@ name = "tremor-sys" version = "0.1.0" source = "git+https://github.com/plietar/rust-tremor#5958cc302e78f535dad90e9665da981ddff4000a" dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (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.60 (registry+https://github.com/rust-lang/crates.io-index)", "ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "try-lock" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typenum" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ucd-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicase" -version = "2.0.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -932,59 +2258,79 @@ name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-normalization" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "unicode-xid" -version = "0.0.4" +name = "unicode-width" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "unreachable" -version = "1.0.0" +name = "unicode-xid" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "url" -version = "1.5.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", ] [[package]] name = "utf8-ranges" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "uuid" -version = "0.4.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "vergen" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vergen" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "void" version = "1.0.2" @@ -995,9 +2341,9 @@ name = "vorbis" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "vorbis-encoder 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "vorbisfile-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1008,10 +2354,10 @@ name = "vorbis-encoder" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (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.60 (registry+https://github.com/rust-lang/crates.io-index)", "ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1020,10 +2366,10 @@ name = "vorbis-sys" version = "0.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (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.60 (registry+https://github.com/rust-lang/crates.io-index)", "ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1031,23 +2377,77 @@ name = "vorbisfile-sys" version = "0.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.29 (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.60 (registry+https://github.com/rust-lang/crates.io-index)", "ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "which" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +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)", +] + [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wincolor" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -1058,121 +2458,266 @@ dependencies = [ ] [metadata] -"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" -"checksum alsa 0.0.1 (git+https://github.com/plietar/rust-alsa)" = "" -"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" -"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" -"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" -"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" -"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" +"checksum aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" +"checksum aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" +"checksum aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" +"checksum aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" +"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" +"checksum alga 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d708cb68c7106ed1844de68f50f0157a7788c2909a6926fad5a87546ef6a4ff8" +"checksum alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a0d4ebc8b23041c5de9bc9aee13b4bad844a589479701f31a5934cfe4aeb32" +"checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +"checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" +"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" +"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b" +"checksum backtrace 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "88fb679bc9af8fa639198790a77f52d345fe13656c08b43afa9424c206b731c6" +"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +"checksum bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b242e11a8f446f5fc7b76b37e81d737cabca562a927bd33766dac55b5f1177f" +"checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" +"checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" "checksum bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "32866f4d103c4e438b1db1158aa1b1a80ee078e5d77a59a2f906fd62a577389c" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"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.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" +"checksum block-modes 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "31aa8410095e39fdb732909fb5730a48d5bd7c2e3cd76bd1b07b3dbea130c529" +"checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" -"checksum bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24f16593f445422331a5eed46b72f7f171f910fead4f2ea8f17e727e9c5c14" -"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" -"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" +"checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" +"checksum cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "ce400c638d48ee0e9ab75aef7997609ec57367ccfe1463f21bf53c3eca67bf46" +"checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +"checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" +"checksum clang-sys 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e414af9726e1d11660801e73ccc7fb81803fb5f49e5903a25b348b2b3b480d2e" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" +"checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" +"checksum coreaudio-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "78fdbabf58d5b1f461e31b94a571c109284f384cec619a3d96e66ec55b4de82b" +"checksum cpal 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d58ae1ed6536b1b233f5e3aeb6997a046ddb4d05e3f61701b58a92eb254a829e" +"checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" +"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" +"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +"checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +"checksum ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dns-parser 0.3.2 (git+https://github.com/plietar/dns-parser)" = "" -"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" +"checksum dns-sd 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d748509dea20228f63ba519bf142ce2593396386125b01f5b0d6412dab972087" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" -"checksum error-chain 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e92ecf0a508c8e074c0e6fa8fe0fa38414848ad4dfc4db6f74c5e9753330b248" -"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" -"checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff" -"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" -"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" -"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07" -"checksum hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "641abc3e3fcf0de41165595f801376e01106bca1fd876dda937730e477ca004c" -"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" -"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be" -"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" +"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" +"checksum extprim 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfba1bd0c749760b3dad3e4d3926b2bf6186f48e244456bfe1ad3aecd55b4fb1" +"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"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 futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" +"checksum get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" +"checksum getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "72327b15c228bfe31f1390f93dd5e9279587f0463836393c9df719ce62a3e450" +"checksum getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e65cce4e5084b14874c4e7097f38cab54f47ee554f9194673456ea379dcc4c55" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" +"checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" +"checksum hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44f0925de2747e481e6e477dd212c25e8f745567f02f6182e04d27b97c3fbece" +"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.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e15fc592e2e5a74a105ff507083c04db1aa20ba1b90d425362ba000e57422df" +"checksum jack-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d4ca501477fd3cd93a36df581046e5d6338ed826cf7e9b8d302603521e6cc3" "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 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" -"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b" -"checksum lewton 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0de1cca3399919efa65ae7e01ed6696c961bd0fc9e844c05c80f90b638300bbf" -"checksum libc 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)" = "8a014d9226c2cc402676fbe9ea2e15dd5222cd1dd57f576b5b283178c944a264" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" +"checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb" +"checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" +"checksum libm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" "checksum linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" -"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" -"checksum magenta 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf0336886480e671965f794bc9b6fce88503563013d1bfb7a502c81fe3ac527" -"checksum magenta-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40d014c7011ac470ae28e2f76a02bfea4a8480f73e701353b49ad7a8d75f4699" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" +"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfed72d871629daa12b25af198f110e8095d7650f5f4c61c5bac28364604f9b" "checksum mdns 0.2.0 (git+https://github.com/plietar/rust-mdns)" = "" -"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" -"checksum mime 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c5ca99d8a021c1687882fd68dca26e601ceff5c26571c7cb41cf4ed60d57cb2d" -"checksum mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "dbd91d3bfbceb13897065e97b2ef177a09a438cb33612b2d371bf568819a9313" -"checksum mio-uds 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1731a873077147b626d89cc6c2a0db6288d607496c5d10c0cfcf3adc697ec673" +"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" +"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" +"checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" +"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" +"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum multimap 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9223f4774d08e06185e44e555b9a7561243d387bac49c78a6205c42d6975fbf2" -"checksum net2 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "94101fd932816f97eb9a5116f6c1a11511a1fed7db21c5ccd823b2dc11abf566" -"checksum nix 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "47e49f6982987135c5e9620ab317623e723bd06738fd85377e8d55f57c8b6487" -"checksum num-bigint 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "8fd0f8dbb4c0960998958a796281d88c16fbe68d87b1baa6f31e2979e81fd0bd" -"checksum num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "d1452e8b06e448a07f0e6ebb0bb1d92b8890eea63288c0b627331d53514d0fba" -"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0" -"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" -"checksum ogg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7137bf02687385302f4c0aecd77cfce052b69f5b4ee937be778e125c62f67e30" +"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" +"checksum multimap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb04b9f127583ed176e163fb9ec6f3e793b87e21deedd5734a69386a18a0151" +"checksum nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e12856109b5cb8e2934b5e45e4624839416e1c6c1f7d286711a7a66b79db29d" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum nix 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "becb657d662f1cd2ef38c7ad480ec6b8cf9e96b27adb543e594f9cf0f2e6065c" +"checksum nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2c5afeb0198ec7be8569d666644b574345aad2e95a53baf3a532da3e0f3fb32" +"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" +"checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" +"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" +"checksum num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "57450397855d951f1a41305e54851b1a7b8f5d2e349543a02a2effe25459f718" +"checksum num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc" +"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" +"checksum num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e" +"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" +"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" +"checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" "checksum ogg-sys 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a95b8c172e17df1a41bf8d666301d3b2c4efeb90d9d0415e2a4dc0668b35fdb2" -"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" -"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum portaudio-rs 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "029e0ab393b44b2d825efbc755cae51c36be7a99d91356b2052be0ed05836636" +"checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" +"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" +"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" +"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" +"checksum pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" +"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" +"checksum portaudio-rs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc0e6b38f00fae9dde9a9832a2b54405988c6dcaf2870e6f9551546b447bbd7f" "checksum portaudio-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5194a4fa953b4ffd851c320ef6f0484cd7278cb7169ea9d6c433e49b23f7b7f5" -"checksum protobuf 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "568a15e4d572d9a5e63ae3a55f84328c984842887db179b40b4cc6a608bac6a4" -"checksum protobuf_macros 0.6.0 (git+https://github.com/plietar/rust-protobuf-macros)" = "" -"checksum quick-error 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c36987d4978eb1be2e422b1e0423a557923a5c3e7e6f31d5699e9aafaefa469" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf" -"checksum redox_syscall 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "3c9309631a35303bffb47e397198e3668cb544fe8834cd3da2a744441e70e524" -"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" -"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" -"checksum rpassword 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec4bdede957362ec6fdd550f7e79c6d14cad2bc26b2d062786234c6ee0cb27bb" -"checksum rust-crypto 0.2.36 (git+https://github.com/awmath/rust-crypto.git?branch=avx2)" = "" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" -"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" -"checksum serde_codegen_internals 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc888bd283bd2420b16ad0d860e35ad8acb21941180a83a189bb2046f9d00400" -"checksum serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "978fd866f4d4872084a81ccc35e275158351d3b9fe620074e7d7504b816b74ba" -"checksum serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ad8bcf487be7d2e15d3d543f04312de991d631cfe1b43ea0ade69e6a8a5b16a1" +"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" +"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8aefcec9f142b524d98fc81d07827743be89dd6586a1ba6ab21fa66a500b3fa5" +"checksum protobuf-codegen 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31539be8028d6b9e8e1b3b7c74e2fa3555302e27b2cc20dbaee6ffba648f75e2" +"checksum protobuf-codegen-pure 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00993dc5fbbfcf9d8a005f6b6c29fd29fd6d86deba3ae3f41fd20c624c414616" +"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" +"checksum rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" +"checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc" +"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +"checksum regex-syntax 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5485bf1523a9ed51c4964273f22f63f24e31632adb5dad134f488f86a3875c" +"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" +"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum rodio 0.9.0 (git+https://github.com/tomaka/rodio)" = "" +"checksum rpassword 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c34fa7bcae7fca3c8471e8417088bbc3ad9af8066b0ecf4f3c0d98a0d772716e" +"checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" +"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" +"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" +"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" +"checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" +"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.97 (registry+https://github.com/rust-lang/crates.io-index)" = "d46b3dfedb19360a74316866cef04687cd4d6a70df8e6a506c63512790769b72" +"checksum serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)" = "c22a0820adfe2f257b098714323563dd06426502abbbce4f51b72ef544c5027f" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" +"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" "checksum shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ea5b41c9427b56caa7b808cb548a04fb50bb5b9e98590b53f28064ff4174561" +"checksum signal-hook 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4f61c4d59f3aaa9f61bba6450a9b80ba48362fd7d651689e7a10c453b1f6dc68" +"checksum signal-hook-registry 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "913661ac8848a61e39684a3c3e7a7a14a4deec7f54b4976d0641e70dda3939b1" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" -"checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" -"checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" -"checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" +"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +"checksum socket2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b4896961171cd3317c7e9603d88f379f8c6e45342212235d356496680c68fd" +"checksum socket2 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df028e0e632c2a1823d920ad74895e7f9128e6438cbc4bc6fd1f180e644767b9" +"checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +"checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8861bc80f649f5b4c9bd38b696ae9af74499d479dbfb327f0607de6b326a36bc" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +"checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e" +"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" -"checksum tempfile 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5b92290d7f1ce2d221405d5c78b9c568c9f1debb314aa92a513cd99db709f931" -"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" -"checksum termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d9cf598a6d7ce700a4e6a9199da127e6819a61e64b68609683cc9a01b5683a" -"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" -"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520" -"checksum tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e85d419699ec4b71bfe35bbc25bb8771e52eff0471a7f75c853ad06e200b4f86" -"checksum tokio-io 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c2c3ce9739f7387a0fa65b5421e81feae92e04d603f008898f4257790ce8c2db" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"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 tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" +"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" +"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" +"checksum tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f27ee0e6db01c5f0b2973824547ce7e637b2ed79b891a9677b0de9bd532b6ac" +"checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" +"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" +"checksum tokio-process 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afbd6ef1b8cc2bd2c2b580d882774d443ebb1c6ceefe35ba9ea4ab586c89dbe8" "checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" +"checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" -"checksum tokio-signal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3d121715f6917878a0df69f39365d01dd66c4463e4ba19efdcddcdfeb1bcb2bc" +"checksum tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "dd6dc5276ea05ce379a16de90083ec80836440d5ef8a6a39545a3207373b8296" +"checksum tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2162248ff317e2bc713b261f242b69dbb838b85248ed20bb21df56d60ea4cae7" +"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" +"checksum tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "90ca01319dea1e376a001e8dc192d42ebde6dd532532a5bad988ac37db365b19" +"checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" +"checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" +"checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum tremor 0.1.0 (git+https://github.com/plietar/rust-tremor)" = "" "checksum tremor-sys 0.1.0 (git+https://github.com/plietar/rust-tremor)" = "" -"checksum unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e01da42520092d0cd2d6ac3ae69eb21a22ad43ff195676b86f8c37f487d6b80" +"checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" +"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" +"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" +"checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" -"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" -"checksum uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7cfec50b0842181ba6e713151b72f4ec84a6a7e2c9c8a8a3ffc37bb1cd16b231" +"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" +"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +"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.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c3365f36c57e5df714a34be40902b27a992eeddb9996eca52d0584611cf885d" +"checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" +"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 vorbis 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "760993e54524128b88d4d7aff09c773c2f16a9f18db3c8ae1ccca5afd1287656" "checksum vorbis-encoder 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3fb66bcdde056dd230991bb86669a1269778fe8ad1f6cee403428ac7985391bc" "checksum vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "729e1f15395850b4e6d19ca0cd1d42ef44707503a53b69d40ff49182b3c5589d" "checksum vorbisfile-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f4306d7e1ac4699b55e20de9483750b90c250913188efd7484db6bfbe9042d1" +"checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" +"checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "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-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/Cargo.toml b/Cargo.toml index f4e63498..9efef76f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,6 @@ name = "librespot" version = "0.1.0" authors = ["Paul Liétar "] -build = "build.rs" license = "MIT" description = "Open Source Spotify client library" keywords = ["spotify"] @@ -22,55 +21,58 @@ doc = false [dependencies.librespot-audio] path = "audio" +[dependencies.librespot-connect] +path = "connect" [dependencies.librespot-core] path = "core" [dependencies.librespot-metadata] path = "metadata" +[dependencies.librespot-playback] +path = "playback" [dependencies.librespot-protocol] path = "protocol" [dependencies] -base64 = "0.5.0" -env_logger = "0.4.0" -futures = "0.1.8" -getopts = "0.2.14" -hyper = "0.11.2" -log = "0.3.5" -mdns = { git = "https://github.com/plietar/rust-mdns" } -num-bigint = "0.1.35" -protobuf = "1.1" -rand = "0.3.13" -rpassword = "0.3.0" -rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" } -serde = "0.9.6" -serde_derive = "0.9.6" -serde_json = "0.9.5" -tokio-core = "0.1.2" -tokio-signal = "0.1.2" -url = "1.3" - -alsa = { git = "https://github.com/plietar/rust-alsa", optional = true } -portaudio-rs = { version = "0.3.0", optional = true } -libpulse-sys = { version = "0.0.0", optional = true } +base64 = "0.10" +env_logger = "0.6" +futures = "0.1" +getopts = "0.2" +hyper = "0.11" +log = "0.4" +num-bigint = "0.2" +protobuf = "2.8.*" +rand = "0.7" +rpassword = "3.0" +tokio-core = "0.1" +tokio-io = "0.1" +tokio-process = "0.2" +tokio-signal = "0.2" +url = "1.7" +sha-1 = "0.8" +hex = "0.3" [build-dependencies] -rand = "0.3.13" -vergen = "0.1.0" -protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros", features = ["with-syntex"] } +rand = "0.7" +vergen = "3.0" [features] -alsa-backend = ["alsa"] -portaudio-backend = ["portaudio-rs"] -pulseaudio-backend = ["libpulse-sys"] +alsa-backend = ["librespot-playback/alsa-backend"] +portaudio-backend = ["librespot-playback/portaudio-backend"] +pulseaudio-backend = ["librespot-playback/pulseaudio-backend"] +jackaudio-backend = ["librespot-playback/jackaudio-backend"] +rodio-backend = ["librespot-playback/rodio-backend"] +sdl-backend = ["librespot-playback/sdl-backend"] with-tremor = ["librespot-audio/with-tremor"] -with-lewton = ["librespot-audio/with-lewton"] +with-vorbis = ["librespot-audio/with-vorbis"] + +with-dns-sd = ["librespot-connect/with-dns-sd"] -default = ["portaudio-backend"] +default = ["librespot-playback/rodio-backend"] [package.metadata.deb] -maintainer = "nobody" -copyright = "2016 Paul Liétar" +maintainer = "librespot-org" +copyright = "2018 Paul Liétar" license_file = ["LICENSE", "4"] depends = "$auto" extended_description = """\ diff --git a/README.md b/README.md index eead8760..ad3c9575 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,49 @@ +[![Build Status](https://travis-ci.org/librespot-org/librespot.svg?branch=master)](https://travis-ci.org/librespot-org/librespot) +[![Gitter chat](https://badges.gitter.im/librespot-org/librespot.png)](https://gitter.im/librespot-org/spotify-connect-resources) + +# This version +Compiles for Android by not allowed password reading at the command line and not using discovey on local networks. + +## Request for maintainers +Activity on librespot as of late has been somewhat limited. I’ve been busy with other projects, and have also bought a Spotify Connect speaker, hence my needs for librespot are diminished. It would be great for this project to live on though, and the many contributions that have been provided over the years clearly show that it’s used by more than a few. Thus, I’m requesting that anyone who would be interested in taking over the maintenance of this project leave a note in [#363](https://github.com/librespot-org/librespot/issues/363). Regular contributors have priority, but all interested parties invited. Also, I will not be the sole individual choosing a new maintainer, anyone who has contributed to librespot is welcome to suggest a new maintainer or offer support for an individual in the previously linked thread. After a few weeks, we’ll hopefully choose a new maintainer :) + # librespot *librespot* is an open source client library for Spotify. It enables applications to use Spotify's service, without using the official but closed-source libspotify. Additionally, it will provide extra features which are not available in the official library. -Note: librespot only works with Spotify Premium. +_Note: librespot only works with Spotify Premium. This will remain the case for the forseeable future, as we are unlikely to work on implementing the features such as limited skips and adverts that would be required to make librespot compliant with free accounts._ + +## This fork +As the origin by [plietar](https://github.com/plietar/) is no longer actively maintained, this organisation and repository have been set up so that the project may be maintained and upgraded in the future. + +# Documentation +Documentation is currently a work in progress. -# Unmaintained -Unfortunately I am unable to maintain librespot anymore. It should still work, -but issues and Pull requests will be ignored. Feel free to fork it and continue -development there. If a fork gains traction I will happily point to it from the -README. +There is some brief documentation on how the protocol works in the [docs](https://github.com/librespot-org/librespot/tree/master/docs) folder, and more general usage and compilation information is available on the [wiki](https://github.com/librespot-org/librespot/wiki). -## Building -Rust 1.17.0 or later is required to build librespot. +[CONTRIBUTING.md](https://github.com/librespot-org/librespot/blob/master/CONTRIBUTING.md) also contains detailed instructions on setting up a development environment, compilation, and contributing guidelines. -**If you are building librespot on macOS, the homebrew provided rust may fail due to the way in which homebrew installs rust. In this case, uninstall the homebrew version of rust and use [rustup](https://www.rustup.rs/), and librespot should then build.** +If you wish to learn more about how librespot works overall, the best way is to simply read the code, and ask any questions you have in the Gitter chat linked above. -It also requires a C, with portaudio. +# Issues + +If you run into a bug when using librespot, please search the existing issues before opening a new one. Chances are, we've encountered it before, and have provided a resolution. If not, please open a new one, and where possible, include the backtrace librespot generates on crashing, along with anything we can use to reproduce the issue, eg. the Spotify URI of the song that caused the crash. + +# Building +Rust 1.32.0 or later is required to build librespot. + +We recently switched to using [Rodio](https://github.com/tomaka/rodio) for audio playback by default, hene for macOS and Windows, you should just be able to clone and build librespot (with the command below). For linux, you will need to run the additional commands below, depending on your distro. On debian / ubuntu, the following command will install these dependencies : ```shell -sudo apt-get install build-essential portaudio19-dev +sudo apt-get install build-essential libasound2-dev ``` On Fedora systems, the following command will install these dependencies : ```shell -sudo dnf install portaudio-devel make gcc -``` - -On macOS, using homebrew : -```shell -brew install portaudio +sudo dnf install alsa-lib-devel make gcc ``` Once you've cloned this repository you can build *librespot* using `cargo`. @@ -43,69 +55,35 @@ cargo build --release A sample program implementing a headless Spotify Connect receiver is provided. Once you've built *librespot*, run it using : ```shell -target/release/librespot --username USERNAME --cache CACHEDIR --name DEVICENAME +target/release/librespot --name DEVICENAME ``` -## Discovery mode -*librespot* can be run in discovery mode, in which case no password is required at startup. -For that, simply omit the `--username` argument. - -## Audio Backends -*librespot* supports various audio backends. Multiple backends can be enabled at compile time by enabling the -corresponding cargo feature. By default, only PortAudio is enabled. - -A specific backend can selected at runtime using the `--backend` switch. - +The above is a minimal example. Here is a more fully fledged one: ```shell -cargo build --features portaudio-backend -target/release/librespot [...] --backend portaudio +target/release/librespot -n "Librespot" -b 320 -c ./cache --enable-volume-normalisation --initial-volume 75 --device-type avr ``` +The above command will create a receiver named ```Librespot```, with bitrate set to 320kbps, initial volume at 75%, with volume normalisation enabled, and the device displayed in the app as an Audio/Video Receiver. A folder named ```cache``` will be created/used in the current directory, and be used to cache audio data and credentials. -The following backends are currently available : -- ALSA -- PortAudio -- PulseAudio - -## Cross-compiling -A cross compilation environment is provided as a docker image. -Build the image from the root of the project with the following command : - -``` -$ docker build -t librespot-cross -f contrib/Dockerfile . -``` +A full list of runtime options are available [here](https://github.com/librespot-org/librespot/wiki/Options) -The resulting image can be used to build librespot for linux x86_64, armhf (compatible e. g. with Raspberry Pi 2 or 3, but not with Raspberry Pi 1 or Zero) and armel. -The compiled binaries will be located in /tmp/librespot-build - -``` -docker run -v /tmp/librespot-build:/build librespot-cross -``` - -If only one architecture is desired, cargo can be invoked directly with the appropriate options : -```shell -docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --no-default-features --features alsa-backend -docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend -docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features alsa-backend -``` - -Don't forget to set the `with-tremor` feature flag if your target device does not have floating-point capabilities. - -## Development -When developing *librespot*, it is preferable to use Rust nightly, and build it using the following : -```shell -cargo build --no-default-features --features "nightly portaudio-backend" -``` - -This produces better compilation error messages than with the default configuration. +## Contact +Come and hang out on gitter if you need help or want to offer some. +https://gitter.im/librespot-org/spotify-connect-resources ## Disclaimer Using this code to connect to Spotify's API is probably forbidden by them. Use at your own risk. -## Contact -Come and hang out on gitter if you need help or want to offer some. -https://gitter.im/sashahilton00/spotify-connect-resources - ## License Everything in this repository is licensed under the MIT license. +## Related Projects +This is a non exhaustive list of projects that either use or have modified librespot. If you'd like to include yours, submit a PR. + +- [librespot-golang](https://github.com/librespot-org/librespot-golang) - A golang port of librespot. +- [plugin.audio.spotify](https://github.com/marcelveldt/plugin.audio.spotify) - A Kodi plugin for Spotify. +- [raspotify](https://github.com/dtcooper/raspotify) - Spotify Connect client for the Raspberry Pi that Just Works™ +- [Spotifyd](https://github.com/Spotifyd/spotifyd) - A stripped down librespot UNIX daemon. +- [Spotcontrol](https://github.com/badfortrains/spotcontrol) - A golang implementation of a Spotify Connect controller. No playback functionality. +- [librespot-java](https://github.com/devgianlu/librespot-java) - A Java port of librespot. +- [ncspot](https://github.com/hrkfdn/ncspot) - Cross-platform ncurses Spotify client. diff --git a/audio/Cargo.toml b/audio/Cargo.toml index b9e4af81..49902c50 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -7,19 +7,19 @@ authors = ["Paul Lietar "] path = "../core" [dependencies] -bit-set = "0.4.0" -byteorder = "1.0" -futures = "0.1.8" -log = "0.3.5" -num-bigint = "0.1.35" -num-traits = "0.1.36" -rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" } -tempfile = "2.1" -vorbis = "0.1.0" +bit-set = "0.5" +byteorder = "1.3" +futures = "0.1" +lewton = "0.9" +log = "0.4" +num-bigint = "0.2" +num-traits = "0.2" +tempfile = "3.1" +aes-ctr = "0.3" tremor = { git = "https://github.com/plietar/rust-tremor", optional = true } -lewton = { version = "0.6.2", optional = true } +vorbis = { version ="0.1.0", optional = true } [features] with-tremor = ["tremor"] -with-lewton = ["lewton"] +with-vorbis = ["vorbis"] diff --git a/audio/src/decrypt.rs b/audio/src/decrypt.rs index b745c4e0..b64457e7 100644 --- a/audio/src/decrypt.rs +++ b/audio/src/decrypt.rs @@ -1,38 +1,38 @@ -use crypto::aes; -use crypto::symmetriccipher::SynchronousStreamCipher; -use num_bigint::BigUint; -use num_traits::FromPrimitive; use std::io; -use std::ops::Add; + +use aes_ctr::Aes128Ctr; +use aes_ctr::stream_cipher::{ + NewStreamCipher, SyncStreamCipher, SyncStreamCipherSeek +}; +use aes_ctr::stream_cipher::generic_array::GenericArray; use core::audio_key::AudioKey; -const AUDIO_AESIV: &'static [u8] = &[0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8, - 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93]; +const AUDIO_AESIV: [u8; 16] = [ + 0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, + 0xeb, 0xe8, 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93, +]; pub struct AudioDecrypt { - cipher: Box, - key: AudioKey, + cipher: Aes128Ctr, reader: T, } impl AudioDecrypt { pub fn new(key: AudioKey, reader: T) -> AudioDecrypt { - let cipher = aes::ctr(aes::KeySize::KeySize128, &key.0, AUDIO_AESIV); - AudioDecrypt { - cipher: cipher, - key: key, - reader: reader, - } + let cipher = Aes128Ctr::new( + &GenericArray::from_slice(&key.0), + &GenericArray::from_slice(&AUDIO_AESIV), + ); + AudioDecrypt { cipher, reader } } } impl io::Read for AudioDecrypt { fn read(&mut self, output: &mut [u8]) -> io::Result { - let mut buffer = vec![0u8; output.len()]; - let len = try!(self.reader.read(&mut buffer)); + let len = try!(self.reader.read(output)); - self.cipher.process(&buffer[..len], &mut output[..len]); + self.cipher.apply_keystream(&mut output[..len]); Ok(len) } @@ -41,17 +41,9 @@ impl io::Read for AudioDecrypt { impl io::Seek for AudioDecrypt { fn seek(&mut self, pos: io::SeekFrom) -> io::Result { let newpos = try!(self.reader.seek(pos)); - let skip = newpos % 16; - - let iv = BigUint::from_bytes_be(AUDIO_AESIV) - .add(BigUint::from_u64(newpos / 16).unwrap()) - .to_bytes_be(); - self.cipher = aes::ctr(aes::KeySize::KeySize128, &self.key.0, &iv); - let buf = vec![0u8; skip as usize]; - let mut buf2 = vec![0u8; skip as usize]; - self.cipher.process(&buf, &mut buf2); + self.cipher.seek(newpos); - Ok(newpos as u64) + Ok(newpos) } } diff --git a/audio/src/fetch.rs b/audio/src/fetch.rs index df5eeef7..b9427627 100644 --- a/audio/src/fetch.rs +++ b/audio/src/fetch.rs @@ -1,17 +1,17 @@ use bit_set::BitSet; -use byteorder::{ByteOrder, BigEndian, WriteBytesExt}; +use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; +use futures::sync::{mpsc, oneshot}; use futures::Stream; -use futures::sync::{oneshot, mpsc}; -use futures::{Poll, Async, Future}; +use futures::{Async, Future, Poll}; use std::cmp::min; use std::fs; -use std::io::{self, Read, Write, Seek, SeekFrom}; +use std::io::{self, Read, Seek, SeekFrom, Write}; use std::sync::{Arc, Condvar, Mutex}; use tempfile::NamedTempFile; use core::channel::{Channel, ChannelData, ChannelError, ChannelHeaders}; use core::session::Session; -use core::util::FileId; +use core::spotify_id::FileId; const CHUNK_SIZE: usize = 0x20000; @@ -61,7 +61,7 @@ impl AudioFileOpenStreaming { }); let mut write_file = NamedTempFile::new().unwrap(); - write_file.set_len(size as u64).unwrap(); + write_file.as_file().set_len(size as u64).unwrap(); write_file.seek(SeekFrom::Start(0)).unwrap(); let read_file = write_file.reopen().unwrap(); @@ -71,7 +71,12 @@ impl AudioFileOpenStreaming { let (seek_tx, seek_rx) = mpsc::unbounded(); let fetcher = AudioFileFetch::new( - self.session.clone(), shared.clone(), data_rx, write_file, seek_rx, complete_tx + self.session.clone(), + shared.clone(), + data_rx, + write_file, + seek_rx, + complete_tx, ); self.session.spawn(move |_| fetcher); @@ -97,7 +102,7 @@ impl Future for AudioFileOpen { Ok(Async::Ready(AudioFile::Streaming(file))) } AudioFileOpen::Cached(ref mut file) => { - let file = file.take().unwrap(); + let file = file.take().expect("cached file taken"); Ok(Async::Ready(AudioFile::Cached(file))) } } @@ -110,12 +115,12 @@ impl Future for AudioFileOpenStreaming { fn poll(&mut self) -> Poll { loop { - let (id, data) = try_ready!(self.headers.poll()).unwrap(); + let (id, data) = try_ready!(self.headers.poll()).expect("headers from audio file streaming"); if id == 0x3 { let size = BigEndian::read_u32(&data) as usize * 4; let file = self.finish(size); - + return Ok(Async::Ready(file)); } } @@ -148,14 +153,16 @@ impl AudioFile { let session_ = session.clone(); session.spawn(move |_| { - complete_rx.map(move |mut file| { - if let Some(cache) = session_.cache() { - cache.save_file(file_id, &mut file); - debug!("File {} complete, saving to cache", file_id); - } else { - debug!("File {} complete", file_id); - } - }).or_else(|oneshot::Canceled| Ok(())) + complete_rx + .map(move |mut file| { + if let Some(cache) = session_.cache() { + cache.save_file(file_id, &mut file); + debug!("File {} complete, saving to cache", file_id); + } else { + debug!("File {} complete", file_id); + } + }) + .or_else(|oneshot::Canceled| Ok(())) }); AudioFileOpen::Streaming(open) @@ -171,16 +178,16 @@ fn request_chunk(session: &Session, file: FileId, index: usize) -> Channel { let (id, channel) = session.channel().allocate(); let mut data: Vec = Vec::new(); - data.write_u16::(id).unwrap(); - data.write_u8(0).unwrap(); - data.write_u8(1).unwrap(); - data.write_u16::(0x0000).unwrap(); - data.write_u32::(0x00000000).unwrap(); - data.write_u32::(0x00009C40).unwrap(); - data.write_u32::(0x00020000).unwrap(); - data.write(&file.0).unwrap(); - data.write_u32::(start).unwrap(); - data.write_u32::(end).unwrap(); + data.write_u16::(id).expect("writing data"); + data.write_u8(0).expect("writing data"); + data.write_u8(1).expect("writing data"); + data.write_u16::(0x0000).expect("writing data"); + data.write_u32::(0x00000000).expect("writing data"); + data.write_u32::(0x00009C40).expect("writing data"); + data.write_u32::(0x00020000).expect("writing data"); + data.write(&file.0).expect("writing data"); + data.write_u32::(start).expect("writing data"); + data.write_u32::(end).expect("writing data"); session.send_packet(0x8, data); @@ -200,11 +207,14 @@ struct AudioFileFetch { } impl AudioFileFetch { - fn new(session: Session, shared: Arc, - data_rx: ChannelData, output: NamedTempFile, - seek_rx: mpsc::UnboundedReceiver, - complete_tx: oneshot::Sender) -> AudioFileFetch - { + fn new( + session: Session, + shared: Arc, + data_rx: ChannelData, + output: NamedTempFile, + seek_rx: mpsc::UnboundedReceiver, + complete_tx: oneshot::Sender, + ) -> AudioFileFetch { AudioFileFetch { session: session, shared: shared, @@ -222,7 +232,7 @@ impl AudioFileFetch { assert!(new_index < self.shared.chunk_count); { - let bitmap = self.shared.bitmap.lock().unwrap(); + let bitmap = self.shared.bitmap.lock().expect("lock shared bitmap"); while bitmap.contains(new_index) { new_index = (new_index + 1) % self.shared.chunk_count; } @@ -233,8 +243,11 @@ impl AudioFileFetch { let offset = self.index * CHUNK_SIZE; - self.output.as_mut().unwrap() - .seek(SeekFrom::Start(offset as u64)).unwrap(); + self.output + .as_mut() + .unwrap() + .seek(SeekFrom::Start(offset as u64)) + .unwrap(); let (_headers, data) = request_chunk(&self.session, self.shared.file_id, self.index).split(); self.data_rx = data; @@ -242,10 +255,10 @@ impl AudioFileFetch { } fn finish(&mut self) { - let mut output = self.output.take().unwrap(); - let complete_tx = self.complete_tx.take().unwrap(); + let mut output = self.output.take().expect("output taken"); + let complete_tx = self.complete_tx.take().expect("complete tx taken"); - output.seek(SeekFrom::Start(0)).unwrap(); + output.seek(SeekFrom::Start(0)).expect("output seek start"); let _ = complete_tx.send(output); } } @@ -275,16 +288,15 @@ impl Future for AudioFileFetch { Ok(Async::Ready(Some(data))) => { progress = true; - self.output.as_mut().unwrap() - .write_all(data.as_ref()).unwrap(); + self.output.as_mut().unwrap().write_all(data.as_ref()).unwrap(); } - Ok(Async::Ready(None)) => { + Ok(Async::Ready(None)) => { progress = true; trace!("chunk {} / {} complete", self.index, self.shared.chunk_count); let full = { - let mut bitmap = self.shared.bitmap.lock().unwrap(); + let mut bitmap = self.shared.bitmap.lock().expect("shared bitmap locked"); bitmap.insert(self.index as usize); self.shared.cond.notify_all(); @@ -303,7 +315,7 @@ impl Future for AudioFileFetch { Err(ChannelError) => { warn!("error from channel"); return Ok(Async::Ready(())); - }, + } } if !progress { @@ -319,9 +331,9 @@ impl Read for AudioFileStreaming { let offset = self.position as usize % CHUNK_SIZE; let len = min(output.len(), CHUNK_SIZE - offset); - let mut bitmap = self.shared.bitmap.lock().unwrap(); + let mut bitmap = self.shared.bitmap.lock().expect("shared bitmap locked"); while !bitmap.contains(index) { - bitmap = self.shared.cond.wait(bitmap).unwrap(); + bitmap = self.shared.cond.wait(bitmap).expect("shared cond wait"); } drop(bitmap); @@ -336,11 +348,16 @@ impl Read for AudioFileStreaming { impl Seek for AudioFileStreaming { fn seek(&mut self, pos: SeekFrom) -> io::Result { self.position = try!(self.read_file.seek(pos)); + // Do not seek past EOF + if (self.position as usize % CHUNK_SIZE) != 0 { + // Notify the fetch thread to get the correct block + // This can fail if fetch thread has completed, in which case the + // block is ready. Just ignore the error. + let _ = self.seek.unbounded_send(self.position); + } else { + warn!("Trying to seek past EOF"); + } - // Notify the fetch thread to get the correct block - // This can fail if fetch thread has completed, in which case the - // block is ready. Just ignore the error. - let _ = self.seek.send(self.position); Ok(self.position) } } diff --git a/audio/src/lewton_decoder.rs b/audio/src/lewton_decoder.rs index cff734f9..912d1c27 100644 --- a/audio/src/lewton_decoder.rs +++ b/audio/src/lewton_decoder.rs @@ -2,16 +2,17 @@ extern crate lewton; use self::lewton::inside_ogg::OggStreamReader; -use std::io::{Read, Seek}; -use std::fmt; use std::error; +use std::fmt; +use std::io::{Read, Seek}; pub struct VorbisDecoder(OggStreamReader); pub struct VorbisPacket(Vec); pub struct VorbisError(lewton::VorbisError); -impl VorbisDecoder - where R: Read + Seek +impl VorbisDecoder +where + R: Read + Seek, { pub fn new(input: R) -> Result, VorbisError> { Ok(VorbisDecoder(OggStreamReader::new(input)?)) @@ -24,14 +25,17 @@ impl VorbisDecoder } pub fn next_packet(&mut self) -> Result, VorbisError> { - use self::lewton::VorbisError::BadAudio; use self::lewton::audio::AudioReadError::AudioIsHeader; + use self::lewton::OggReadError::NoCapturePatternFound; + use self::lewton::VorbisError::BadAudio; + use self::lewton::VorbisError::OggError; loop { match self.0.read_dec_packet_itl() { Ok(Some(packet)) => return Ok(Some(VorbisPacket(packet))), Ok(None) => return Ok(None), Err(BadAudio(AudioIsHeader)) => (), + Err(OggError(NoCapturePatternFound)) => (), Err(err) => return Err(err.into()), } } @@ -71,7 +75,7 @@ impl error::Error for VorbisError { error::Error::description(&self.0) } - fn cause(&self) -> Option<&error::Error> { - error::Error::cause(&self.0) + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + error::Error::source(&self.0) } } diff --git a/audio/src/lib.rs b/audio/src/lib.rs index d0afba62..cd6f28e3 100644 --- a/audio/src/lib.rs +++ b/audio/src/lib.rs @@ -1,27 +1,29 @@ -#[macro_use] extern crate log; -#[macro_use] extern crate futures; +#[macro_use] +extern crate futures; +#[macro_use] +extern crate log; extern crate bit_set; extern crate byteorder; -extern crate crypto; -extern crate num_traits; extern crate num_bigint; +extern crate num_traits; extern crate tempfile; +extern crate aes_ctr; extern crate librespot_core as core; -mod fetch; mod decrypt; +mod fetch; -#[cfg(not(feature = "with-lewton"))] -mod libvorbis_decoder; -#[cfg(feature = "with-lewton")] +#[cfg(not(any(feature = "with-tremor", feature = "with-vorbis")))] mod lewton_decoder; +#[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] +mod libvorbis_decoder; -pub use fetch::{AudioFile, AudioFileOpen}; pub use decrypt::AudioDecrypt; +pub use fetch::{AudioFile, AudioFileOpen}; -#[cfg(not(feature = "with-lewton"))] -pub use libvorbis_decoder::{VorbisDecoder, VorbisPacket, VorbisError}; -#[cfg(feature = "with-lewton")] -pub use lewton_decoder::{VorbisDecoder, VorbisPacket, VorbisError}; +#[cfg(not(any(feature = "with-tremor", feature = "with-vorbis")))] +pub use lewton_decoder::{VorbisDecoder, VorbisError, VorbisPacket}; +#[cfg(any(feature = "with-tremor", feature = "with-vorbis"))] +pub use libvorbis_decoder::{VorbisDecoder, VorbisError, VorbisPacket}; diff --git a/audio/src/libvorbis_decoder.rs b/audio/src/libvorbis_decoder.rs index c88fc44e..b2045393 100644 --- a/audio/src/libvorbis_decoder.rs +++ b/audio/src/libvorbis_decoder.rs @@ -1,16 +1,19 @@ -#[cfg(not(feature = "with-tremor"))] extern crate vorbis; -#[cfg(feature = "with-tremor")] extern crate tremor as vorbis; +#[cfg(feature = "with-tremor")] +extern crate tremor as vorbis; +#[cfg(not(feature = "with-tremor"))] +extern crate vorbis; -use std::io::{Read, Seek}; -use std::fmt; use std::error; +use std::fmt; +use std::io::{Read, Seek}; pub struct VorbisDecoder(vorbis::Decoder); pub struct VorbisPacket(vorbis::Packet); pub struct VorbisError(vorbis::VorbisError); -impl VorbisDecoder - where R: Read + Seek +impl VorbisDecoder +where + R: Read + Seek, { pub fn new(input: R) -> Result, VorbisError> { Ok(VorbisDecoder(vorbis::Decoder::new(input)?)) diff --git a/build.rs b/build.rs deleted file mode 100644 index 033187ec..00000000 --- a/build.rs +++ /dev/null @@ -1,14 +0,0 @@ -extern crate protobuf_macros; - -use std::env; -use std::path::PathBuf; - -fn main() { - let out = PathBuf::from(env::var("OUT_DIR").unwrap()); - - protobuf_macros::expand("src/lib.in.rs", &out.join("lib.rs")).unwrap(); - - println!("cargo:rerun-if-changed=src/lib.in.rs"); - println!("cargo:rerun-if-changed=src/spirc.rs"); - -} diff --git a/cargo-config.toml b/cargo-config.toml new file mode 100644 index 00000000..a370df8c --- /dev/null +++ b/cargo-config.toml @@ -0,0 +1,12 @@ + +[target.aarch64-linux-android] +ar = "/home/mat/Android/Sdk/ndk-standalone-aarch64/bin/aarch64-linux-android-ar" +linker = "/home/mat/Android/Sdk/ndk-standalone-aarch64/bin/aarch64-linux-android-clang" + +[target.armv7-linux-androideabi] +ar = "/home/mat/Android/Sdk/ndk-standalone-arm/bin/arm-linux-androideabi-ar" +linker = "/home/mat/Android/Sdk/ndk-standalone-arm/bin/arm-linux-androideabi-clang" + +[target.i686-linux-android] +ar = "/home/mat/Android/Sdk/ndk-standalone-x86/bin/i686-linux-android-ar" +linker = "/home/mat/Android/Sdk/ndk-standalone-x86/bin/i686-linux-android-clang" diff --git a/compile-arm.sh b/compile-arm.sh new file mode 100755 index 00000000..d5f03965 --- /dev/null +++ b/compile-arm.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +#export ANDROID_HOME=/Users/$USER/Library/Android/sdk +#export NDK_HOME=$ANDROID_HOME/ndk-bundle + +#ndk-bundle/build/tools/make_standalone_toolchain.py --api 21 --arch arm64 --install-dir ndk-standalone-aarch64 + +export TARGET_AR=/home/mat/Android/Sdk/ndk-standalone-arm/bin/arm-linux-androideabi-ar +export TARGET_CC=/home/mat/Android/Sdk/ndk-standalone-arm/bin/arm-linux-androideabi-clang + +cargo build --target=arm-linux-androideabi --release diff --git a/compile-x86.sh b/compile-x86.sh new file mode 100755 index 00000000..2c435cc2 --- /dev/null +++ b/compile-x86.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +#export ANDROID_HOME=/Users/$USER/Library/Android/sdk +#export NDK_HOME=$ANDROID_HOME/ndk-bundle + +#ndk-bundle/build/tools/make_standalone_toolchain.py --api 21 --arch arm64 --install-dir ndk-standalone-aarch64 + +export TARGET_AR=/home/mat/Android/Sdk/ndk-standalone-x86/bin/i686-linux-android-ar +export TARGET_CC=/home/mat/Android/Sdk/ndk-standalone-x86/bin/i686-linux-android-clang + +cargo build --target=i686-linux-android --release diff --git a/connect/Cargo.toml b/connect/Cargo.toml new file mode 100644 index 00000000..4147b0d9 --- /dev/null +++ b/connect/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "librespot-connect" +version = "0.1.0" +authors = ["Paul Lietar "] + +[dependencies.librespot-core] +path = "../core" +[dependencies.librespot-playback] +path = "../playback" +[dependencies.librespot-protocol] +path = "../protocol" + +[dependencies] +base64 = "0.10" +futures = "0.1" +hyper = "0.11" +log = "0.4" +num-bigint = "0.2" +protobuf = "2.8.*" +rand = "0.7" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +tokio-core = "0.1" +url = "1.7" +sha-1 = "0.8" +hmac = "0.7" +aes-ctr = "0.3" +block-modes = "0.3" + +dns-sd = { version = "0.1.3", optional = true } +mdns = { git = "https://github.com/plietar/rust-mdns", optional = true } + +[features] +default = [] +with-dns-sd = ["dns-sd"] diff --git a/connect/src/context.rs b/connect/src/context.rs new file mode 100644 index 00000000..c102d4ba --- /dev/null +++ b/connect/src/context.rs @@ -0,0 +1,86 @@ +use core::spotify_id::SpotifyId; +use protocol::spirc::TrackRef; + +use serde; + +#[derive(Deserialize, Debug)] +pub struct StationContext { + pub uri: Option, + pub next_page_url: String, + #[serde(deserialize_with = "deserialize_protobuf_TrackRef")] + pub tracks: Vec, + // Not required for core functionality + // pub seeds: Vec, + // #[serde(rename = "imageUri")] + // pub image_uri: String, + // pub subtitle: Option, + // pub subtitles: Vec, + // #[serde(rename = "subtitleUri")] + // pub subtitle_uri: Option, + // pub title: String, + // #[serde(rename = "titleUri")] + // pub title_uri: String, + // pub related_artists: Vec, +} + +#[derive(Deserialize, Debug)] +pub struct PageContext { + pub uri: String, + pub next_page_url: String, + #[serde(deserialize_with = "deserialize_protobuf_TrackRef")] + pub tracks: Vec, + // Not required for core functionality + // pub url: String, + // // pub restrictions: +} + +#[derive(Deserialize, Debug)] +pub struct TrackContext { + #[serde(rename = "original_gid")] + pub gid: String, + pub uri: String, + pub uid: String, + // Not required for core functionality + // pub album_uri: String, + // pub artist_uri: String, + // pub metadata: MetadataContext, +} + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct ArtistContext { + artist_name: String, + artist_uri: String, + image_uri: String, +} + +#[derive(Deserialize, Debug)] +pub struct MetadataContext { + album_title: String, + artist_name: String, + artist_uri: String, + image_url: String, + title: String, + uid: String, +} + +#[allow(non_snake_case)] +fn deserialize_protobuf_TrackRef<'d, D>(de: D) -> Result, D::Error> +where + D: serde::Deserializer<'d>, +{ + let v: Vec = try!(serde::Deserialize::deserialize(de)); + let track_vec = v + .iter() + .map(|v| { + let mut t = TrackRef::new(); + // This has got to be the most round about way of doing this. + t.set_gid(SpotifyId::from_base62(&v.gid).unwrap().to_raw().to_vec()); + t.set_uri(v.uri.to_owned()); + + t + }) + .collect::>(); + + Ok(track_vec) +} diff --git a/connect/src/lib.rs b/connect/src/lib.rs new file mode 100644 index 00000000..5b8fc3c7 --- /dev/null +++ b/connect/src/lib.rs @@ -0,0 +1,31 @@ +#[macro_use] +extern crate log; +#[macro_use] +extern crate serde_json; +#[macro_use] +extern crate serde_derive; +extern crate serde; + +extern crate base64; +extern crate futures; +extern crate hyper; +extern crate num_bigint; +extern crate protobuf; +extern crate rand; +extern crate tokio_core; +extern crate url; + +extern crate sha1; +extern crate hmac; +extern crate aes_ctr; +extern crate block_modes; + +#[cfg(feature = "with-dns-sd")] +extern crate dns_sd; + +extern crate librespot_core as core; +extern crate librespot_playback as playback; +extern crate librespot_protocol as protocol; + +pub mod context; +pub mod spirc; diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs new file mode 100644 index 00000000..6c6504db --- /dev/null +++ b/connect/src/spirc.rs @@ -0,0 +1,912 @@ +use std; +use std::time::{SystemTime, UNIX_EPOCH}; + +use futures::future; +use futures::sync::{mpsc, oneshot}; +use futures::{Async, Future, Poll, Sink, Stream}; +use protobuf::{self, Message}; +use rand; +use rand::seq::SliceRandom; +use serde_json; + +use context::StationContext; +use core::config::ConnectConfig; +use core::mercury::MercuryError; +use core::session::Session; +use core::spotify_id::SpotifyId; +use core::util::SeqGenerator; +use core::version; +use core::volume::Volume; +use playback::mixer::Mixer; +use playback::player::Player; +use protocol; +use protocol::spirc::{DeviceState, Frame, MessageType, PlayStatus, State}; + +pub struct SpircTask { + player: Player, + mixer: Box, + linear_volume: bool, + + sequence: SeqGenerator, + + ident: String, + device: DeviceState, + state: State, + + subscription: Box>, + sender: Box>, + commands: mpsc::UnboundedReceiver, + end_of_track: Box>, + + shutdown: bool, + session: Session, + context_fut: Box>, + context: Option, +} + +pub enum SpircCommand { + Play, + PlayPause, + Pause, + Prev, + Next, + VolumeUp, + VolumeDown, + Shutdown, +} + +const CONTEXT_TRACKS_HISTORY: usize = 10; +const CONTEXT_FETCH_THRESHOLD: u32 = 5; + +pub struct Spirc { + commands: mpsc::UnboundedSender, +} + +fn initial_state() -> State { + let mut frame = protocol::spirc::State::new(); + frame.set_repeat(false); + frame.set_shuffle(false); + frame.set_status(PlayStatus::kPlayStatusStop); + frame.set_position_ms(0); + frame.set_position_measured_at(0); + frame +} + +fn initial_device_state(config: ConnectConfig) -> DeviceState { + { + let mut msg = DeviceState::new(); + msg.set_sw_version(version::version_string()); + msg.set_is_active(false); + msg.set_can_play(true); + msg.set_volume(0); + msg.set_name(config.name); + { + let repeated = msg.mut_capabilities(); + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kCanBePlayer); + { + let repeated = msg.mut_intValue(); + repeated.push(1) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kDeviceType); + { + let repeated = msg.mut_intValue(); + repeated.push(config.device_type as i64) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kGaiaEqConnectId); + { + let repeated = msg.mut_intValue(); + repeated.push(1) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kSupportsLogout); + { + let repeated = msg.mut_intValue(); + repeated.push(0) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kIsObservable); + { + let repeated = msg.mut_intValue(); + repeated.push(1) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kVolumeSteps); + { + let repeated = msg.mut_intValue(); + repeated.push(64) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kSupportsPlaylistV2); + { + let repeated = msg.mut_intValue(); + repeated.push(64) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kSupportedContexts); + { + let repeated = msg.mut_stringValue(); + repeated.push(::std::convert::Into::into("album")); + repeated.push(::std::convert::Into::into("playlist")); + repeated.push(::std::convert::Into::into("search")); + repeated.push(::std::convert::Into::into("inbox")); + repeated.push(::std::convert::Into::into("toplist")); + repeated.push(::std::convert::Into::into("starred")); + repeated.push(::std::convert::Into::into("publishedstarred")); + repeated.push(::std::convert::Into::into("track")) + }; + msg + }; + { + let msg = repeated.push_default(); + msg.set_typ(protocol::spirc::CapabilityType::kSupportedTypes); + { + let repeated = msg.mut_stringValue(); + repeated.push(::std::convert::Into::into("audio/local")); + repeated.push(::std::convert::Into::into("audio/track")); + repeated.push(::std::convert::Into::into("local")); + repeated.push(::std::convert::Into::into("track")) + }; + msg + }; + }; + msg + } +} + +fn calc_logarithmic_volume(volume: u16) -> u16 { + // Volume conversion taken from https://www.dr-lex.be/info-stuff/volumecontrols.html#ideal2 + // Convert the given volume [0..0xffff] to a dB gain + // We assume a dB range of 60dB. + // Use the equation: a * exp(b * x) + // in which a = IDEAL_FACTOR, b = 1/1000 + const IDEAL_FACTOR: f64 = 6.908; + let normalized_volume = volume as f64 / std::u16::MAX as f64; // To get a value between 0 and 1 + + let mut val = std::u16::MAX; + // Prevent val > std::u16::MAX due to rounding errors + if normalized_volume < 0.999 { + let new_volume = (normalized_volume * IDEAL_FACTOR).exp() / 1000.0; + val = (new_volume * std::u16::MAX as f64) as u16; + } + + debug!("input volume:{} to mixer: {}", volume, val); + + // return the scale factor (0..0xffff) (equivalent to a voltage multiplier). + val +} + +fn volume_to_mixer(volume: u16, linear_volume: bool) -> u16 { + if linear_volume { + debug!("linear volume: {}", volume); + volume + } else { + calc_logarithmic_volume(volume) + } +} + +impl Spirc { + pub fn new( + config: ConnectConfig, + session: Session, + player: Player, + mixer: Box, + ) -> (Spirc, SpircTask) { + debug!("new Spirc[{}]", session.session_id()); + + let ident = session.device_id().to_owned(); + + // Uri updated in response to issue #288 + let uri = format!("hm://remote/user/{}/", session.username()); + + let subscription = session.mercury().subscribe(&uri as &str); + let subscription = subscription + .map(|stream| stream.map_err(|_| MercuryError)) + .flatten_stream(); + let subscription = Box::new(subscription.map(|response| -> Frame { + let data = response.payload.first().unwrap(); + protobuf::parse_from_bytes(data).unwrap() + })); + + let sender = Box::new( + session + .mercury() + .sender(uri) + .with(|frame: Frame| Ok(frame.write_to_bytes().unwrap())), + ); + + let (cmd_tx, cmd_rx) = mpsc::unbounded(); + + let volume = config.volume; + let linear_volume = config.linear_volume; + + let device = initial_device_state(config); + + let mut task = SpircTask { + player: player, + mixer: mixer, + linear_volume: linear_volume, + + sequence: SeqGenerator::new(1), + + ident: ident, + + device: device, + state: initial_state(), + + subscription: subscription, + sender: sender, + commands: cmd_rx, + end_of_track: Box::new(future::empty()), + + shutdown: false, + session: session.clone(), + + context_fut: Box::new(future::empty()), + context: None, + }; + + task.set_volume(volume); + + let spirc = Spirc { commands: cmd_tx }; + + task.hello(); + + (spirc, task) + } + + pub fn play(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Play); + } + pub fn play_pause(&self) { + let _ = self.commands.unbounded_send(SpircCommand::PlayPause); + } + pub fn pause(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Pause); + } + pub fn prev(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Prev); + } + pub fn next(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Next); + } + pub fn volume_up(&self) { + let _ = self.commands.unbounded_send(SpircCommand::VolumeUp); + } + pub fn volume_down(&self) { + let _ = self.commands.unbounded_send(SpircCommand::VolumeDown); + } + pub fn shutdown(&self) { + let _ = self.commands.unbounded_send(SpircCommand::Shutdown); + } +} + +impl Future for SpircTask { + type Item = (); + type Error = (); + + fn poll(&mut self) -> Poll<(), ()> { + loop { + let mut progress = false; + + if self.session.is_invalid() { + return Ok(Async::Ready(())); + } + + if !self.shutdown { + match self.subscription.poll().unwrap() { + Async::Ready(Some(frame)) => { + progress = true; + self.handle_frame(frame); + } + Async::Ready(None) => panic!("subscription terminated"), + Async::NotReady => (), + } + + match self.commands.poll().unwrap() { + Async::Ready(Some(command)) => { + progress = true; + self.handle_command(command); + } + Async::Ready(None) => (), + Async::NotReady => (), + } + + match self.end_of_track.poll() { + Ok(Async::Ready(())) => { + progress = true; + self.handle_end_of_track(); + } + Ok(Async::NotReady) => (), + Err(oneshot::Canceled) => self.end_of_track = Box::new(future::empty()), + } + + match self.context_fut.poll() { + Ok(Async::Ready(value)) => { + let r_context = serde_json::from_value::(value.clone()); + self.context = match r_context { + Ok(context) => { + info!( + "Resolved {:?} tracks from <{:?}>", + context.tracks.len(), + self.state.get_context_uri(), + ); + Some(context) + } + Err(e) => { + error!("Unable to parse JSONContext {:?}\n{:?}", e, value); + None + } + }; + // It needn't be so verbose - can be as simple as + // if let Some(ref context) = r_context { + // info!("Got {:?} tracks from <{}>", context.tracks.len(), context.uri); + // } + // self.context = r_context; + + progress = true; + self.context_fut = Box::new(future::empty()); + } + Ok(Async::NotReady) => (), + Err(err) => { + self.context_fut = Box::new(future::empty()); + error!("ContextError: {:?}", err) + } + } + } + + let poll_sender = self.sender.poll_complete().unwrap(); + + // Only shutdown once we've flushed out all our messages + if self.shutdown && poll_sender.is_ready() { + return Ok(Async::Ready(())); + } + + if !progress { + return Ok(Async::NotReady); + } + } + } +} + +impl SpircTask { + fn now_ms(&mut self) -> i64 { + let dur = match SystemTime::now().duration_since(UNIX_EPOCH) { + Ok(dur) => dur, + Err(err) => err.duration(), + }; + ((dur.as_secs() as i64 + self.session.time_delta()) * 1000 + + (dur.subsec_nanos() / 1000_000) as i64) + } + + fn handle_command(&mut self, cmd: SpircCommand) { + let active = self.device.get_is_active(); + match cmd { + SpircCommand::Play => { + if active { + self.handle_play(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypePlay).send(); + } + } + SpircCommand::PlayPause => { + if active { + self.handle_play_pause(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypePlayPause).send(); + } + } + SpircCommand::Pause => { + if active { + self.handle_pause(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypePause).send(); + } + } + SpircCommand::Prev => { + if active { + self.handle_prev(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypePrev).send(); + } + } + SpircCommand::Next => { + if active { + self.handle_next(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypeNext).send(); + } + } + SpircCommand::VolumeUp => { + if active { + self.handle_volume_up(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypeVolumeUp).send(); + } + } + SpircCommand::VolumeDown => { + if active { + self.handle_volume_down(); + self.notify(None); + } else { + CommandSender::new(self, MessageType::kMessageTypeVolumeDown).send(); + } + } + SpircCommand::Shutdown => { + CommandSender::new(self, MessageType::kMessageTypeGoodbye).send(); + self.shutdown = true; + self.commands.close(); + } + } + } + + fn handle_frame(&mut self, frame: Frame) { + debug!( + "{:?} {:?} {} {} {}", + frame.get_typ(), + frame.get_device_state().get_name(), + frame.get_ident(), + frame.get_seq_nr(), + frame.get_state_update_id() + ); + + if frame.get_ident() == self.ident + || (frame.get_recipient().len() > 0 && !frame.get_recipient().contains(&self.ident)) + { + return; + } + + match frame.get_typ() { + MessageType::kMessageTypeHello => { + self.notify(Some(frame.get_ident())); + } + + MessageType::kMessageTypeLoad => { + if !self.device.get_is_active() { + let now = self.now_ms(); + self.device.set_is_active(true); + self.device.set_became_active_at(now); + } + + self.update_tracks(&frame); + + if self.state.get_track().len() > 0 { + let now = self.now_ms(); + self.state.set_position_ms(frame.get_state().get_position_ms()); + self.state.set_position_measured_at(now as u64); + + let play = frame.get_state().get_status() == PlayStatus::kPlayStatusPlay; + self.load_track(play); + } else { + info!("No more tracks left in queue"); + self.state.set_status(PlayStatus::kPlayStatusStop); + } + + self.notify(None); + } + + MessageType::kMessageTypePlay => { + self.handle_play(); + self.notify(None); + } + + MessageType::kMessageTypePlayPause => { + self.handle_play_pause(); + self.notify(None); + } + + MessageType::kMessageTypePause => { + self.handle_pause(); + self.notify(None); + } + + MessageType::kMessageTypeNext => { + self.handle_next(); + self.notify(None); + } + + MessageType::kMessageTypePrev => { + self.handle_prev(); + self.notify(None); + } + + MessageType::kMessageTypeVolumeUp => { + self.handle_volume_up(); + self.notify(None); + } + + MessageType::kMessageTypeVolumeDown => { + self.handle_volume_down(); + self.notify(None); + } + + MessageType::kMessageTypeRepeat => { + self.state.set_repeat(frame.get_state().get_repeat()); + self.notify(None); + } + + MessageType::kMessageTypeShuffle => { + self.state.set_shuffle(frame.get_state().get_shuffle()); + if self.state.get_shuffle() { + let current_index = self.state.get_playing_track_index(); + { + let tracks = self.state.mut_track(); + tracks.swap(0, current_index as usize); + if let Some((_, rest)) = tracks.split_first_mut() { + let mut rng = rand::thread_rng(); + rest.shuffle(&mut rng); + } + } + self.state.set_playing_track_index(0); + } else { + let context = self.state.get_context_uri(); + debug!("{:?}", context); + } + self.notify(None); + } + + MessageType::kMessageTypeSeek => { + let position = frame.get_position(); + + let now = self.now_ms(); + self.state.set_position_ms(position); + self.state.set_position_measured_at(now as u64); + self.player.seek(position); + self.notify(None); + } + + MessageType::kMessageTypeReplace => { + self.update_tracks(&frame); + self.notify(None); + } + + MessageType::kMessageTypeVolume => { + self.set_volume(frame.get_volume() as u16); + self.notify(None); + } + + MessageType::kMessageTypeNotify => { + if self.device.get_is_active() && frame.get_device_state().get_is_active() { + self.device.set_is_active(false); + self.state.set_status(PlayStatus::kPlayStatusStop); + self.player.stop(); + self.mixer.stop(); + } + } + + _ => (), + } + } + + fn handle_play(&mut self) { + if self.state.get_status() == PlayStatus::kPlayStatusPause { + self.mixer.start(); + self.player.play(); + self.state.set_status(PlayStatus::kPlayStatusPlay); + let now = self.now_ms(); + self.state.set_position_measured_at(now as u64); + } + } + + fn handle_play_pause(&mut self) { + match self.state.get_status() { + PlayStatus::kPlayStatusPlay => self.handle_pause(), + PlayStatus::kPlayStatusPause => self.handle_play(), + _ => (), + } + } + + fn handle_pause(&mut self) { + if self.state.get_status() == PlayStatus::kPlayStatusPlay { + self.player.pause(); + self.mixer.stop(); + self.state.set_status(PlayStatus::kPlayStatusPause); + + let now = self.now_ms() as u64; + let position = self.state.get_position_ms(); + + let diff = now - self.state.get_position_measured_at(); + + self.state.set_position_ms(position + diff as u32); + self.state.set_position_measured_at(now); + } + } + + fn consume_queued_track(&mut self) -> usize { + // Removes current track if it is queued + // Returns the index of the next track + let current_index = self.state.get_playing_track_index() as usize; + if self.state.get_track()[current_index].get_queued() { + self.state.mut_track().remove(current_index); + return current_index; + } + current_index + 1 + } + + fn handle_next(&mut self) { + let mut new_index = self.consume_queued_track() as u32; + let mut continue_playing = true; + debug!( + "At track {:?} of {:?} <{:?}> update [{}]", + new_index, + self.state.get_track().len(), + self.state.get_context_uri(), + self.state.get_track().len() as u32 - new_index < CONTEXT_FETCH_THRESHOLD + ); + let context_uri = self.state.get_context_uri().to_owned(); + if (context_uri.starts_with("spotify:station:") || context_uri.starts_with("spotify:dailymix:")) + && ((self.state.get_track().len() as u32) - new_index) < CONTEXT_FETCH_THRESHOLD + { + self.context_fut = self.resolve_station(&context_uri); + self.update_tracks_from_context(); + } + + if new_index >= self.state.get_track().len() as u32 { + new_index = 0; // Loop around back to start + continue_playing = self.state.get_repeat(); + } + self.state.set_playing_track_index(new_index); + self.state.set_position_ms(0); + let now = self.now_ms(); + self.state.set_position_measured_at(now as u64); + + self.load_track(continue_playing); + } + + fn handle_prev(&mut self) { + // Previous behaves differently based on the position + // Under 3s it goes to the previous song (starts playing) + // Over 3s it seeks to zero (retains previous play status) + if self.position() < 3000 { + // Queued tracks always follow the currently playing track. + // They should not be considered when calculating the previous + // track so extract them beforehand and reinsert them after it. + let mut queue_tracks = Vec::new(); + { + let queue_index = self.consume_queued_track(); + let tracks = self.state.mut_track(); + while queue_index < tracks.len() && tracks[queue_index].get_queued() { + queue_tracks.push(tracks.remove(queue_index)); + } + } + let current_index = self.state.get_playing_track_index(); + let new_index = if current_index > 0 { + current_index - 1 + } else if self.state.get_repeat() { + self.state.get_track().len() as u32 - 1 + } else { + 0 + }; + // Reinsert queued tracks after the new playing track. + let mut pos = (new_index + 1) as usize; + for track in queue_tracks.into_iter() { + self.state.mut_track().insert(pos, track); + pos += 1; + } + + let now = self.now_ms(); + self.state.set_playing_track_index(new_index); + self.state.set_position_ms(0); + self.state.set_position_measured_at(now as u64); + + self.load_track(true); + } else { + let now = self.now_ms(); + self.state.set_position_ms(0); + self.state.set_position_measured_at(now as u64); + self.player.seek(0); + } + } + + fn handle_volume_up(&mut self) { + let mut volume: u32 = self.device.get_volume() as u32 + 4096; + if volume > 0xFFFF { + volume = 0xFFFF; + } + self.set_volume(volume as u16); + } + + fn handle_volume_down(&mut self) { + let mut volume: i32 = self.device.get_volume() as i32 - 4096; + if volume < 0 { + volume = 0; + } + self.set_volume(volume as u16); + } + + fn handle_end_of_track(&mut self) { + self.handle_next(); + self.notify(None); + } + + fn position(&mut self) -> u32 { + let diff = self.now_ms() as u64 - self.state.get_position_measured_at(); + self.state.get_position_ms() + diff as u32 + } + + fn resolve_station(&self, uri: &str) -> Box> { + let radio_uri = format!("hm://radio-apollo/v3/stations/{}", uri); + + self.resolve_uri(&radio_uri) + } + + fn resolve_uri(&self, uri: &str) -> Box> { + let request = self.session.mercury().get(uri); + + Box::new(request.and_then(move |response| { + let data = response.payload.first().expect("Empty payload on context uri"); + let response: serde_json::Value = serde_json::from_slice(&data).unwrap(); + + Ok(response) + })) + } + + fn update_tracks_from_context(&mut self) { + if let Some(ref context) = self.context { + self.context_fut = self.resolve_uri(&context.next_page_url); + + let new_tracks = &context.tracks; + debug!("Adding {:?} tracks from context to frame", new_tracks.len()); + let mut track_vec = self.state.take_track().into_vec(); + if let Some(head) = track_vec.len().checked_sub(CONTEXT_TRACKS_HISTORY) { + track_vec.drain(0..head); + } + track_vec.extend_from_slice(&new_tracks); + self.state.set_track(protobuf::RepeatedField::from_vec(track_vec)); + + // Update playing index + if let Some(new_index) = self + .state + .get_playing_track_index() + .checked_sub(CONTEXT_TRACKS_HISTORY as u32) + { + self.state.set_playing_track_index(new_index); + } + } + } + + fn update_tracks(&mut self, frame: &protocol::spirc::Frame) { + let index = frame.get_state().get_playing_track_index(); + let context_uri = frame.get_state().get_context_uri().to_owned(); + let tracks = frame.get_state().get_track(); + debug!("Frame has {:?} tracks", tracks.len()); + if context_uri.starts_with("spotify:station:") || context_uri.starts_with("spotify:dailymix:") { + self.context_fut = self.resolve_station(&context_uri); + } + + self.state.set_playing_track_index(index); + self.state.set_track(tracks.into_iter().cloned().collect()); + self.state.set_context_uri(context_uri); + self.state.set_repeat(frame.get_state().get_repeat()); + self.state.set_shuffle(frame.get_state().get_shuffle()); + } + + fn load_track(&mut self, play: bool) { + let track = { + let mut index = self.state.get_playing_track_index(); + // Check for malformed gid + let tracks_len = self.state.get_track().len() as u32; + let mut track_ref = &self.state.get_track()[index as usize]; + while track_ref.get_gid().len() != 16 { + warn!( + "Skipping track {:?} at position [{}] of {}", + track_ref.get_uri(), + index, + tracks_len + ); + index = if index + 1 < tracks_len { index + 1 } else { 0 }; + track_ref = &self.state.get_track()[index as usize]; + } + SpotifyId::from_raw(track_ref.get_gid()).unwrap() + }; + + let position = self.state.get_position_ms(); + let end_of_track = self.player.load(track, play, position); + + if play { + self.state.set_status(PlayStatus::kPlayStatusPlay); + } else { + self.state.set_status(PlayStatus::kPlayStatusPause); + } + + self.end_of_track = Box::new(end_of_track); + } + + fn hello(&mut self) { + CommandSender::new(self, MessageType::kMessageTypeHello).send(); + } + + fn notify(&mut self, recipient: Option<&str>) { + let mut cs = CommandSender::new(self, MessageType::kMessageTypeNotify); + if let Some(s) = recipient { + cs = cs.recipient(&s); + } + cs.send(); + } + + fn set_volume(&mut self, volume: u16) { + self.device.set_volume(volume as u32); + self.mixer.set_volume(volume_to_mixer(volume, self.linear_volume)); + if let Some(cache) = self.session.cache() { + cache.save_volume(Volume { volume }) + } + } +} + +impl Drop for SpircTask { + fn drop(&mut self) { + debug!("drop Spirc[{}]", self.session.session_id()); + } +} + +struct CommandSender<'a> { + spirc: &'a mut SpircTask, + frame: protocol::spirc::Frame, +} + +impl<'a> CommandSender<'a> { + fn new(spirc: &'a mut SpircTask, cmd: MessageType) -> CommandSender { + let mut frame = protocol::spirc::Frame::new(); + frame.set_version(1); + frame.set_protocol_version(::std::convert::Into::into("2.0.0")); + frame.set_ident(spirc.ident.clone()); + frame.set_seq_nr(spirc.sequence.get()); + frame.set_typ(cmd); + frame.set_device_state(spirc.device.clone()); + frame.set_state_update_id(spirc.now_ms()); + CommandSender { + spirc: spirc, + frame: frame, + } + } + + fn recipient(mut self, recipient: &'a str) -> CommandSender { + self.frame.mut_recipient().push(recipient.to_owned()); + self + } + + #[allow(dead_code)] + fn state(mut self, state: protocol::spirc::State) -> CommandSender<'a> { + self.frame.set_state(state); + self + } + + fn send(mut self) { + if !self.frame.has_state() && self.spirc.device.get_is_active() { + self.frame.set_state(self.spirc.state.clone()); + } + + let send = self.spirc.sender.start_send(self.frame).unwrap(); + assert!(send.is_ready()); + } +} diff --git a/contrib/Dockerfile b/contrib/Dockerfile index 68a39b72..0fcdafff 100644 --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -2,7 +2,7 @@ # Build the docker image from the root of the project with the following command : # $ docker build -t librespot-cross -f contrib/Dockerfile . # -# The resulting image can be used to build librespot for linux x86_64, armhf and armel. +# The resulting image can be used to build librespot for linux x86_64, armhf(with support for armv6hf), armel, mipsel, aarch64 # $ docker run -v /tmp/librespot-build:/build librespot-cross # # The compiled binaries will be located in /tmp/librespot-build @@ -11,7 +11,7 @@ # $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --no-default-features --features "alsa-backend" # $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend" # $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features "alsa-backend" -# +# $ docker run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.sh FROM debian:stretch @@ -37,7 +37,10 @@ RUN mkdir /.cargo && \ echo '[target.arm-unknown-linux-gnueabi]\nlinker = "arm-linux-gnueabi-gcc"' >> /.cargo/config && \ echo '[target.mipsel-unknown-linux-gnu]\nlinker = "mipsel-linux-gnu-gcc"' >> /.cargo/config -RUN mkdir /build +RUN mkdir /build && \ + mkdir /pi-tools && \ + curl -L https://github.com/raspberrypi/tools/archive/648a6eeb1e3c2b40af4eb34d88941ee0edeb3e9a.tar.gz | tar xz --strip-components 1 -C /pi-tools + ENV CARGO_TARGET_DIR /build ENV CARGO_HOME /build/cache diff --git a/contrib/Dockerfile.Rpi b/contrib/Dockerfile.Rpi new file mode 100644 index 00000000..7c2c12c9 --- /dev/null +++ b/contrib/Dockerfile.Rpi @@ -0,0 +1,54 @@ +# Create a docker image for the RPI +# Build the docker image from the root of the project with the following command : +# $ docker build -t librespot-rpi -f .\contrib\Dockerfile.Rpi . +# +# This builds a docker image which is usable when running docker on the rpi. +# +# This Dockerfile builds in windows without any requirements, for linux based systems you might need to run the following line: +# docker run --rm --privileged multiarch/qemu-user-static:register --reset +# (see here for more info: https://gist.github.com/PieterScheffers/d50f609d9628383e4c9d8d7d269b7643 ) +# +# Save the docker image to a file: +# $ docker save -o contrib/librespot-rpi librespot-rpi +# +# Move it to the rpi and import it with: +# docker load -i librespot-rpi +# +# Run it with: +# docker run -d --restart unless-stopped $(for DEV in $(find /dev/snd -type c); do echo --device=$DEV:$DEV; done) --net=host --name librespot-rpi librespot-rpi --name {devicename} + +FROM debian:stretch + +RUN dpkg --add-architecture armhf +RUN apt-get update + +RUN apt-get install -y curl git build-essential crossbuild-essential-armhf +RUN apt-get install -y libasound2-dev libasound2-dev:armhf + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y +ENV PATH="/root/.cargo/bin/:${PATH}" +RUN rustup target add arm-unknown-linux-gnueabihf + +RUN mkdir /.cargo && \ + echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config + +RUN mkdir /build +ENV CARGO_TARGET_DIR /build +ENV CARGO_HOME /build/cache + +ADD . /src +WORKDIR /src +RUN cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend" + + +FROM resin/rpi-raspbian +RUN apt-get update && \ + apt-get install libasound2 && \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir /librespot +WORKDIR /librespot + +COPY --from=0 /build/arm-unknown-linux-gnueabihf/release/librespot . +RUN chmod +x librespot +ENTRYPOINT ["./librespot"] \ No newline at end of file diff --git a/contrib/docker-build-pi-armv6hf.sh b/contrib/docker-build-pi-armv6hf.sh new file mode 100755 index 00000000..9cc52a98 --- /dev/null +++ b/contrib/docker-build-pi-armv6hf.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# Snipped and tucked from https://github.com/plietar/librespot/pull/202/commits/21549641d39399cbaec0bc92b36c9951d1b87b90 +# and further inputs from https://github.com/kingosticks/librespot/commit/c55dd20bd6c7e44dd75ff33185cf50b2d3bd79c3 + +set -eux +# Get alsa lib and headers +ALSA_VER="1.0.25-4" +DEPS=( \ + "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_${ALSA_VER}_armhf.deb" \ + "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2-dev_${ALSA_VER}_armhf.deb" \ +) + +# Collect Paths +SYSROOT="/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot" +GCC="/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin" +GCC_SYSROOT="$GCC/gcc-sysroot" + + +export PATH=/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:$PATH + +# Link the compiler +export TARGET_CC="$GCC/arm-linux-gnueabihf-gcc" + +# Create wrapper around gcc to point to rpi sysroot +echo -e '#!/bin/bash' "\n$TARGET_CC --sysroot $SYSROOT \"\$@\"" > $GCC_SYSROOT +chmod +x $GCC_SYSROOT + +# Add extra target dependencies to our rpi sysroot +for path in "${DEPS[@]}"; do + curl -OL $path + dpkg -x $(basename $path) $SYSROOT +done + +# i don't why this is neccessary +# ln -s ld-linux.so.3 $SYSROOT/lib/ld-linux-armhf.so.3 + +# point cargo to use gcc wrapper as linker +echo -e '[target.arm-unknown-linux-gnueabihf]\nlinker = "gcc-sysroot"' > /.cargo/config + +# Build +cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend" diff --git a/core/Cargo.toml b/core/Cargo.toml index bf34de0b..0377d6ee 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -8,28 +8,36 @@ build = "build.rs" path = "../protocol" [dependencies] -base64 = "0.5.0" -byteorder = "1.0" -error-chain = { version = "0.9.0", default_features = false } -futures = "0.1.8" -hyper = "0.11.2" -lazy_static = "0.2.0" -log = "0.3.5" -num-bigint = "0.1.35" -num-integer = "0.1.32" -num-traits = "0.1.36" -protobuf = "1.1" -rand = "0.3.13" -rpassword = "0.3.0" -rust-crypto = { git = "https://github.com/awmath/rust-crypto.git", branch = "avx2" } -serde = "0.9.6" -serde_derive = "0.9.6" -serde_json = "0.9.5" +base64 = "0.10" +byteorder = "1.3" +bytes = "0.4" +error-chain = { version = "0.12", default_features = false } +extprim = "1.7" +futures = "0.1" +httparse = "1.3" +hyper = "0.11" +hyper-proxy = { version = "0.4", default_features = false } +lazy_static = "1.3" +log = "0.4" +num-bigint = "0.2" +num-integer = "0.1" +num-traits = "0.2" +protobuf = "2.8.*" +rand = "0.7" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" shannon = "0.2.0" -tokio-core = "0.1.2" -uuid = { version = "0.4", features = ["v4"] } +tokio-codec = "0.1" +tokio-core = "0.1" +tokio-io = "0.1" +url = "1.7" +uuid = { version = "0.7", features = ["v4"] } +sha-1 = "0.8" +hmac = "0.7" +pbkdf2 = "0.3" +aes = "0.3" [build-dependencies] -protobuf_macros = { git = "https://github.com/plietar/rust-protobuf-macros", features = ["with-syntex"] } -rand = "0.3.13" +rand = "0.7" vergen = "0.1.0" diff --git a/core/build.rs b/core/build.rs index 01fd14a1..17ac75c6 100644 --- a/core/build.rs +++ b/core/build.rs @@ -1,43 +1,38 @@ -extern crate vergen; -extern crate protobuf_macros; extern crate rand; +extern crate vergen; use rand::Rng; +use rand::distributions::Alphanumeric; use std::env; -use std::path::PathBuf; use std::fs::OpenOptions; use std::io::Write; +use std::path::PathBuf; fn main() { - let out = PathBuf::from(env::var("OUT_DIR").unwrap()); + let out = PathBuf::from(env::var("OUT_DIR").expect("path from env OUT_DIR")); - vergen::vergen(vergen::OutputFns::all()).unwrap(); + vergen::vergen(vergen::OutputFns::all()).expect("vergen"); - let build_id: String = rand::thread_rng() - .gen_ascii_chars() - .take(8) - .collect(); + let mut rng = rand::thread_rng(); + let build_id: String = ::std::iter::repeat(()).map(|()| rng.sample(Alphanumeric)).take(8).collect(); - let mut version_file = - OpenOptions::new() + let mut version_file = OpenOptions::new() .write(true) .append(true) .open(&out.join("version.rs")) - .unwrap(); + .expect("version file"); - let build_id_fn = format!(" + let build_id_fn = format!( + " /// Generate a random build id. pub fn build_id() -> &'static str {{ \"{}\" }} -", build_id); +", + build_id + ); if let Err(e) = version_file.write_all(build_id_fn.as_bytes()) { println!("{}", e); } - - protobuf_macros::expand("src/lib.in.rs", &out.join("lib.rs")).unwrap(); - - println!("cargo:rerun-if-changed=src/lib.in.rs"); - println!("cargo:rerun-if-changed=src/connection"); } diff --git a/core/src/apresolve.rs b/core/src/apresolve.rs index d137d874..bcb7bfe1 100644 --- a/core/src/apresolve.rs +++ b/core/src/apresolve.rs @@ -1,24 +1,49 @@ -const AP_FALLBACK : &'static str = "ap.spotify.com:80"; -const APRESOLVE_ENDPOINT : &'static str = "http://apresolve.spotify.com/"; +const AP_FALLBACK: &'static str = "ap.spotify.com:443"; +const APRESOLVE_ENDPOINT: &'static str = "http://apresolve.spotify.com/"; -use std::str::FromStr; use futures::{Future, Stream}; -use hyper::{self, Uri, Client}; +use hyper::client::HttpConnector; +use hyper::{self, Client, Method, Request, Uri}; +use hyper_proxy::{Intercept, Proxy, ProxyConnector}; use serde_json; +use std::str::FromStr; use tokio_core::reactor::Handle; +use url::Url; -error_chain! { } +error_chain!{} #[derive(Clone, Debug, Serialize, Deserialize)] pub struct APResolveData { - ap_list: Vec + ap_list: Vec, } -pub fn apresolve(handle: &Handle) -> Box> { +fn apresolve( + handle: &Handle, + proxy: &Option, + ap_port: &Option, +) -> Box> { let url = Uri::from_str(APRESOLVE_ENDPOINT).expect("invalid AP resolve URL"); + let use_proxy = proxy.is_some(); - let client = Client::new(handle); - let response = client.get(url); + let mut req = Request::new(Method::Get, url.clone()); + let response = match *proxy { + Some(ref val) => { + let proxy_url = Uri::from_str(val.as_str()).expect("invalid http proxy"); + let proxy = Proxy::new(Intercept::All, proxy_url); + let connector = HttpConnector::new(4, handle); + let proxy_connector = ProxyConnector::from_proxy_unsecured(connector, proxy); + if let Some(headers) = proxy_connector.http_headers(&url) { + req.headers_mut().extend(headers.iter()); + req.set_proxy(true); + } + let client = Client::configure().connector(proxy_connector).build(handle); + client.request(req) + } + _ => { + let client = Client::new(handle); + client.request(req) + } + }; let body = response.and_then(|response| { response.body().fold(Vec::new(), |mut acc, chunk| { @@ -27,28 +52,45 @@ pub fn apresolve(handle: &Handle) -> Box> { }) }); let body = body.then(|result| result.chain_err(|| "HTTP error")); - let body = body.and_then(|body| { - String::from_utf8(body).chain_err(|| "invalid UTF8 in response") - }); + let body = body.and_then(|body| String::from_utf8(body).chain_err(|| "invalid UTF8 in response")); - let data = body.and_then(|body| { - serde_json::from_str::(&body) - .chain_err(|| "invalid JSON") - }); + let data = + body.and_then(|body| serde_json::from_str::(&body).chain_err(|| "invalid JSON")); + + let p = ap_port.clone(); + + let ap = data.and_then(move |data| { + let mut aps = data.ap_list.iter().filter(|ap| { + if p.is_some() { + Uri::from_str(ap) + .ok() + .map_or(false, |uri| uri.port().map_or(false, |port| port == p.unwrap())) + } else if use_proxy { + // It is unlikely that the proxy will accept CONNECT on anything other than 443. + Uri::from_str(ap) + .ok() + .map_or(false, |uri| uri.port().map_or(false, |port| port == 443)) + } else { + true + } + }); - let ap = data.and_then(|data| { - let ap = data.ap_list.first().ok_or("empty AP List")?; + let ap = aps.next().ok_or("empty AP List")?; Ok(ap.clone()) }); Box::new(ap) } -pub fn apresolve_or_fallback(handle: &Handle) - -> Box> - where E: 'static +pub(crate) fn apresolve_or_fallback( + handle: &Handle, + proxy: &Option, + ap_port: &Option, +) -> Box> +where + E: 'static, { - let ap = apresolve(handle).or_else(|e| { + let ap = apresolve(handle, proxy, ap_port).or_else(|e| { warn!("Failed to resolve Access Point: {}", e.description()); warn!("Using fallback \"{}\"", AP_FALLBACK); Ok(AP_FALLBACK.into()) diff --git a/core/src/audio_key.rs b/core/src/audio_key.rs index 2d6a21ee..20910ec1 100644 --- a/core/src/audio_key.rs +++ b/core/src/audio_key.rs @@ -1,17 +1,17 @@ use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; +use bytes::Bytes; use futures::sync::oneshot; use futures::{Async, Future, Poll}; use std::collections::HashMap; use std::io::Write; -use tokio_core::io::EasyBuf; +use spotify_id::{FileId, SpotifyId}; use util::SeqGenerator; -use util::{SpotifyId, FileId}; -#[derive(Debug,Hash,PartialEq,Eq,Copy,Clone)] +#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] pub struct AudioKey(pub [u8; 16]); -#[derive(Debug,Hash,PartialEq,Eq,Copy,Clone)] +#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] pub struct AudioKeyError; component! { @@ -22,8 +22,8 @@ component! { } impl AudioKeyManager { - pub fn dispatch(&self, cmd: u8, mut data: EasyBuf) { - let seq = BigEndian::read_u32(data.drain_to(4).as_ref()); + pub(crate) fn dispatch(&self, cmd: u8, mut data: Bytes) { + let seq = BigEndian::read_u32(data.split_to(4).as_ref()); let sender = self.lock(|inner| inner.pending.remove(&seq)); @@ -32,11 +32,11 @@ impl AudioKeyManager { 0xd => { let mut key = [0u8; 16]; key.copy_from_slice(data.as_ref()); - sender.complete(Ok(AudioKey(key))); + let _ = sender.send(Ok(AudioKey(key))); } 0xe => { warn!("error audio key {:x} {:x}", data.as_ref()[0], data.as_ref()[1]); - sender.complete(Err(AudioKeyError)); + let _ = sender.send(Err(AudioKeyError)); } _ => (), } @@ -58,17 +58,17 @@ impl AudioKeyManager { fn send_key_request(&self, seq: u32, track: SpotifyId, file: FileId) { let mut data: Vec = Vec::new(); - data.write(&file.0).unwrap(); - data.write(&track.to_raw()).unwrap(); - data.write_u32::(seq).unwrap(); - data.write_u16::(0x0000).unwrap(); + data.write(&file.0).expect("data writing send_key_request"); + data.write(&track.to_raw()).expect("data writing send_key_request"); + data.write_u32::(seq).expect("data writing send_key_request"); + data.write_u16::(0x0000).expect("data writing send_key_request"); self.session().send_packet(0xc, data) } } pub struct AudioKeyFuture(oneshot::Receiver>); -impl Future for AudioKeyFuture { +impl Future for AudioKeyFuture { type Item = T; type Error = AudioKeyError; @@ -81,4 +81,3 @@ impl Future for AudioKeyFuture { } } } - diff --git a/core/src/authentication.rs b/core/src/authentication.rs index 0075fe0d..3987289b 100644 --- a/core/src/authentication.rs +++ b/core/src/authentication.rs @@ -1,32 +1,30 @@ use base64; use byteorder::{BigEndian, ByteOrder}; -use crypto; -use crypto::aes; -use crypto::digest::Digest; -use crypto::hmac::Hmac; -use crypto::pbkdf2::pbkdf2; -use crypto::sha1::Sha1; +use aes::Aes192; +use hmac::Hmac; +use sha1::{Sha1, Digest}; +use pbkdf2::pbkdf2; use protobuf::ProtobufEnum; -use rpassword; use serde; use serde_json; -use std::io::{self, stderr, Read, Write}; use std::fs::File; +use std::io::{self, Read, Write}; +use std::ops::FnOnce; use std::path::Path; use protocol::authentication::AuthenticationType; -#[derive(Debug, Clone)] -#[derive(Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Credentials { pub username: String, - #[serde(serialize_with="serialize_protobuf_enum")] - #[serde(deserialize_with="deserialize_protobuf_enum")] + #[serde(serialize_with = "serialize_protobuf_enum")] + #[serde(deserialize_with = "deserialize_protobuf_enum")] pub auth_type: AuthenticationType, - #[serde(serialize_with="serialize_base64")] - #[serde(deserialize_with="deserialize_base64")] + #[serde(alias = "encoded_auth_blob")] + #[serde(serialize_with = "serialize_base64")] + #[serde(deserialize_with = "deserialize_base64")] pub auth_data: Vec, } @@ -64,40 +62,34 @@ impl Credentials { Ok(data) } - let encrypted_blob = base64::decode(encrypted_blob).unwrap(); - - let secret = { - let mut data = [0u8; 20]; - let mut h = crypto::sha1::Sha1::new(); - h.input(device_id.as_bytes()); - h.result(&mut data); - data - }; + let secret = Sha1::digest(device_id.as_bytes()); let key = { - let mut data = [0u8; 24]; - let mut mac = Hmac::new(Sha1::new(), &secret); - pbkdf2(&mut mac, username.as_bytes(), 0x100, &mut data[0..20]); - - let mut hash = Sha1::new(); - hash.input(&data[0..20]); - hash.result(&mut data[0..20]); - BigEndian::write_u32(&mut data[20..], 20); - data + let mut key = [0u8; 24]; + pbkdf2::>(&secret, username.as_bytes(), 0x100, &mut key[0..20]); + + let hash = &Sha1::digest(&key[..20]); + key[..20].copy_from_slice(hash); + BigEndian::write_u32(&mut key[20..], 20); + key }; + // decrypt data using ECB mode without padding let blob = { - // Anyone know what this block mode is ? - let mut data = vec![0u8; encrypted_blob.len()]; - let mut cipher = aes::ecb_decryptor(aes::KeySize::KeySize192, - &key, - crypto::blockmodes::NoPadding); - cipher.decrypt(&mut crypto::buffer::RefReadBuffer::new(&encrypted_blob), - &mut crypto::buffer::RefWriteBuffer::new(&mut data), - true) - .unwrap(); - - let l = encrypted_blob.len(); + use aes::block_cipher_trait::BlockCipher; + use aes::block_cipher_trait::generic_array::GenericArray; + use aes::block_cipher_trait::generic_array::typenum::Unsigned; + + let mut data = base64::decode(encrypted_blob).unwrap(); + let cipher = Aes192::new(GenericArray::from_slice(&key)); + let block_size = ::BlockSize::to_usize(); + assert_eq!(data.len() % block_size, 0); + // replace to chunks_exact_mut with MSRV bump to 1.31 + for chunk in data.chunks_mut(block_size) { + cipher.decrypt_block(GenericArray::from_mut_slice(chunk)); + } + + let l = data.len(); for i in 0..l - 0x10 { data[l - i - 1] ^= data[l - i - 0x11]; } @@ -106,13 +98,13 @@ impl Credentials { }; let mut cursor = io::Cursor::new(&blob); - read_u8(&mut cursor).unwrap(); - read_bytes(&mut cursor).unwrap(); - read_u8(&mut cursor).unwrap(); - let auth_type = read_int(&mut cursor).unwrap(); - let auth_type = AuthenticationType::from_i32(auth_type as i32).unwrap(); - read_u8(&mut cursor).unwrap(); - let auth_data = read_bytes(&mut cursor).unwrap();; + read_u8(&mut cursor).expect("read from io::Cursor"); + read_bytes(&mut cursor).expect("read from io::Cursor"); + read_u8(&mut cursor).expect("read from io::Cursor"); + let auth_type = read_int(&mut cursor).expect("read from io::Cursor"); + let auth_type = AuthenticationType::from_i32(auth_type as i32).expect("auth type"); + read_u8(&mut cursor).expect("read from io::Cursor"); + let auth_data = read_bytes(&mut cursor).unwrap(); Credentials { username: username, @@ -121,75 +113,75 @@ impl Credentials { } } - pub fn from_reader(mut reader: R) -> Credentials { + fn from_reader(mut reader: R) -> Credentials { let mut contents = String::new(); - reader.read_to_string(&mut contents).unwrap(); + reader.read_to_string(&mut contents).expect("read to string"); - serde_json::from_str(&contents).unwrap() + serde_json::from_str(&contents).expect("from string to json") } - pub fn from_file>(path: P) -> Option { + pub(crate) fn from_file>(path: P) -> Option { File::open(path).ok().map(Credentials::from_reader) } - pub fn save_to_writer(&self, writer: &mut W) { - let contents = serde_json::to_string(&self.clone()).unwrap(); - writer.write_all(contents.as_bytes()).unwrap(); + fn save_to_writer(&self, writer: &mut W) { + let contents = serde_json::to_string(&self.clone()).expect("to json string"); + writer.write_all(contents.as_bytes()).expect("json contents written"); } - pub fn save_to_file>(&self, path: P) { - let mut file = File::create(path).unwrap(); + pub(crate) fn save_to_file>(&self, path: P) { + let mut file = File::create(path).expect("created file"); self.save_to_writer(&mut file) } } fn serialize_protobuf_enum(v: &T, ser: S) -> Result - where T: ProtobufEnum, S: serde::Serializer { - +where + T: ProtobufEnum, + S: serde::Serializer, +{ serde::Serialize::serialize(&v.value(), ser) } -fn deserialize_protobuf_enum(de: D) -> Result - where T: ProtobufEnum, D: serde::Deserializer { - - let v : i32 = try!(serde::Deserialize::deserialize(de)); +fn deserialize_protobuf_enum<'de, T, D>(de: D) -> Result +where + T: ProtobufEnum, + D: serde::Deserializer<'de>, +{ + let v: i32 = try!(serde::Deserialize::deserialize(de)); T::from_i32(v).ok_or_else(|| serde::de::Error::custom("Invalid enum value")) } fn serialize_base64(v: &T, ser: S) -> Result - where T: AsRef<[u8]>, S: serde::Serializer { - +where + T: AsRef<[u8]>, + S: serde::Serializer, +{ serde::Serialize::serialize(&base64::encode(v.as_ref()), ser) } -fn deserialize_base64(de: D) -> Result, D::Error> - where D: serde::Deserializer { - - let v : String = try!(serde::Deserialize::deserialize(de)); +fn deserialize_base64<'de, D>(de: D) -> Result, D::Error> +where + D: serde::Deserializer<'de>, +{ + let v: String = try!(serde::Deserialize::deserialize(de)); base64::decode(&v).map_err(|e| serde::de::Error::custom(e.to_string())) } -pub fn get_credentials(username: Option, password: Option, - cached_credentials: Option) - -> Option -{ +pub fn get_credentials( + username: Option, + password: Option, + cached_credentials: Option, +) -> Option { match (username, password, cached_credentials) { + (Some(username), Some(password), _) => Some(Credentials::with_password(username, password)), - (Some(username), Some(password), _) - => Some(Credentials::with_password(username, password)), - - (Some(ref username), _, Some(ref credentials)) - if *username == credentials.username => Some(credentials.clone()), - - (Some(username), None, _) => { - write!(stderr(), "Password for {}: ", username).unwrap(); - stderr().flush().unwrap(); - let password = rpassword::read_password().unwrap(); - Some(Credentials::with_password(username.clone(), password)) + (Some(ref username), _, Some(ref credentials)) if *username == credentials.username => { + Some(credentials.clone()) } + (Some(username), None, _) => None, - (None, _, Some(credentials)) - => Some(credentials), + (None, _, Some(credentials)) => Some(credentials), (None, _, None) => None, } diff --git a/core/src/cache/mod.rs b/core/src/cache.rs similarity index 66% rename from core/src/cache/mod.rs rename to core/src/cache.rs index 28b787ff..908ba294 100644 --- a/core/src/cache/mod.rs +++ b/core/src/cache.rs @@ -1,9 +1,13 @@ -use std::path::PathBuf; -use std::io::Read; +use std::fs; use std::fs::File; +use std::io; +use std::io::Read; +use std::path::Path; +use std::path::PathBuf; -use util::{FileId, mkdir_existing}; use authentication::Credentials; +use spotify_id::FileId; +use volume::Volume; #[derive(Clone)] pub struct Cache { @@ -11,6 +15,16 @@ pub struct Cache { use_audio_cache: bool, } +fn mkdir_existing(path: &Path) -> io::Result<()> { + fs::create_dir(path).or_else(|err| { + if err.kind() == io::ErrorKind::AlreadyExists { + Ok(()) + } else { + Err(err) + } + }) +} + impl Cache { pub fn new(location: PathBuf, use_audio_cache: bool) -> Cache { mkdir_existing(&location).unwrap(); @@ -18,7 +32,7 @@ impl Cache { Cache { root: location, - use_audio_cache: use_audio_cache + use_audio_cache: use_audio_cache, } } } @@ -39,6 +53,23 @@ impl Cache { } } +// cache volume to root/volume +impl Cache { + fn volume_path(&self) -> PathBuf { + self.root.join("volume") + } + + pub fn volume(&self) -> Option { + let path = self.volume_path(); + Volume::from_file(path) + } + + pub fn save_volume(&self, volume: Volume) { + let path = self.volume_path(); + volume.save_to_file(&path); + } +} + impl Cache { fn file_path(&self, file: FileId) -> PathBuf { let name = file.to_base16(); diff --git a/core/src/channel.rs b/core/src/channel.rs index 30a9e00e..57655feb 100644 --- a/core/src/channel.rs +++ b/core/src/channel.rs @@ -1,23 +1,23 @@ use byteorder::{BigEndian, ByteOrder}; -use futures::sync::{BiLock, mpsc}; -use futures::{Poll, Async, Stream}; +use bytes::Bytes; +use futures::sync::{mpsc, BiLock}; +use futures::{Async, Poll, Stream}; use std::collections::HashMap; -use tokio_core::io::EasyBuf; use util::SeqGenerator; component! { ChannelManager : ChannelManagerInner { sequence: SeqGenerator = SeqGenerator::new(0), - channels: HashMap> = HashMap::new(), + channels: HashMap> = HashMap::new(), } } -#[derive(Debug,Hash,PartialEq,Eq,Copy,Clone)] +#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] pub struct ChannelError; pub struct Channel { - receiver: mpsc::UnboundedReceiver<(u8, EasyBuf)>, + receiver: mpsc::UnboundedReceiver<(u8, Bytes)>, state: ChannelState, } @@ -26,12 +26,12 @@ pub struct ChannelData(BiLock); pub enum ChannelEvent { Header(u8, Vec), - Data(EasyBuf), + Data(Bytes), } #[derive(Clone)] enum ChannelState { - Header(EasyBuf), + Header(Bytes), Data, Closed, } @@ -48,27 +48,27 @@ impl ChannelManager { let channel = Channel { receiver: rx, - state: ChannelState::Header(EasyBuf::new()), + state: ChannelState::Header(Bytes::new()), }; (seq, channel) } - pub fn dispatch(&self, cmd: u8, mut data: EasyBuf) { + pub(crate) fn dispatch(&self, cmd: u8, mut data: Bytes) { use std::collections::hash_map::Entry; - let id: u16 = BigEndian::read_u16(data.drain_to(2).as_ref()); + let id: u16 = BigEndian::read_u16(data.split_to(2).as_ref()); self.lock(|inner| { if let Entry::Occupied(entry) = inner.channels.entry(id) { - let _ = entry.get().send((cmd, data)); + let _ = entry.get().unbounded_send((cmd, data)); } }); } } impl Channel { - fn recv_packet(&mut self) -> Poll { + fn recv_packet(&mut self) -> Poll { let (cmd, packet) = match self.receiver.poll() { Ok(Async::Ready(t)) => t.expect("channel closed"), Ok(Async::NotReady) => return Ok(Async::NotReady), @@ -107,13 +107,13 @@ impl Stream for Channel { data = try_ready!(self.recv_packet()); } - let length = BigEndian::read_u16(data.drain_to(2).as_ref()) as usize; + let length = BigEndian::read_u16(data.split_to(2).as_ref()) as usize; if length == 0 { assert_eq!(data.len(), 0); self.state = ChannelState::Data; } else { - let header_id = data.drain_to(1).as_ref()[0]; - let header_data = data.drain_to(length - 1).as_ref().to_owned(); + let header_id = data.split_to(1).as_ref()[0]; + let header_data = data.split_to(length - 1).as_ref().to_owned(); self.state = ChannelState::Header(data); @@ -139,7 +139,7 @@ impl Stream for Channel { } impl Stream for ChannelData { - type Item = EasyBuf; + type Item = Bytes; type Error = ChannelError; fn poll(&mut self) -> Poll, Self::Error> { diff --git a/core/src/component.rs b/core/src/component.rs index 1a887e77..50ab7b37 100644 --- a/core/src/component.rs +++ b/core/src/component.rs @@ -4,7 +4,7 @@ macro_rules! component { pub struct $name(::std::sync::Arc<($crate::session::SessionWeak, ::std::sync::Mutex<$inner>)>); impl $name { #[allow(dead_code)] - pub fn new(session: $crate::session::SessionWeak) -> $name { + pub(crate) fn new(session: $crate::session::SessionWeak) -> $name { debug!(target:"librespot::component", "new {}", stringify!($name)); $name(::std::sync::Arc::new((session, ::std::sync::Mutex::new($inner { @@ -36,20 +36,20 @@ macro_rules! component { } } -use std::sync::Mutex; use std::cell::UnsafeCell; +use std::sync::Mutex; -pub struct Lazy(Mutex, UnsafeCell>); -unsafe impl Sync for Lazy {} -unsafe impl Send for Lazy {} +pub(crate) struct Lazy(Mutex, UnsafeCell>); +unsafe impl Sync for Lazy {} +unsafe impl Send for Lazy {} #[cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))] -impl Lazy { - pub fn new() -> Lazy { +impl Lazy { + pub(crate) fn new() -> Lazy { Lazy(Mutex::new(false), UnsafeCell::new(None)) } - pub fn get T>(&self, f: F) -> &T { + pub(crate) fn get T>(&self, f: F) -> &T { let mut inner = self.0.lock().unwrap(); if !*inner { unsafe { diff --git a/core/src/config.rs b/core/src/config.rs index 7dcb97d3..293e2e90 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -1,51 +1,30 @@ -use uuid::Uuid; -use std::str::FromStr; use std::fmt; +use std::str::FromStr; +use url::Url; +use uuid::Uuid; use version; -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct SessionConfig { pub user_agent: String, pub device_id: String, + pub proxy: Option, + pub ap_port: Option, } impl Default for SessionConfig { fn default() -> SessionConfig { - let device_id = Uuid::new_v4().hyphenated().to_string(); + let device_id = Uuid::new_v4().to_hyphenated().to_string(); SessionConfig { user_agent: version::version_string(), device_id: device_id, + proxy: None, + ap_port: None, } } } - -#[derive(Clone, Copy, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub enum Bitrate { - Bitrate96, - Bitrate160, - Bitrate320, -} - -impl FromStr for Bitrate { - type Err = (); - fn from_str(s: &str) -> Result { - match s { - "96" => Ok(Bitrate::Bitrate96), - "160" => Ok(Bitrate::Bitrate160), - "320" => Ok(Bitrate::Bitrate320), - _ => Err(()), - } - } -} - -impl Default for Bitrate { - fn default() -> Bitrate { - Bitrate::Bitrate160 - } -} - #[derive(Clone, Copy, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)] pub enum DeviceType { Unknown = 0, @@ -100,25 +79,10 @@ impl Default for DeviceType { } } -#[derive(Clone,Debug)] -pub struct PlayerConfig { - pub bitrate: Bitrate, - pub onstart: Option, - pub onstop: Option, -} - -impl Default for PlayerConfig { - fn default() -> PlayerConfig { - PlayerConfig { - bitrate: Bitrate::default(), - onstart: None, - onstop: None, - } - } -} - -#[derive(Clone,Debug)] +#[derive(Clone, Debug)] pub struct ConnectConfig { pub name: String, pub device_type: DeviceType, + pub volume: u16, + pub linear_volume: bool, } diff --git a/core/src/connection/codec.rs b/core/src/connection/codec.rs index 6529d3d9..60634fc2 100644 --- a/core/src/connection/codec.rs +++ b/core/src/connection/codec.rs @@ -1,7 +1,8 @@ -use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; +use byteorder::{BigEndian, ByteOrder}; +use bytes::{BufMut, Bytes, BytesMut}; use shannon::Shannon; use std::io; -use tokio_core::io::{Codec, EasyBuf}; +use tokio_io::codec::{Decoder, Encoder}; const HEADER_SIZE: usize = 3; const MAC_SIZE: usize = 4; @@ -34,16 +35,17 @@ impl APCodec { } } -impl Codec for APCodec { - type Out = (u8, Vec); - type In = (u8, EasyBuf); +impl Encoder for APCodec { + type Item = (u8, Vec); + type Error = io::Error; - fn encode(&mut self, item: (u8, Vec), buf: &mut Vec) -> io::Result<()> { + fn encode(&mut self, item: (u8, Vec), buf: &mut BytesMut) -> io::Result<()> { let (cmd, payload) = item; let offset = buf.len(); - buf.write_u8(cmd).unwrap(); - buf.write_u16::(payload.len() as u16).unwrap(); + buf.reserve(3 + payload.len()); + buf.put_u8(cmd); + buf.put_u16_be(payload.len() as u16); buf.extend_from_slice(&payload); self.encode_cipher.nonce_u32(self.encode_nonce); @@ -57,12 +59,17 @@ impl Codec for APCodec { Ok(()) } +} + +impl Decoder for APCodec { + type Item = (u8, Bytes); + type Error = io::Error; - fn decode(&mut self, buf: &mut EasyBuf) -> io::Result> { + fn decode(&mut self, buf: &mut BytesMut) -> io::Result> { if let DecodeState::Header = self.decode_state { if buf.len() >= HEADER_SIZE { let mut header = [0u8; HEADER_SIZE]; - header.copy_from_slice(buf.drain_to(HEADER_SIZE).as_slice()); + header.copy_from_slice(buf.split_to(HEADER_SIZE).as_ref()); self.decode_cipher.nonce_u32(self.decode_nonce); self.decode_nonce += 1; @@ -79,17 +86,16 @@ impl Codec for APCodec { if buf.len() >= size + MAC_SIZE { self.decode_state = DecodeState::Header; - let mut payload = buf.drain_to(size + MAC_SIZE); + let mut payload = buf.split_to(size + MAC_SIZE); - self.decode_cipher.decrypt(&mut payload.get_mut()[..size]); + self.decode_cipher.decrypt(&mut payload.get_mut(..size).unwrap()); let mac = payload.split_off(size); - self.decode_cipher.check_mac(mac.as_slice())?; + self.decode_cipher.check_mac(mac.as_ref())?; - return Ok(Some((cmd, payload))); + return Ok(Some((cmd, payload.freeze()))); } } - Ok(None) } } diff --git a/core/src/connection/handshake.rs b/core/src/connection/handshake.rs index 83b0b37a..f291f13f 100644 --- a/core/src/connection/handshake.rs +++ b/core/src/connection/handshake.rs @@ -1,18 +1,20 @@ -use crypto::sha1::Sha1; -use crypto::hmac::Hmac; -use crypto::mac::Mac;use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; -use protobuf::{self, Message, MessageStatic}; +use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; +use hmac::{Hmac, Mac}; +use sha1::Sha1; +use futures::{Async, Future, Poll}; +use protobuf::{self, Message}; use rand::thread_rng; -use std::io::{self, Read, Write}; +use std::io::{self, Read}; use std::marker::PhantomData; -use tokio_core::io::{Io, Framed, write_all, WriteAll, read_exact, ReadExact, Window}; -use futures::{Poll, Async, Future}; +use tokio_codec::{Decoder, Framed}; +use tokio_io::io::{read_exact, write_all, ReadExact, Window, WriteAll}; +use tokio_io::{AsyncRead, AsyncWrite}; +use super::codec::APCodec; use diffie_hellman::DHLocalKeys; use protocol; -use protocol::keyexchange::{ClientHello, APResponseMessage, ClientResponsePlaintext}; +use protocol::keyexchange::{APResponseMessage, ClientHello, ClientResponsePlaintext}; use util; -use super::codec::APCodec; pub struct Handshake { keys: DHLocalKeys, @@ -25,7 +27,7 @@ enum HandshakeState { ClientResponse(Option, WriteAll>), } -pub fn handshake(connection: T) -> Handshake { +pub fn handshake(connection: T) -> Handshake { let local_keys = DHLocalKeys::random(&mut thread_rng()); let client_hello = client_hello(connection, local_keys.public_key()); @@ -35,7 +37,7 @@ pub fn handshake(connection: T) -> Handshake { } } -impl Future for Handshake { +impl Future for Handshake { type Item = Framed; type Error = io::Error; @@ -45,22 +47,22 @@ impl Future for Handshake { self.state = match self.state { ClientHello(ref mut write) => { let (connection, accumulator) = try_ready!(write.poll()); - + let read = recv_packet(connection, accumulator); APResponse(read) } APResponse(ref mut read) => { let (connection, message, accumulator) = try_ready!(read.poll()); - let remote_key = message.get_challenge() + let remote_key = message + .get_challenge() .get_login_crypto_challenge() .get_diffie_hellman() .get_gs() .to_owned(); let shared_secret = self.keys.shared_secret(&remote_key); - let (challenge, send_key, recv_key) = compute_keys(&shared_secret, - &accumulator); + let (challenge, send_key, recv_key) = compute_keys(&shared_secret, &accumulator); let codec = APCodec::new(&send_key, &recv_key); let write = client_response(connection, challenge); @@ -70,7 +72,7 @@ impl Future for Handshake { ClientResponse(ref mut codec, ref mut write) => { let (connection, _) = try_ready!(write.poll()); let codec = codec.take().unwrap(); - let framed = connection.framed(codec); + let framed = codec.framed(connection); return Ok(Async::Ready(framed)); } } @@ -78,23 +80,25 @@ impl Future for Handshake { } } -fn client_hello(connection: T, gc: Vec) -> WriteAll> { - let packet = protobuf_init!(ClientHello::new(), { - build_info => { - product: protocol::keyexchange::Product::PRODUCT_PARTNER, - platform: protocol::keyexchange::Platform::PLATFORM_LINUX_X86, - version: 0x10800000000, - }, - cryptosuites_supported => [ - protocol::keyexchange::Cryptosuite::CRYPTO_SUITE_SHANNON, - ], - login_crypto_hello.diffie_hellman => { - gc: gc, - server_keys_known: 1, - }, - client_nonce: util::rand_vec(&mut thread_rng(), 0x10), - padding: vec![0x1e], - }); +fn client_hello(connection: T, gc: Vec) -> WriteAll> { + let mut packet = ClientHello::new(); + packet + .mut_build_info() + .set_product(protocol::keyexchange::Product::PRODUCT_PARTNER); + packet + .mut_build_info() + .set_platform(protocol::keyexchange::Platform::PLATFORM_LINUX_X86); + packet.mut_build_info().set_version(109800078); + packet + .mut_cryptosuites_supported() + .push(protocol::keyexchange::Cryptosuite::CRYPTO_SUITE_SHANNON); + packet.mut_login_crypto_hello().mut_diffie_hellman().set_gc(gc); + packet + .mut_login_crypto_hello() + .mut_diffie_hellman() + .set_server_keys_known(1); + packet.set_client_nonce(util::rand_vec(&mut thread_rng(), 0x10)); + packet.set_padding(vec![0x1e]); let mut buffer = vec![0, 4]; let size = 2 + 4 + packet.compute_size(); @@ -104,14 +108,14 @@ fn client_hello(connection: T, gc: Vec) -> WriteAll> { write_all(connection, buffer) } -fn client_response(connection: T, challenge: Vec) -> WriteAll> { - let packet = protobuf_init!(ClientResponsePlaintext::new(), { - login_crypto_response.diffie_hellman => { - hmac: challenge - }, - pow_response => {}, - crypto_response => {}, - }); +fn client_response(connection: T, challenge: Vec) -> WriteAll> { + let mut packet = ClientResponsePlaintext::new(); + packet + .mut_login_crypto_response() + .mut_diffie_hellman() + .set_hmac(challenge); + packet.mut_pow_response(); + packet.mut_crypto_response(); let mut buffer = vec![]; let size = 4 + packet.compute_size(); @@ -121,21 +125,23 @@ fn client_response(connection: T, challenge: Vec) -> WriteAll { +enum RecvPacket { Header(ReadExact>>, PhantomData), Body(ReadExact>>, PhantomData), } -fn recv_packet(connection: T, acc: Vec) -> RecvPacket - where T: Read, - M: MessageStatic +fn recv_packet(connection: T, acc: Vec) -> RecvPacket +where + T: Read, + M: Message, { RecvPacket::Header(read_into_accumulator(connection, 4, acc), PhantomData) } -impl Future for RecvPacket - where T: Read, - M: MessageStatic +impl Future for RecvPacket +where + T: Read, + M: Message, { type Item = (T, M, Vec); type Error = io::Error; @@ -165,7 +171,11 @@ impl Future for RecvPacket } } -fn read_into_accumulator(connection: T, size: usize, mut acc: Vec) -> ReadExact>> { +fn read_into_accumulator( + connection: T, + size: usize, + mut acc: Vec, +) -> ReadExact>> { let offset = acc.len(); acc.resize(offset + size, 0); @@ -176,18 +186,24 @@ fn read_into_accumulator(connection: T, size: usize, mut acc: Vec) } fn compute_keys(shared_secret: &[u8], packets: &[u8]) -> (Vec, Vec, Vec) { - let mut data = Vec::with_capacity(0x64); - let mut mac = Hmac::new(Sha1::new(), &shared_secret); + type HmacSha1 = Hmac; + let mut data = Vec::with_capacity(0x64); for i in 1..6 { + let mut mac = HmacSha1::new_varkey(&shared_secret) + .expect("HMAC can take key of any size"); mac.input(packets); mac.input(&[i]); data.extend_from_slice(&mac.result().code()); - mac.reset(); } - mac = Hmac::new(Sha1::new(), &data[..0x14]); + let mut mac = HmacSha1::new_varkey(&data[..0x14]) + .expect("HMAC can take key of any size");; mac.input(packets); - (mac.result().code().to_vec(), data[0x14..0x34].to_vec(), data[0x34..0x54].to_vec()) + ( + mac.result().code().to_vec(), + data[0x14..0x34].to_vec(), + data[0x34..0x54].to_vec(), + ) } diff --git a/core/src/connection/mod.rs b/core/src/connection/mod.rs index 1d6f1f07..91b46c80 100644 --- a/core/src/connection/mod.rs +++ b/core/src/connection/mod.rs @@ -4,72 +4,100 @@ mod handshake; pub use self::codec::APCodec; pub use self::handshake::handshake; -use futures::{Future, Sink, Stream, BoxFuture}; +use futures::{Future, Sink, Stream}; +use protobuf::{self, Message}; use std::io; use std::net::ToSocketAddrs; use tokio_core::net::TcpStream; use tokio_core::reactor::Handle; -use tokio_core::io::Framed; -use protobuf::{self, Message}; +use tokio_codec::Framed; +use url::Url; use authentication::Credentials; use version; +use proxytunnel; + pub type Transport = Framed; -pub fn connect(addr: A, handle: &Handle) -> BoxFuture { - let addr = addr.to_socket_addrs().unwrap().next().unwrap(); - let socket = TcpStream::connect(&addr, handle); - let connection = socket.and_then(|socket| { - handshake(socket) - }); +pub fn connect( + addr: String, + handle: &Handle, + proxy: &Option, +) -> Box> { + let (addr, connect_url) = match *proxy { + Some(ref url) => { + info!("Using proxy \"{}\"", url); + (url.to_socket_addrs().unwrap().next().unwrap(), Some(addr)) + } + None => (addr.to_socket_addrs().unwrap().next().unwrap(), None), + }; - connection.boxed() + let socket = TcpStream::connect(&addr, handle); + if let Some(connect_url) = connect_url { + let connection = socket + .and_then(move |socket| proxytunnel::connect(socket, &connect_url).and_then(handshake)); + Box::new(connection) + } else { + let connection = socket.and_then(handshake); + Box::new(connection) + } } -pub fn authenticate(transport: Transport, credentials: Credentials, device_id: String) - -> BoxFuture<(Transport, Credentials), io::Error> -{ +pub fn authenticate( + transport: Transport, + credentials: Credentials, + device_id: String, +) -> Box> { use protocol::authentication::{APWelcome, ClientResponseEncrypted, CpuFamily, Os}; + use protocol::keyexchange::APLoginFailed; - let packet = protobuf_init!(ClientResponseEncrypted::new(), { - login_credentials => { - username: credentials.username, - typ: credentials.auth_type, - auth_data: credentials.auth_data, - }, - system_info => { - cpu_family: CpuFamily::CPU_UNKNOWN, - os: Os::OS_UNKNOWN, - system_information_string: format!("librespot_{}_{}", version::short_sha(), version::build_id()), - device_id: device_id, - }, - version_string: version::version_string(), - }); + let mut packet = ClientResponseEncrypted::new(); + packet.mut_login_credentials().set_username(credentials.username); + packet.mut_login_credentials().set_typ(credentials.auth_type); + packet + .mut_login_credentials() + .set_auth_data(credentials.auth_data); + packet.mut_system_info().set_cpu_family(CpuFamily::CPU_UNKNOWN); + packet.mut_system_info().set_os(Os::OS_UNKNOWN); + packet.mut_system_info().set_system_information_string(format!( + "librespot_{}_{}", + version::short_sha(), + version::build_id() + )); + packet.mut_system_info().set_device_id(device_id); + packet.set_version_string(version::version_string()); let cmd = 0xab; let data = packet.write_to_bytes().unwrap(); - transport.send((cmd, data)).and_then(|transport| { - transport.into_future().map_err(|(err, _stream)| err) - }).and_then(|(packet, transport)| { - match packet { - Some((0xac, data)) => { - let welcome_data: APWelcome = - protobuf::parse_from_bytes(data.as_ref()).unwrap(); + Box::new( + transport + .send((cmd, data)) + .and_then(|transport| transport.into_future().map_err(|(err, _stream)| err)) + .and_then(|(packet, transport)| match packet { + Some((0xac, data)) => { + let welcome_data: APWelcome = protobuf::parse_from_bytes(data.as_ref()).unwrap(); - let reusable_credentials = Credentials { - username: welcome_data.get_canonical_username().to_owned(), - auth_type: welcome_data.get_reusable_auth_credentials_type(), - auth_data: welcome_data.get_reusable_auth_credentials().to_owned(), - }; + let reusable_credentials = Credentials { + username: welcome_data.get_canonical_username().to_owned(), + auth_type: welcome_data.get_reusable_auth_credentials_type(), + auth_data: welcome_data.get_reusable_auth_credentials().to_owned(), + }; - Ok((transport, reusable_credentials)) - } + Ok((transport, reusable_credentials)) + } - Some((0xad, _)) => panic!("Authentication failed"), - Some((cmd, _)) => panic!("Unexpected packet {:?}", cmd), - None => panic!("EOF"), - } - }).boxed() + Some((0xad, data)) => { + let error_data: APLoginFailed = protobuf::parse_from_bytes(data.as_ref()).unwrap(); + panic!( + "Authentication failed with reason: {:?}", + error_data.get_error_code() + ) + } + + Some((cmd, _)) => panic!("Unexpected packet {:?}", cmd), + None => panic!("EOF"), + }), + ) } diff --git a/core/src/diffie_hellman.rs b/core/src/diffie_hellman.rs index 2f6572e1..b8e41426 100644 --- a/core/src/diffie_hellman.rs +++ b/core/src/diffie_hellman.rs @@ -7,17 +7,13 @@ use util; lazy_static! { pub static ref DH_GENERATOR: BigUint = BigUint::from_u64(0x2).unwrap(); pub static ref DH_PRIME: BigUint = BigUint::from_bytes_be(&[ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, - 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, - 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, - 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, - 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, - 0x34, 0x04, 0xdd, 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, - 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, 0xf2, 0x5f, 0x14, - 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, - 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, - 0x4c, 0x42, 0xe9, 0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ]); + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, + 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, + 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, 0xf2, 0x5f, 0x14, 0x37, + 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, + 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + ]); } pub struct DHLocalKeys { @@ -43,9 +39,7 @@ impl DHLocalKeys { } pub fn shared_secret(&self, remote_key: &[u8]) -> Vec { - let shared_key = util::powm(&BigUint::from_bytes_be(remote_key), - &self.private_key, - &DH_PRIME); + let shared_key = util::powm(&BigUint::from_bytes_be(remote_key), &self.private_key, &DH_PRIME); shared_key.to_bytes_be() } } diff --git a/core/src/keymaster.rs b/core/src/keymaster.rs new file mode 100644 index 00000000..4d82ae07 --- /dev/null +++ b/core/src/keymaster.rs @@ -0,0 +1,32 @@ +use futures::Future; +use serde_json; + +use mercury::MercuryError; +use session::Session; + +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Token { + pub access_token: String, + pub expires_in: u32, + pub token_type: String, + pub scope: Vec, +} + +pub fn get_token( + session: &Session, + client_id: &str, + scopes: &str, +) -> Box> { + let url = format!( + "hm://keymaster/token/authenticated?client_id={}&scope={}", + client_id, scopes + ); + Box::new(session.mercury().get(url).map(move |response| { + let data = response.payload.first().expect("Empty payload"); + let data = String::from_utf8(data.clone()).unwrap(); + let token: Token = serde_json::from_str(&data).unwrap(); + + token + })) +} diff --git a/core/src/lib.in.rs b/core/src/lib.in.rs deleted file mode 100644 index b3b606b4..00000000 --- a/core/src/lib.in.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod connection; diff --git a/core/src/lib.rs b/core/src/lib.rs index 052c1236..57be3b9d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,43 +1,58 @@ #![cfg_attr(feature = "cargo-clippy", allow(unused_io_amount))] -// TODO: many items from tokio-core::io have been deprecated in favour of tokio-io -#![allow(deprecated)] - -#[macro_use] extern crate error_chain; -#[macro_use] extern crate futures; -#[macro_use] extern crate lazy_static; -#[macro_use] extern crate log; -#[macro_use] extern crate serde_derive; +#[macro_use] +extern crate error_chain; +#[macro_use] +extern crate futures; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +#[macro_use] +extern crate serde_derive; extern crate base64; extern crate byteorder; -extern crate crypto; +extern crate bytes; +extern crate extprim; +extern crate httparse; extern crate hyper; +extern crate hyper_proxy; extern crate num_bigint; extern crate num_integer; extern crate num_traits; extern crate protobuf; extern crate rand; -extern crate rpassword; extern crate serde; extern crate serde_json; extern crate shannon; +extern crate tokio_codec; extern crate tokio_core; +extern crate tokio_io; +extern crate url; extern crate uuid; +extern crate sha1; +extern crate hmac; +extern crate pbkdf2; +extern crate aes; extern crate librespot_protocol as protocol; -#[macro_use] mod component; -pub mod apresolve; +#[macro_use] +mod component; +mod apresolve; pub mod audio_key; pub mod authentication; pub mod cache; pub mod channel; pub mod config; +mod connection; pub mod diffie_hellman; +pub mod keymaster; pub mod mercury; +mod proxytunnel; pub mod session; +pub mod spotify_id; pub mod util; pub mod version; - -include!(concat!(env!("OUT_DIR"), "/lib.rs")); +pub mod volume; diff --git a/core/src/mercury/mod.rs b/core/src/mercury/mod.rs index 2bf52a11..0b69d8ee 100644 --- a/core/src/mercury/mod.rs +++ b/core/src/mercury/mod.rs @@ -1,11 +1,11 @@ use byteorder::{BigEndian, ByteOrder}; -use futures::sync::{oneshot, mpsc}; -use futures::{Async, Poll, BoxFuture, Future}; +use bytes::Bytes; +use futures::sync::{mpsc, oneshot}; +use futures::{Async, Future, Poll}; use protobuf; use protocol; use std::collections::HashMap; use std::mem; -use tokio_core::io::EasyBuf; use util::SeqGenerator; @@ -30,7 +30,7 @@ pub struct MercuryPending { } pub struct MercuryFuture(oneshot::Receiver>); -impl Future for MercuryFuture { +impl Future for MercuryFuture { type Item = T; type Error = MercuryError; @@ -51,9 +51,7 @@ impl MercuryManager { seq } - pub fn request(&self, req: MercuryRequest) - -> MercuryFuture - { + fn request(&self, req: MercuryRequest) -> MercuryFuture { let (tx, rx) = oneshot::channel(); let pending = MercuryPending { @@ -72,9 +70,7 @@ impl MercuryManager { MercuryFuture(rx) } - pub fn get>(&self, uri: T) - -> MercuryFuture - { + pub fn get>(&self, uri: T) -> MercuryFuture { self.request(MercuryRequest { method: MercuryMethod::GET, uri: uri.into(), @@ -83,9 +79,7 @@ impl MercuryManager { }) } - pub fn send>(&self, uri: T, data: Vec) - -> MercuryFuture - { + pub fn send>(&self, uri: T, data: Vec) -> MercuryFuture { self.request(MercuryRequest { method: MercuryMethod::SEND, uri: uri.into(), @@ -98,9 +92,10 @@ impl MercuryManager { MercurySender::new(self.clone(), uri.into()) } - pub fn subscribe>(&self, uri: T) - -> BoxFuture, MercuryError> - { + pub fn subscribe>( + &self, + uri: T, + ) -> Box, Error = MercuryError>> { let uri = uri.into(); let request = self.request(MercuryRequest { method: MercuryMethod::SUB, @@ -110,7 +105,7 @@ impl MercuryManager { }); let manager = self.clone(); - request.map(move |response| { + Box::new(request.map(move |response| { let (tx, rx) = mpsc::unbounded(); manager.lock(move |inner| { @@ -118,8 +113,8 @@ impl MercuryManager { if response.payload.len() > 0 { // Old subscription protocol, watch the provided list of URIs for sub in response.payload { - let mut sub : protocol::pubsub::Subscription - = protobuf::parse_from_bytes(&sub).unwrap(); + let mut sub: protocol::pubsub::Subscription = + protobuf::parse_from_bytes(&sub).unwrap(); let sub_uri = sub.take_uri(); debug!("subscribed sub_uri={}", sub_uri); @@ -133,27 +128,25 @@ impl MercuryManager { }); rx - }).boxed() + })) } - pub fn dispatch(&self, cmd: u8, mut data: EasyBuf) { - let seq_len = BigEndian::read_u16(data.drain_to(2).as_ref()) as usize; - let seq = data.drain_to(seq_len).as_ref().to_owned(); + pub(crate) fn dispatch(&self, cmd: u8, mut data: Bytes) { + let seq_len = BigEndian::read_u16(data.split_to(2).as_ref()) as usize; + let seq = data.split_to(seq_len).as_ref().to_owned(); - let flags = data.drain_to(1).as_ref()[0]; - let count = BigEndian::read_u16(data.drain_to(2).as_ref()) as usize; + let flags = data.split_to(1).as_ref()[0]; + let count = BigEndian::read_u16(data.split_to(2).as_ref()) as usize; let pending = self.lock(|inner| inner.pending.remove(&seq)); let mut pending = match pending { Some(pending) => pending, - None if cmd == 0xb5 => { - MercuryPending { - parts: Vec::new(), - partial: None, - callback: None, - } - } + None if cmd == 0xb5 => MercuryPending { + parts: Vec::new(), + partial: None, + callback: None, + }, None => { warn!("Ignore seq {:?} cmd {:x}", seq, cmd); return; @@ -181,9 +174,9 @@ impl MercuryManager { } } - fn parse_part(data: &mut EasyBuf) -> Vec { - let size = BigEndian::read_u16(data.drain_to(2).as_ref()) as usize; - data.drain_to(size).as_ref().to_owned() + fn parse_part(data: &mut Bytes) -> Vec { + let size = BigEndian::read_u16(data.split_to(2).as_ref()) as usize; + data.split_to(size).as_ref().to_owned() } fn complete_request(&self, cmd: u8, mut pending: MercuryPending) { @@ -196,10 +189,12 @@ impl MercuryManager { payload: pending.parts, }; - if response.status_code >= 400 { + if response.status_code >= 500 { + panic!("Spotify servers returned an error. Restart librespot."); + } else if response.status_code >= 400 { warn!("error {} for uri {}", response.status_code, &response.uri); if let Some(cb) = pending.callback { - cb.complete(Err(MercuryError)); + let _ = cb.send(Err(MercuryError)); } } else { if cmd == 0xb5 { @@ -211,7 +206,7 @@ impl MercuryManager { // if send fails, remove from list of subs // TODO: send unsub message - sub.send(response.clone()).is_ok() + sub.unbounded_send(response.clone()).is_ok() } else { // URI doesn't match true @@ -223,7 +218,7 @@ impl MercuryManager { } }) } else if let Some(cb) = pending.callback { - cb.complete(Ok(response)); + let _ = cb.send(Ok(response)); } } } diff --git a/core/src/mercury/sender.rs b/core/src/mercury/sender.rs index 67b4dc08..f00235ef 100644 --- a/core/src/mercury/sender.rs +++ b/core/src/mercury/sender.rs @@ -1,5 +1,5 @@ +use futures::{Async, AsyncSink, Future, Poll, Sink, StartSend}; use std::collections::VecDeque; -use futures::{Async, Poll, Future, Sink, StartSend, AsyncSink}; use super::*; @@ -11,7 +11,7 @@ pub struct MercurySender { impl MercurySender { // TODO: pub(super) when stable - pub fn new(mercury: MercuryManager, uri: String) -> MercurySender { + pub(crate) fn new(mercury: MercuryManager, uri: String) -> MercurySender { MercurySender { mercury: mercury, uri: uri, diff --git a/core/src/mercury/types.rs b/core/src/mercury/types.rs index 9952b533..23f64c45 100644 --- a/core/src/mercury/types.rs +++ b/core/src/mercury/types.rs @@ -27,18 +27,17 @@ pub struct MercuryResponse { pub payload: Vec>, } -#[derive(Debug,Hash,PartialEq,Eq,Copy,Clone)] +#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)] pub struct MercuryError; impl ToString for MercuryMethod { fn to_string(&self) -> String { match *self { - MercuryMethod::GET => "GET", - MercuryMethod::SUB => "SUB", - MercuryMethod::UNSUB => "UNSUB", - MercuryMethod::SEND => "SEND", - } - .to_owned() + MercuryMethod::GET => "GET", + MercuryMethod::SUB => "SUB", + MercuryMethod::UNSUB => "UNSUB", + MercuryMethod::SEND => "SEND", + }.to_owned() } } @@ -58,7 +57,9 @@ impl MercuryRequest { packet.write_u16::(seq.len() as u16).unwrap(); packet.write_all(seq).unwrap(); packet.write_u8(1).unwrap(); // Flags: FINAL - packet.write_u16::(1 + self.payload.len() as u16).unwrap(); // Part count + packet + .write_u16::(1 + self.payload.len() as u16) + .unwrap(); // Part count let mut header = protocol::mercury::Header::new(); header.set_uri(self.uri.clone()); @@ -68,7 +69,9 @@ impl MercuryRequest { header.set_content_type(content_type.clone()); } - packet.write_u16::(header.compute_size() as u16).unwrap(); + packet + .write_u16::(header.compute_size() as u16) + .unwrap(); header.write_to_writer(&mut packet).unwrap(); for p in &self.payload { diff --git a/core/src/proxytunnel.rs b/core/src/proxytunnel.rs new file mode 100644 index 00000000..5e07db99 --- /dev/null +++ b/core/src/proxytunnel.rs @@ -0,0 +1,108 @@ +use std::error::Error; +use std::io; +use std::str::FromStr; + +use futures::{Async, Future, Poll}; +use httparse; +use hyper::Uri; +use tokio_io::io::{read, write_all, Read, Window, WriteAll}; +use tokio_io::{AsyncRead, AsyncWrite}; + +pub struct ProxyTunnel { + state: ProxyState, +} + +enum ProxyState { + ProxyConnect(WriteAll>), + ProxyResponse(Read>>), +} + +pub fn connect(connection: T, connect_url: &str) -> ProxyTunnel { + let proxy = proxy_connect(connection, connect_url); + ProxyTunnel { + state: ProxyState::ProxyConnect(proxy), + } +} + +impl Future for ProxyTunnel { + type Item = T; + type Error = io::Error; + + fn poll(&mut self) -> Poll { + use self::ProxyState::*; + loop { + self.state = match self.state { + ProxyConnect(ref mut write) => { + let (connection, mut accumulator) = try_ready!(write.poll()); + + let capacity = accumulator.capacity(); + accumulator.resize(capacity, 0); + let window = Window::new(accumulator); + + let read = read(connection, window); + ProxyResponse(read) + } + + ProxyResponse(ref mut read_f) => { + let (connection, mut window, bytes_read) = try_ready!(read_f.poll()); + + if bytes_read == 0 { + return Err(io::Error::new(io::ErrorKind::Other, "Early EOF from proxy")); + } + + let data_end = window.start() + bytes_read; + + let buf = window.get_ref()[0..data_end].to_vec(); + let mut headers = [httparse::EMPTY_HEADER; 16]; + let mut response = httparse::Response::new(&mut headers); + let status = match response.parse(&buf) { + Ok(status) => status, + Err(err) => return Err(io::Error::new(io::ErrorKind::Other, err.description())), + }; + + if status.is_complete() { + if let Some(code) = response.code { + if code == 200 { + // Proxy says all is well + return Ok(Async::Ready(connection)); + } else { + let reason = response.reason.unwrap_or("no reason"); + let msg = format!("Proxy responded with {}: {}", code, reason); + + return Err(io::Error::new(io::ErrorKind::Other, msg)); + } + } else { + return Err(io::Error::new( + io::ErrorKind::Other, + "Malformed response from proxy", + )); + } + } else { + if data_end >= window.end() { + // Allocate some more buffer space + let newsize = data_end + 100; + window.get_mut().resize(newsize, 0); + window.set_end(newsize); + } + // We did not get a full header + window.set_start(data_end); + let read = read(connection, window); + ProxyResponse(read) + } + } + } + } + } +} + +fn proxy_connect(connection: T, connect_url: &str) -> WriteAll> { + let uri = Uri::from_str(connect_url).unwrap(); + let buffer = format!( + "CONNECT {0}:{1} HTTP/1.1\r\n\ + \r\n", + uri.host().expect(&format!("No host in {}", uri)), + uri.port().expect(&format!("No port in {}", uri)) + ).into_bytes(); + + write_all(connection, buffer) +} diff --git a/core/src/session.rs b/core/src/session.rs index 9a45df89..e15c6b83 100644 --- a/core/src/session.rs +++ b/core/src/session.rs @@ -1,30 +1,32 @@ -use crypto::digest::Digest; -use crypto::sha1::Sha1; -use futures::sync::mpsc; -use futures::{Future, Stream, BoxFuture, IntoFuture, Poll, Async}; use std::io; -use std::sync::{RwLock, Arc, Weak}; -use tokio_core::io::EasyBuf; +use std::sync::{Arc, RwLock, Weak}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::time::{SystemTime, UNIX_EPOCH}; + +use byteorder::{BigEndian, ByteOrder}; +use bytes::Bytes; +use futures::{Async, Future, IntoFuture, Poll, Stream}; +use futures::sync::mpsc; use tokio_core::reactor::{Handle, Remote}; -use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; use apresolve::apresolve_or_fallback; +use audio_key::AudioKeyManager; use authentication::Credentials; use cache::Cache; +use channel::ChannelManager; use component::Lazy; -use connection; use config::SessionConfig; - -use audio_key::AudioKeyManager; -use channel::ChannelManager; +use connection; use mercury::MercuryManager; -pub struct SessionData { +struct SessionData { country: String, + time_delta: i64, canonical_username: String, + invalid: bool, } -pub struct SessionInternal { +struct SessionInternal { config: SessionConfig, data: RwLock, @@ -40,35 +42,30 @@ pub struct SessionInternal { session_id: usize, } -static SESSION_COUNTER : AtomicUsize = ATOMIC_USIZE_INIT; +static SESSION_COUNTER: AtomicUsize = AtomicUsize::new(0); #[derive(Clone)] -pub struct Session(pub Arc); - -pub fn device_id(name: &str) -> String { - let mut h = Sha1::new(); - h.input_str(name); - h.result_str() -} +pub struct Session(Arc); impl Session { - pub fn connect(config: SessionConfig, credentials: Credentials, - cache: Option, handle: Handle) - -> Box> - { - let access_point = apresolve_or_fallback::(&handle); - + pub fn connect( + config: SessionConfig, + credentials: Credentials, + cache: Option, + handle: Handle, + ) -> Box> { + let access_point = apresolve_or_fallback::(&handle, &config.proxy, &config.ap_port); let handle_ = handle.clone(); + let proxy = config.proxy.clone(); let connection = access_point.and_then(move |addr| { info!("Connecting to AP \"{}\"", addr); - connection::connect::<&str>(&addr, &handle_) + connection::connect(addr, &handle_, &proxy) }); let device_id = config.device_id.clone(); - let authentication = connection.and_then(move |connection| { - connection::authenticate(connection, credentials, device_id) - }); + let authentication = connection + .and_then(move |connection| connection::authenticate(connection, credentials, device_id)); let result = authentication.map(move |(transport, reusable_credentials)| { info!("Authenticated as \"{}\" !", reusable_credentials.username); @@ -77,21 +74,30 @@ impl Session { } let (session, task) = Session::create( - &handle, transport, config, cache, reusable_credentials.username.clone() + &handle, + transport, + config, + cache, + reusable_credentials.username.clone(), ); - handle.spawn(task.map_err(|e| panic!(e))); + handle.spawn(task.map_err(|e| { + error!("{:?}", e); + })); session }); - + Box::new(result) } - fn create(handle: &Handle, transport: connection::Transport, - config: SessionConfig, cache: Option, username: String) - -> (Session, BoxFuture<(), io::Error>) - { + fn create( + handle: &Handle, + transport: connection::Transport, + config: SessionConfig, + cache: Option, + username: String, + ) -> (Session, Box>) { let (sink, stream) = transport.split(); let (sender_tx, sender_rx) = mpsc::unbounded(); @@ -104,6 +110,8 @@ impl Session { data: RwLock::new(SessionData { country: String::new(), canonical_username: username, + invalid: false, + time_delta: 0, }), tx_connection: sender_tx, @@ -121,11 +129,11 @@ impl Session { let sender_task = sender_rx .map_err(|e| -> io::Error { panic!(e) }) - .forward(sink).map(|_| ()); + .forward(sink) + .map(|_| ()); let receiver_task = DispatchTask(stream, session.weak()); - let task = (receiver_task, sender_task).into_future() - .map(|((), ())| ()).boxed(); + let task = Box::new((receiver_task, sender_task).into_future().map(|((), ())| ())); (session, task) } @@ -142,26 +150,44 @@ impl Session { self.0.mercury.get(|| MercuryManager::new(self.weak())) } + pub fn time_delta(&self) -> i64 { + self.0.data.read().unwrap().time_delta + } + pub fn spawn(&self, f: F) - where F: FnOnce(&Handle) -> R + Send + 'static, - R: IntoFuture, - R::Future: 'static + where + F: FnOnce(&Handle) -> R + Send + 'static, + R: IntoFuture, + R::Future: 'static, { self.0.handle.spawn(f) } fn debug_info(&self) { - debug!("Session[{}] strong={} weak={}", - self.0.session_id, Arc::strong_count(&self.0), Arc::weak_count(&self.0)); + debug!( + "Session[{}] strong={} weak={}", + self.0.session_id, + Arc::strong_count(&self.0), + Arc::weak_count(&self.0) + ); } #[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] - fn dispatch(&self, cmd: u8, data: EasyBuf) { + fn dispatch(&self, cmd: u8, data: Bytes) { match cmd { 0x4 => { + let server_timestamp = BigEndian::read_u32(data.as_ref()) as i64; + let timestamp = match SystemTime::now().duration_since(UNIX_EPOCH) { + Ok(dur) => dur, + Err(err) => err.duration(), + } + .as_secs() as i64; + + self.0.data.write().unwrap().time_delta = server_timestamp - timestamp; + self.debug_info(); - self.send_packet(0x49, data.as_ref().to_owned()); - }, + self.send_packet(0x49, vec![0, 0, 0, 0]); + } 0x4a => (), 0x1b => { let country = String::from_utf8(data.as_ref().to_owned()).unwrap(); @@ -177,14 +203,14 @@ impl Session { } pub fn send_packet(&self, cmd: u8, data: Vec) { - self.0.tx_connection.send((cmd, data)).unwrap(); + self.0.tx_connection.unbounded_send((cmd, data)).unwrap(); } pub fn cache(&self) -> Option<&Arc> { self.0.cache.as_ref() } - pub fn config(&self) -> &SessionConfig { + fn config(&self) -> &SessionConfig { &self.0.config } @@ -200,24 +226,33 @@ impl Session { &self.config().device_id } - pub fn weak(&self) -> SessionWeak { + fn weak(&self) -> SessionWeak { SessionWeak(Arc::downgrade(&self.0)) } pub fn session_id(&self) -> usize { self.0.session_id } + + pub fn shutdown(&self) { + debug!("Invalidating session[{}]", self.0.session_id); + self.0.data.write().unwrap().invalid = true; + } + + pub fn is_invalid(&self) -> bool { + self.0.data.read().unwrap().invalid + } } #[derive(Clone)] -pub struct SessionWeak(pub Weak); +pub struct SessionWeak(Weak); impl SessionWeak { - pub fn try_upgrade(&self) -> Option { + fn try_upgrade(&self) -> Option { self.0.upgrade().map(Session) } - pub fn upgrade(&self) -> Session { + pub(crate) fn upgrade(&self) -> Session { self.try_upgrade().expect("Session died") } } @@ -229,10 +264,13 @@ impl Drop for SessionInternal { } struct DispatchTask(S, SessionWeak) - where S: Stream; +where + S: Stream; -impl Future for DispatchTask - where S: Stream +impl Future for DispatchTask +where + S: Stream, + ::Error: ::std::fmt::Debug, { type Item = (); type Error = S::Error; @@ -240,20 +278,27 @@ impl Future for DispatchTask fn poll(&mut self) -> Poll { let session = match self.1.try_upgrade() { Some(session) => session, - None => { - return Ok(Async::Ready(())) - }, + None => return Ok(Async::Ready(())), }; loop { - let (cmd, data) = try_ready!(self.0.poll()).expect("connection closed"); + let (cmd, data) = match self.0.poll() { + Ok(Async::Ready(t)) => t, + Ok(Async::NotReady) => return Ok(Async::NotReady), + Err(e) => { + session.shutdown(); + return Err(From::from(e)); + } + }.expect("connection closed"); + session.dispatch(cmd, data); } } } -impl Drop for DispatchTask - where S: Stream +impl Drop for DispatchTask +where + S: Stream, { fn drop(&mut self) { debug!("drop Dispatch"); diff --git a/core/src/spotify_id.rs b/core/src/spotify_id.rs new file mode 100644 index 00000000..c71ea1d7 --- /dev/null +++ b/core/src/spotify_id.rs @@ -0,0 +1,118 @@ +use byteorder::{BigEndian, ByteOrder}; +use extprim::u128::u128; +use std; +use std::fmt; + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct SpotifyId(u128); + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct SpotifyIdError; + +const BASE62_DIGITS: &'static [u8] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +const BASE16_DIGITS: &'static [u8] = b"0123456789abcdef"; + +impl SpotifyId { + pub fn from_base16(id: &str) -> Result { + let data = id.as_bytes(); + + let mut n: u128 = u128::zero(); + for c in data { + let d = match BASE16_DIGITS.iter().position(|e| e == c) { + None => return Err(SpotifyIdError), + Some(x) => x as u64, + }; + n = n * u128::new(16); + n = n + u128::new(d); + } + + Ok(SpotifyId(n)) + } + + pub fn from_base62(id: &str) -> Result { + let data = id.as_bytes(); + + let mut n: u128 = u128::zero(); + for c in data { + let d = match BASE62_DIGITS.iter().position(|e| e == c) { + None => return Err(SpotifyIdError), + Some(x) => x as u64, + }; + n = n * u128::new(62); + n = n + u128::new(d); + } + + Ok(SpotifyId(n)) + } + + pub fn from_raw(data: &[u8]) -> Result { + if data.len() != 16 { + return Err(SpotifyIdError); + }; + + let high = BigEndian::read_u64(&data[0..8]); + let low = BigEndian::read_u64(&data[8..16]); + + Ok(SpotifyId(u128::from_parts(high, low))) + } + + pub fn to_base16(&self) -> String { + let &SpotifyId(ref n) = self; + + let mut data = [0u8; 32]; + for i in 0..32 { + data[31 - i] = BASE16_DIGITS[(n.wrapping_shr(4 * i as u32).low64() & 0xF) as usize]; + } + + std::str::from_utf8(&data).unwrap().to_owned() + } + + pub fn to_base62(&self) -> String { + let &SpotifyId(mut n) = self; + + let mut data = [0u8; 22]; + let sixty_two = u128::new(62); + for i in 0..22 { + data[21 - i] = BASE62_DIGITS[(n % sixty_two).low64() as usize]; + n /= sixty_two; + } + + std::str::from_utf8(&data).unwrap().to_owned() + } + + pub fn to_raw(&self) -> [u8; 16] { + let &SpotifyId(ref n) = self; + + let mut data = [0u8; 16]; + + BigEndian::write_u64(&mut data[0..8], n.high64()); + BigEndian::write_u64(&mut data[8..16], n.low64()); + + data + } +} + +#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct FileId(pub [u8; 20]); + +impl FileId { + pub fn to_base16(&self) -> String { + self.0 + .iter() + .map(|b| format!("{:02x}", b)) + .collect::>() + .concat() + } +} + +impl fmt::Debug for FileId { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_tuple("FileId").field(&self.to_base16()).finish() + } +} + +impl fmt::Display for FileId { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&self.to_base16()) + } +} diff --git a/core/src/util/int128.rs b/core/src/util/int128.rs deleted file mode 100644 index 9cfbaf3b..00000000 --- a/core/src/util/int128.rs +++ /dev/null @@ -1,102 +0,0 @@ -use std; - -#[derive(Debug,Copy,Clone,PartialEq,Eq,Hash)] -#[allow(non_camel_case_types)] -pub struct u128 { - high: u64, - low: u64, -} - -impl u128 { - pub fn zero() -> u128 { - u128::from_parts(0, 0) - } - - pub fn from_parts(high: u64, low: u64) -> u128 { - u128 { - high: high, - low: low, - } - } - - pub fn parts(&self) -> (u64, u64) { - (self.high, self.low) - } -} - -impl std::ops::Add for u128 { - type Output = u128; - fn add(self, rhs: u128) -> u128 { - let low = self.low + rhs.low; - let high = self.high + rhs.high + - if low < self.low { - 1 - } else { - 0 - }; - - u128::from_parts(high, low) - } -} - -impl<'a> std::ops::Add<&'a u128> for u128 { - type Output = u128; - fn add(self, rhs: &'a u128) -> u128 { - let low = self.low + rhs.low; - let high = self.high + rhs.high + - if low < self.low { - 1 - } else { - 0 - }; - - u128::from_parts(high, low) - } -} - -impl std::convert::From for u128 { - fn from(n: u8) -> u128 { - u128::from_parts(0, n as u64) - } -} - - -impl std::ops::Mul for u128 { - type Output = u128; - - fn mul(self, rhs: u128) -> u128 { - let top: [u64; 4] = [self.high >> 32, - self.high & 0xFFFFFFFF, - self.low >> 32, - self.low & 0xFFFFFFFF]; - - let bottom: [u64; 4] = [rhs.high >> 32, - rhs.high & 0xFFFFFFFF, - rhs.low >> 32, - rhs.low & 0xFFFFFFFF]; - - let mut rows = [u128::zero(); 16]; - for i in 0..4 { - for j in 0..4 { - let shift = i + j; - let product = top[3 - i] * bottom[3 - j]; - let (high, low) = match shift { - 0 => (0, product), - 1 => (product >> 32, product << 32), - 2 => (product, 0), - 3 => (product << 32, 0), - _ => { - if product == 0 { - (0, 0) - } else { - panic!("Overflow on mul {:?} {:?} ({} {})", self, rhs, i, j) - } - } - }; - rows[j * 4 + i] = u128::from_parts(high, low); - } - } - - rows.iter().fold(u128::zero(), std::ops::Add::add) - } -} diff --git a/core/src/util/mod.rs b/core/src/util/mod.rs index 01a3a506..c91cac97 100644 --- a/core/src/util/mod.rs +++ b/core/src/util/mod.rs @@ -1,53 +1,12 @@ use num_bigint::BigUint; -use num_traits::{Zero, One}; use num_integer::Integer; -use rand::{Rng, Rand}; -use std::io; +use num_traits::{One, Zero}; +use rand::Rng; use std::mem; use std::ops::{Mul, Rem, Shr}; -use std::fs; -use std::path::Path; -use std::process::Command; -use std::time::{UNIX_EPOCH, SystemTime}; -mod int128; -mod spotify_id; -mod subfile; - -pub use util::int128::u128; -pub use util::spotify_id::{SpotifyId, FileId}; -pub use util::subfile::Subfile; - -pub fn rand_vec(rng: &mut G, size: usize) -> Vec { - rng.gen_iter().take(size).collect() -} - -pub fn now_ms() -> i64 { - let dur = match SystemTime::now().duration_since(UNIX_EPOCH) { - Ok(dur) => dur, - Err(err) => err.duration(), - }; - (dur.as_secs() * 1000 + (dur.subsec_nanos() / 1000_000) as u64) as i64 -} - -pub fn mkdir_existing(path: &Path) -> io::Result<()> { - fs::create_dir(path).or_else(|err| { - if err.kind() == io::ErrorKind::AlreadyExists { - Ok(()) - } else { - Err(err) - } - }) -} - -pub fn run_program(program: &str) { - info!("Running {}", program); - let mut v: Vec<&str> = program.split_whitespace().collect(); - let status = Command::new(&v.remove(0)) - .args(&v) - .status() - .expect("program failed to start"); - info!("Exit status: {}", status); +pub fn rand_vec(rng: &mut G, size: usize) -> Vec { + ::std::iter::repeat(()).map(|()| rng.gen()).take(size).collect() } pub fn powm(base: &BigUint, exp: &BigUint, modulus: &BigUint) -> BigUint { @@ -66,34 +25,8 @@ pub fn powm(base: &BigUint, exp: &BigUint, modulus: &BigUint) -> BigUint { result } -pub struct StrChunks<'s>(&'s str, usize); - -pub trait StrChunksExt { - fn chunks(&self, size: usize) -> StrChunks; -} - -impl StrChunksExt for str { - fn chunks(&self, size: usize) -> StrChunks { - StrChunks(self, size) - } -} - -impl<'s> Iterator for StrChunks<'s> { - type Item = &'s str; - fn next(&mut self) -> Option<&'s str> { - let &mut StrChunks(data, size) = self; - if data.is_empty() { - None - } else { - let ret = Some(&data[..size]); - self.0 = &data[size..]; - ret - } - } -} - -pub trait ReadSeek : ::std::io::Read + ::std::io::Seek { } -impl ReadSeek for T { } +pub trait ReadSeek: ::std::io::Read + ::std::io::Seek {} +impl ReadSeek for T {} pub trait Seq { fn next(&self) -> Self; @@ -112,7 +45,7 @@ impl_seq!(u8 u16 u32 u64 usize); #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Default)] pub struct SeqGenerator(T); -impl SeqGenerator { +impl SeqGenerator { pub fn new(value: T) -> Self { SeqGenerator(value) } diff --git a/core/src/util/spotify_id.rs b/core/src/util/spotify_id.rs deleted file mode 100644 index dc22a972..00000000 --- a/core/src/util/spotify_id.rs +++ /dev/null @@ -1,103 +0,0 @@ -use std; -use std::fmt; -use util::u128; -use byteorder::{BigEndian, ByteOrder}; -use std::ascii::AsciiExt; - -#[derive(Debug,Copy,Clone,PartialEq,Eq,Hash)] -pub struct SpotifyId(u128); - -const BASE62_DIGITS: &'static [u8] = - b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; -const BASE16_DIGITS: &'static [u8] = b"0123456789abcdef"; - -impl SpotifyId { - pub fn from_base16(id: &str) -> SpotifyId { - assert!(id.is_ascii()); - let data = id.as_bytes(); - - let mut n: u128 = u128::zero(); - for c in data { - let d = BASE16_DIGITS.iter().position(|e| e == c).unwrap() as u8; - n = n * u128::from(16); - n = n + u128::from(d); - } - - SpotifyId(n) - } - - pub fn from_base62(id: &str) -> SpotifyId { - assert!(id.is_ascii()); - let data = id.as_bytes(); - - let mut n: u128 = u128::zero(); - for c in data { - let d = BASE62_DIGITS.iter().position(|e| e == c).unwrap() as u8; - n = n * u128::from(62); - n = n + u128::from(d); - } - - SpotifyId(n) - } - - pub fn from_raw(data: &[u8]) -> SpotifyId { - assert_eq!(data.len(), 16); - - let high = BigEndian::read_u64(&data[0..8]); - let low = BigEndian::read_u64(&data[8..16]); - - SpotifyId(u128::from_parts(high, low)) - } - - pub fn to_base16(&self) -> String { - let &SpotifyId(ref n) = self; - let (high, low) = n.parts(); - - let mut data = [0u8; 32]; - for i in 0..16 { - data[31 - i] = BASE16_DIGITS[(low.wrapping_shr(4 * i as u32) & 0xF) as usize]; - } - for i in 0..16 { - data[15 - i] = BASE16_DIGITS[(high.wrapping_shr(4 * i as u32) & 0xF) as usize]; - } - - std::str::from_utf8(&data).unwrap().to_owned() - } - - pub fn to_raw(&self) -> [u8; 16] { - let &SpotifyId(ref n) = self; - let (high, low) = n.parts(); - - let mut data = [0u8; 16]; - - BigEndian::write_u64(&mut data[0..8], high); - BigEndian::write_u64(&mut data[8..16], low); - - data - } -} - -#[derive(Copy,Clone,PartialEq,Eq,PartialOrd,Ord,Hash)] -pub struct FileId(pub [u8; 20]); - -impl FileId { - pub fn to_base16(&self) -> String { - self.0 - .iter() - .map(|b| format!("{:02x}", b)) - .collect::>() - .concat() - } -} - -impl fmt::Debug for FileId { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("FileId").field(&self.to_base16()).finish() - } -} - -impl fmt::Display for FileId { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str(&self.to_base16()) - } -} diff --git a/core/src/util/subfile.rs b/core/src/util/subfile.rs deleted file mode 100644 index 81d5d916..00000000 --- a/core/src/util/subfile.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::io::{Read, Seek, SeekFrom, Result}; - -pub struct Subfile { - stream: T, - offset: u64, -} - -impl Subfile { - pub fn new(mut stream: T, offset: u64) -> Subfile { - stream.seek(SeekFrom::Start(offset)).unwrap(); - Subfile { - stream: stream, - offset: offset, - } - } -} - -impl Read for Subfile { - fn read(&mut self, buf: &mut [u8]) -> Result { - self.stream.read(buf) - } -} - -impl Seek for Subfile { - fn seek(&mut self, mut pos: SeekFrom) -> Result { - pos = match pos { - SeekFrom::Start(offset) => SeekFrom::Start(offset + self.offset), - x => x, - }; - - let newpos = try!(self.stream.seek(pos)); - if newpos > self.offset { - Ok(newpos - self.offset) - } else { - Ok(0) - } - } -} diff --git a/core/src/volume.rs b/core/src/volume.rs new file mode 100644 index 00000000..24a3d3f9 --- /dev/null +++ b/core/src/volume.rs @@ -0,0 +1,31 @@ +use std::fs::File; +use std::io::{Read, Write}; +use std::path::Path; + +#[derive(Clone, Copy, Debug)] +pub struct Volume { + pub volume: u16, +} + +impl Volume { + // read volume from file + fn from_reader(mut reader: R) -> u16 { + let mut contents = String::new(); + reader.read_to_string(&mut contents).unwrap(); + contents.trim().parse::().unwrap() + } + + pub(crate) fn from_file>(path: P) -> Option { + File::open(path).ok().map(Volume::from_reader) + } + + // write volume to file + fn save_to_writer(&self, writer: &mut W) { + writer.write_all(self.volume.to_string().as_bytes()).unwrap(); + } + + pub(crate) fn save_to_file>(&self, path: P) { + let mut file = File::create(path).unwrap(); + self.save_to_writer(&mut file) + } +} diff --git a/docs/connection.md b/docs/connection.md index 8bc8b480..e64fac7f 100644 --- a/docs/connection.md +++ b/docs/connection.md @@ -6,7 +6,7 @@ An AP is randomly picked from that list to connect to. The connection is done using a bare TCP socket. Despite many APs using ports 80 and 443, neither HTTP nor TLS are used to connect. -If `http://apresolve.spotify.com` is unresponsive, `ap.spotify.com:80` is used as a fallback. +If `http://apresolve.spotify.com` is unresponsive, `ap.spotify.com:443` is used as a fallback. ## Connection Hello The first 3 packets exchanged are unencrypted, and have the following format : diff --git a/examples/play.rs b/examples/play.rs index d6092732..87f68825 100644 --- a/examples/play.rs +++ b/examples/play.rs @@ -5,12 +5,13 @@ use std::env; use tokio_core::reactor::Core; use librespot::core::authentication::Credentials; -use librespot::core::config::{PlayerConfig, SessionConfig}; +use librespot::core::config::SessionConfig; use librespot::core::session::Session; -use librespot::core::util::SpotifyId; +use librespot::core::spotify_id::SpotifyId; +use librespot::playback::config::PlayerConfig; -use librespot::audio_backend; -use librespot::player::Player; +use librespot::playback::audio_backend; +use librespot::playback::player::Player; fn main() { let mut core = Core::new().unwrap(); @@ -19,7 +20,7 @@ fn main() { let session_config = SessionConfig::default(); let player_config = PlayerConfig::default(); - let args : Vec<_> = env::args().collect(); + let args: Vec<_> = env::args().collect(); if args.len() != 4 { println!("Usage: {} USERNAME PASSWORD TRACK", args[0]); } @@ -27,14 +28,16 @@ fn main() { let password = args[2].to_owned(); let credentials = Credentials::with_password(username, password); - let track = SpotifyId::from_base62(&args[3]); + let track = SpotifyId::from_base62(&args[3]).unwrap(); let backend = audio_backend::find(None).unwrap(); println!("Connecting .."); - let session = core.run(Session::connect(session_config, credentials, None, handle)).unwrap(); + let session = core + .run(Session::connect(session_config, credentials, None, handle)) + .unwrap(); - let player = Player::new(player_config, session.clone(), None, move || (backend)(None)); + let (player, _) = Player::new(player_config, session.clone(), None, move || (backend)(None)); println!("Playing..."); core.run(player.load(track, true, 0)).unwrap(); diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index 40b23fce..51e44191 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.0" authors = ["Paul Lietar "] [dependencies] -byteorder = "1.0" -futures = "0.1.8" -linear-map = "1.0" -protobuf = "1.1" +byteorder = "1.3" +futures = "0.1" +linear-map = "1.2" +protobuf = "2.8.*" [dependencies.librespot-core] path = "../core" diff --git a/metadata/src/cover.rs b/metadata/src/cover.rs index ea3c197b..0ef186a0 100644 --- a/metadata/src/cover.rs +++ b/metadata/src/cover.rs @@ -3,7 +3,7 @@ use std::io::Write; use core::channel::ChannelData; use core::session::Session; -use core::util::FileId; +use core::spotify_id::FileId; pub fn get(session: &Session, file: FileId) -> ChannelData { let (channel_id, channel) = session.channel().allocate(); diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index 3ad5c4e5..2d62c03c 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -8,12 +8,12 @@ extern crate librespot_protocol as protocol; pub mod cover; -use futures::{Future, BoxFuture}; +use futures::Future; use linear_map::LinearMap; use core::mercury::MercuryError; use core::session::Session; -use core::util::{SpotifyId, FileId, StrChunksExt}; +use core::spotify_id::{FileId, SpotifyId}; pub use protocol::metadata::AudioFile_Format as FileFormat; @@ -22,7 +22,8 @@ fn countrylist_contains(list: &str, country: &str) -> bool { } fn parse_restrictions<'s, I>(restrictions: I, country: &str, catalogue: &str) -> bool - where I: IntoIterator +where + I: IntoIterator, { let mut forbidden = "".to_string(); let mut has_forbidden = false; @@ -30,9 +31,9 @@ fn parse_restrictions<'s, I>(restrictions: I, country: &str, catalogue: &str) -> let mut allowed = "".to_string(); let mut has_allowed = false; - let rs = restrictions.into_iter().filter(|r| - r.get_catalogue_str().contains(&catalogue.to_owned()) - ); + let rs = restrictions + .into_iter() + .filter(|r| r.get_catalogue_str().contains(&catalogue.to_owned())); for r in rs { if r.has_countries_forbidden() { @@ -46,28 +47,28 @@ fn parse_restrictions<'s, I>(restrictions: I, country: &str, catalogue: &str) -> } } - (has_forbidden || has_allowed) && - (!has_forbidden || !countrylist_contains(forbidden.as_str(), country)) && - (!has_allowed || countrylist_contains(allowed.as_str(), country)) + (has_forbidden || has_allowed) + && (!has_forbidden || !countrylist_contains(forbidden.as_str(), country)) + && (!has_allowed || countrylist_contains(allowed.as_str(), country)) } -pub trait Metadata : Send + Sized + 'static { - type Message: protobuf::MessageStatic; +pub trait Metadata: Send + Sized + 'static { + type Message: protobuf::Message; fn base_url() -> &'static str; fn parse(msg: &Self::Message, session: &Session) -> Self; - fn get(session: &Session, id: SpotifyId) -> BoxFuture { + fn get(session: &Session, id: SpotifyId) -> Box> { let uri = format!("{}/{}", Self::base_url(), id.to_base16()); let request = session.mercury().get(uri); let session = session.clone(); - request.and_then(move |response| { + Box::new(request.and_then(move |response| { let data = response.payload.first().expect("Empty payload"); let msg: Self::Message = protobuf::parse_from_bytes(data).unwrap(); Ok(Self::parse(&msg, &session)) - }).boxed() + })) } } @@ -75,6 +76,7 @@ pub trait Metadata : Send + Sized + 'static { pub struct Track { pub id: SpotifyId, pub name: String, + pub duration: i32, pub album: SpotifyId, pub artists: Vec, pub files: LinearMap, @@ -108,35 +110,37 @@ impl Metadata for Track { fn parse(msg: &Self::Message, session: &Session) -> Self { let country = session.country(); - let artists = msg.get_artist() - .iter() - .filter(|artist| artist.has_gid()) - .map(|artist| SpotifyId::from_raw(artist.get_gid())) - .collect::>(); - - let files = msg.get_file() - .iter() - .filter(|file| file.has_file_id()) - .map(|file| { - let mut dst = [0u8; 20]; - dst.clone_from_slice(file.get_file_id()); - (file.get_format(), FileId(dst)) - }) - .collect(); + let artists = msg + .get_artist() + .iter() + .filter(|artist| artist.has_gid()) + .map(|artist| SpotifyId::from_raw(artist.get_gid()).unwrap()) + .collect::>(); + + let files = msg + .get_file() + .iter() + .filter(|file| file.has_file_id()) + .map(|file| { + let mut dst = [0u8; 20]; + dst.clone_from_slice(file.get_file_id()); + (file.get_format(), FileId(dst)) + }) + .collect(); Track { - id: SpotifyId::from_raw(msg.get_gid()), + id: SpotifyId::from_raw(msg.get_gid()).unwrap(), name: msg.get_name().to_owned(), - album: SpotifyId::from_raw(msg.get_album().get_gid()), + duration: msg.get_duration(), + album: SpotifyId::from_raw(msg.get_album().get_gid()).unwrap(), artists: artists, files: files, - alternatives: msg.get_alternative() - .iter() - .map(|alt| SpotifyId::from_raw(alt.get_gid())) - .collect(), - available: parse_restrictions(msg.get_restriction(), - &country, - "premium"), + alternatives: msg + .get_alternative() + .iter() + .map(|alt| SpotifyId::from_raw(alt.get_gid()).unwrap()) + .collect(), + available: parse_restrictions(msg.get_restriction(), &country, "premium"), } } } @@ -149,32 +153,35 @@ impl Metadata for Album { } fn parse(msg: &Self::Message, _: &Session) -> Self { - let artists = msg.get_artist() - .iter() - .filter(|artist| artist.has_gid()) - .map(|artist| SpotifyId::from_raw(artist.get_gid())) - .collect::>(); - - let tracks = msg.get_disc() - .iter() - .flat_map(|disc| disc.get_track()) - .filter(|track| track.has_gid()) - .map(|track| SpotifyId::from_raw(track.get_gid())) - .collect::>(); - - let covers = msg.get_cover_group() - .get_image() - .iter() - .filter(|image| image.has_file_id()) - .map(|image| { - let mut dst = [0u8; 20]; - dst.clone_from_slice(image.get_file_id()); - FileId(dst) - }) - .collect::>(); + let artists = msg + .get_artist() + .iter() + .filter(|artist| artist.has_gid()) + .map(|artist| SpotifyId::from_raw(artist.get_gid()).unwrap()) + .collect::>(); + + let tracks = msg + .get_disc() + .iter() + .flat_map(|disc| disc.get_track()) + .filter(|track| track.has_gid()) + .map(|track| SpotifyId::from_raw(track.get_gid()).unwrap()) + .collect::>(); + + let covers = msg + .get_cover_group() + .get_image() + .iter() + .filter(|image| image.has_file_id()) + .map(|image| { + let mut dst = [0u8; 20]; + dst.clone_from_slice(image.get_file_id()); + FileId(dst) + }) + .collect::>(); Album { - id: SpotifyId::from_raw(msg.get_gid()), + id: SpotifyId::from_raw(msg.get_gid()).unwrap(), name: msg.get_name().to_owned(), artists: artists, tracks: tracks, @@ -183,7 +190,6 @@ impl Metadata for Album { } } - impl Metadata for Artist { type Message = protocol::metadata::Artist; @@ -194,25 +200,50 @@ impl Metadata for Artist { fn parse(msg: &Self::Message, session: &Session) -> Self { let country = session.country(); - let top_tracks: Vec = match msg.get_top_track() - .iter() - .find(|tt| !tt.has_country() || countrylist_contains(tt.get_country(), &country)) { - Some(tracks) => { - tracks.get_track() - .iter() - .filter(|track| track.has_gid()) - .map(|track| SpotifyId::from_raw(track.get_gid())) - .collect::>() - }, - None => Vec::new() - }; - + let top_tracks: Vec = match msg + .get_top_track() + .iter() + .find(|tt| !tt.has_country() || countrylist_contains(tt.get_country(), &country)) + { + Some(tracks) => tracks + .get_track() + .iter() + .filter(|track| track.has_gid()) + .map(|track| SpotifyId::from_raw(track.get_gid()).unwrap()) + .collect::>(), + None => Vec::new(), + }; Artist { - id: SpotifyId::from_raw(msg.get_gid()), + id: SpotifyId::from_raw(msg.get_gid()).unwrap(), name: msg.get_name().to_owned(), - top_tracks: top_tracks + top_tracks: top_tracks, } } } +struct StrChunks<'s>(&'s str, usize); + +trait StrChunksExt { + fn chunks(&self, size: usize) -> StrChunks; +} + +impl StrChunksExt for str { + fn chunks(&self, size: usize) -> StrChunks { + StrChunks(self, size) + } +} + +impl<'s> Iterator for StrChunks<'s> { + type Item = &'s str; + fn next(&mut self) -> Option<&'s str> { + let &mut StrChunks(data, size) = self; + if data.is_empty() { + None + } else { + let ret = Some(&data[..size]); + self.0 = &data[size..]; + ret + } + } +} diff --git a/metadata/src/metadata.rs b/metadata/src/metadata.rs deleted file mode 100644 index e69de29b..00000000 diff --git a/playback/Cargo.toml b/playback/Cargo.toml new file mode 100644 index 00000000..b219482a --- /dev/null +++ b/playback/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "librespot-playback" +version = "0.1.0" +authors = ["Sasha Hilton "] + +[dependencies.librespot-audio] +path = "../audio" +[dependencies.librespot-core] +path = "../core" +[dependencies.librespot-metadata] +path = "../metadata" + +[dependencies] +futures = "0.1" +log = "0.4" +byteorder = "1.3" + +alsa = { version = "0.2.1", optional = true } +portaudio-rs = { version = "0.3.0", optional = true } +libpulse-sys = { version = "0.0.0", optional = true } +jack = { version = "0.5.3", optional = true } +libc = { version = "0.2", optional = true } +rodio = { git = "https://github.com/tomaka/rodio", optional = true, default-features = false } +cpal = { version = "0.8", optional = true } +sdl2 = { version = "0.32", optional = true } + +[features] +alsa-backend = ["alsa"] +portaudio-backend = ["portaudio-rs"] +pulseaudio-backend = ["libpulse-sys", "libc"] +jackaudio-backend = ["jack"] +rodio-backend = ["rodio", "cpal"] +sdl-backend = ["sdl2"] diff --git a/playback/src/audio_backend/alsa.rs b/playback/src/audio_backend/alsa.rs new file mode 100644 index 00000000..98e7c8f7 --- /dev/null +++ b/playback/src/audio_backend/alsa.rs @@ -0,0 +1,112 @@ +use super::{Open, Sink}; +use alsa::device_name::HintIter; +use alsa::pcm::{Access, Format, HwParams, PCM}; +use alsa::{Direction, Error, ValueOr}; +use std::ffi::CString; +use std::io; +use std::process::exit; + +pub struct AlsaSink(Option, String); + +fn list_outputs() { + for t in &["pcm", "ctl", "hwdep"] { + println!("{} devices:", t); + let i = HintIter::new(None, &*CString::new(*t).unwrap()).unwrap(); + for a in i { + if let Some(Direction::Playback) = a.direction { + // mimic aplay -L + println!( + "{}\n\t{}\n", + a.name.unwrap(), + a.desc.unwrap().replace("\n", "\n\t") + ); + } + } + } +} + +fn open_device(dev_name: &str) -> Result<(PCM), Box> { + let pcm = PCM::new(dev_name, Direction::Playback, false)?; + // http://www.linuxjournal.com/article/6735?page=0,1#N0x19ab2890.0x19ba78d8 + // latency = period_size * periods / (rate * bytes_per_frame) + // For 16 Bit stereo data, one frame has a length of four bytes. + // 500ms = buffer_size / (44100 * 4) + // buffer_size_bytes = 0.5 * 44100 / 4 + // buffer_size_frames = 0.5 * 44100 = 22050 + { + // Set hardware parameters: 44100 Hz / Stereo / 16 bit + let hwp = HwParams::any(&pcm)?; + + hwp.set_access(Access::RWInterleaved)?; + hwp.set_format(Format::s16())?; + hwp.set_rate(44100, ValueOr::Nearest)?; + hwp.set_channels(2)?; + hwp.set_buffer_size_near(22050)?; // ~ 0.5s latency + pcm.hw_params(&hwp)?; + + let swp = pcm.sw_params_current()?; + swp.set_start_threshold(hwp.get_buffer_size()? - hwp.get_period_size()?)?; + pcm.sw_params(&swp)?; + } + + Ok(pcm) +} + +impl Open for AlsaSink { + fn open(device: Option) -> AlsaSink { + info!("Using alsa sink"); + + let name = match device.as_ref().map(AsRef::as_ref) { + Some("?") => { + println!("Listing available alsa outputs"); + list_outputs(); + exit(0) + } + Some(device) => device, + None => "default", + }.to_string(); + + AlsaSink(None, name) + } +} + +impl Sink for AlsaSink { + fn start(&mut self) -> io::Result<()> { + if self.0.is_none() { + let pcm = open_device(&self.1); + match pcm { + Ok(p) => self.0 = Some(p), + Err(e) => { + error!("Alsa error PCM open {}", e); + return Err(io::Error::new( + io::ErrorKind::Other, + "Alsa error: PCM open failed", + )); + } + } + } + + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + { + let pcm = self.0.as_ref().unwrap(); + pcm.drain().unwrap(); + } + self.0 = None; + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + let pcm = self.0.as_mut().unwrap(); + let io = pcm.io_i16().unwrap(); + + match io.writei(&data) { + Ok(_) => (), + Err(err) => pcm.try_recover(err, false).unwrap(), + } + + Ok(()) + } +} diff --git a/playback/src/audio_backend/jackaudio.rs b/playback/src/audio_backend/jackaudio.rs new file mode 100644 index 00000000..3b118f38 --- /dev/null +++ b/playback/src/audio_backend/jackaudio.rs @@ -0,0 +1,85 @@ +use super::{Open, Sink}; +use jack::prelude::{ + client_options, AsyncClient, AudioOutPort, AudioOutSpec, Client, JackControl, Port, ProcessHandler, + ProcessScope, +}; +use std::io; +use std::sync::mpsc::{sync_channel, Receiver, SyncSender}; + +pub struct JackSink { + send: SyncSender, + active_client: AsyncClient<(), JackData>, +} + +pub struct JackData { + rec: Receiver, + port_l: Port, + port_r: Port, +} + +fn pcm_to_f32(sample: i16) -> f32 { + sample as f32 / 32768.0 +} + +impl ProcessHandler for JackData { + fn process(&mut self, _: &Client, ps: &ProcessScope) -> JackControl { + // get output port buffers + let mut out_r = AudioOutPort::new(&mut self.port_r, ps); + let mut out_l = AudioOutPort::new(&mut self.port_l, ps); + let buf_r: &mut [f32] = &mut out_r; + let buf_l: &mut [f32] = &mut out_l; + // get queue iterator + let mut queue_iter = self.rec.try_iter(); + + let buf_size = buf_r.len(); + for i in 0..buf_size { + buf_r[i] = pcm_to_f32(queue_iter.next().unwrap_or(0)); + buf_l[i] = pcm_to_f32(queue_iter.next().unwrap_or(0)); + } + JackControl::Continue + } +} + +impl Open for JackSink { + fn open(client_name: Option) -> JackSink { + info!("Using jack sink!"); + + let client_name = client_name.unwrap_or("librespot".to_string()); + let (client, _status) = Client::new(&client_name[..], client_options::NO_START_SERVER).unwrap(); + let ch_r = client.register_port("out_0", AudioOutSpec::default()).unwrap(); + let ch_l = client.register_port("out_1", AudioOutSpec::default()).unwrap(); + // buffer for samples from librespot (~10ms) + let (tx, rx) = sync_channel(2 * 1024 * 4); + let jack_data = JackData { + rec: rx, + port_l: ch_l, + port_r: ch_r, + }; + let active_client = AsyncClient::new(client, (), jack_data).unwrap(); + + JackSink { + send: tx, + active_client: active_client, + } + } +} + +impl Sink for JackSink { + fn start(&mut self) -> io::Result<()> { + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + for s in data.iter() { + let res = self.send.send(*s); + if res.is_err() { + error!("jackaudio: cannot write to channel"); + } + } + Ok(()) + } +} diff --git a/src/audio_backend/mod.rs b/playback/src/audio_backend/mod.rs similarity index 56% rename from src/audio_backend/mod.rs rename to playback/src/audio_backend/mod.rs index 1effc05a..bdf309a8 100644 --- a/src/audio_backend/mod.rs +++ b/playback/src/audio_backend/mod.rs @@ -29,25 +29,51 @@ mod pulseaudio; #[cfg(feature = "pulseaudio-backend")] use self::pulseaudio::PulseAudioSink; +#[cfg(feature = "jackaudio-backend")] +mod jackaudio; +#[cfg(feature = "jackaudio-backend")] +use self::jackaudio::JackSink; + +#[cfg(feature = "rodio-backend")] +mod rodio; +#[cfg(feature = "rodio-backend")] +use self::rodio::RodioSink; +#[cfg(feature = "sdl-backend")] +mod sdl; +#[cfg(feature = "sdl-backend")] +use self::sdl::SdlSink; + mod pipe; use self::pipe::StdoutSink; -pub const BACKENDS : &'static [ - (&'static str, fn(Option) -> Box) -] = &[ +pub const BACKENDS: &'static [(&'static str, fn(Option) -> Box)] = &[ #[cfg(feature = "alsa-backend")] ("alsa", mk_sink::), #[cfg(feature = "portaudio-backend")] ("portaudio", mk_sink::), #[cfg(feature = "pulseaudio-backend")] ("pulseaudio", mk_sink::), + #[cfg(feature = "jackaudio-backend")] + ("jackaudio", mk_sink::), + #[cfg(feature = "rodio-backend")] + ("rodio", mk_sink::), + #[cfg(feature = "sdl-backend")] + ("sdl", mk_sink::), ("pipe", mk_sink::), ]; pub fn find(name: Option) -> Option) -> Box> { if let Some(name) = name { - BACKENDS.iter().find(|backend| name == backend.0).map(|backend| backend.1) + BACKENDS + .iter() + .find(|backend| name == backend.0) + .map(|backend| backend.1) } else { - Some(BACKENDS.first().expect("No backends were enabled at build time").1) + Some( + BACKENDS + .first() + .expect("No backends were enabled at build time") + .1, + ) } } diff --git a/src/audio_backend/pipe.rs b/playback/src/audio_backend/pipe.rs similarity index 96% rename from src/audio_backend/pipe.rs rename to playback/src/audio_backend/pipe.rs index 10461cfb..b25b5eaf 100644 --- a/src/audio_backend/pipe.rs +++ b/playback/src/audio_backend/pipe.rs @@ -9,7 +9,7 @@ pub struct StdoutSink(Box); impl Open for StdoutSink { fn open(path: Option) -> StdoutSink { if let Some(path) = path { - let file = OpenOptions::new().write(true).open(path).unwrap(); + let file = OpenOptions::new().write(true).open(path).expect("opened file for writing"); StdoutSink(Box::new(file)) } else { StdoutSink(Box::new(io::stdout())) @@ -37,4 +37,3 @@ impl Sink for StdoutSink { Ok(()) } } - diff --git a/src/audio_backend/portaudio.rs b/playback/src/audio_backend/portaudio.rs similarity index 69% rename from src/audio_backend/portaudio.rs rename to playback/src/audio_backend/portaudio.rs index 7b69e1ab..19a0bf09 100644 --- a/src/audio_backend/portaudio.rs +++ b/playback/src/audio_backend/portaudio.rs @@ -1,21 +1,21 @@ use super::{Open, Sink}; +use portaudio_rs; +use portaudio_rs::device::{get_default_output_index, DeviceIndex, DeviceInfo}; +use portaudio_rs::stream::*; use std::io; use std::process::exit; use std::time::Duration; -use portaudio_rs; -use portaudio_rs::stream::*; -use portaudio_rs::device::{DeviceIndex, DeviceInfo, get_default_output_index}; -pub struct PortAudioSink<'a>(Option>, StreamParameters); +pub struct PortAudioSink<'a>( + Option>, + StreamParameters, +); -fn output_devices() -> Box> { +fn output_devices() -> Box> { let count = portaudio_rs::device::get_count().unwrap(); let devices = (0..count) - .filter_map(|idx| { - portaudio_rs::device::get_info(idx).map(|info| (idx, info)) - }).filter(|&(_, ref info)| { - info.max_output_channels > 0 - }); + .filter_map(|idx| portaudio_rs::device::get_info(idx).map(|info| (idx, info))) + .filter(|&(_, ref info)| info.max_output_channels > 0); Box::new(devices) } @@ -38,9 +38,8 @@ fn find_output(device: &str) -> Option { .map(|(idx, _)| idx) } -impl <'a> Open for PortAudioSink<'a> { +impl<'a> Open for PortAudioSink<'a> { fn open(device: Option) -> PortAudioSink<'a> { - debug!("Using PortAudio sink"); portaudio_rs::initialize().unwrap(); @@ -71,16 +70,19 @@ impl <'a> Open for PortAudioSink<'a> { } } -impl <'a> Sink for PortAudioSink<'a> { +impl<'a> Sink for PortAudioSink<'a> { fn start(&mut self) -> io::Result<()> { if self.0.is_none() { - self.0 = Some(Stream::open( - None, Some(self.1), - 44100.0, - FRAMES_PER_BUFFER_UNSPECIFIED, - StreamFlags::empty(), - None - ).unwrap());; + self.0 = Some( + Stream::open( + None, + Some(self.1), + 44100.0, + FRAMES_PER_BUFFER_UNSPECIFIED, + StreamFlags::empty(), + None, + ).unwrap(), + );; } self.0.as_mut().unwrap().start().unwrap(); @@ -94,8 +96,7 @@ impl <'a> Sink for PortAudioSink<'a> { fn write(&mut self, data: &[i16]) -> io::Result<()> { match self.0.as_mut().unwrap().write(data) { Ok(_) => (), - Err(portaudio_rs::PaError::OutputUnderflowed) => - error!("PortAudio write underflow"), + Err(portaudio_rs::PaError::OutputUnderflowed) => error!("PortAudio write underflow"), Err(e) => panic!("PA Error {}", e), }; @@ -103,7 +104,7 @@ impl <'a> Sink for PortAudioSink<'a> { } } -impl <'a> Drop for PortAudioSink<'a> { +impl<'a> Drop for PortAudioSink<'a> { fn drop(&mut self) { portaudio_rs::terminate().unwrap(); } diff --git a/playback/src/audio_backend/pulseaudio.rs b/playback/src/audio_backend/pulseaudio.rs new file mode 100644 index 00000000..88f62806 --- /dev/null +++ b/playback/src/audio_backend/pulseaudio.rs @@ -0,0 +1,124 @@ +use super::{Open, Sink}; +use libc; +use libpulse_sys::*; +use std::ffi::CStr; +use std::ffi::CString; +use std::io; +use std::mem; +use std::ptr::{null, null_mut}; + +pub struct PulseAudioSink { + s: *mut pa_simple, + ss: pa_sample_spec, + name: CString, + desc: CString, +} + +fn call_pulseaudio(f: F, fail_check: FailCheck, kind: io::ErrorKind) -> io::Result +where + T: Copy, + F: Fn(*mut libc::c_int) -> T, + FailCheck: Fn(T) -> bool, +{ + let mut error: libc::c_int = 0; + let ret = f(&mut error); + if fail_check(ret) { + let err_cstr = unsafe { CStr::from_ptr(pa_strerror(error)) }; + let errstr = err_cstr.to_string_lossy().into_owned(); + Err(io::Error::new(kind, errstr)) + } else { + Ok(ret) + } +} + +impl PulseAudioSink { + fn free_connection(&mut self) { + if self.s != null_mut() { + unsafe { + pa_simple_free(self.s); + } + self.s = null_mut(); + } + } +} + +impl Drop for PulseAudioSink { + fn drop(&mut self) { + self.free_connection(); + } +} + +impl Open for PulseAudioSink { + fn open(device: Option) -> PulseAudioSink { + debug!("Using PulseAudio sink"); + + if device.is_some() { + panic!("pulseaudio sink does not support specifying a device name"); + } + + let ss = pa_sample_spec { + format: PA_SAMPLE_S16LE, + channels: 2, // stereo + rate: 44100, + }; + + let name = CString::new("librespot").unwrap(); + let description = CString::new("Spotify endpoint").unwrap(); + + PulseAudioSink { + s: null_mut(), + ss: ss, + name: name, + desc: description, + } + } +} + +impl Sink for PulseAudioSink { + fn start(&mut self) -> io::Result<()> { + if self.s == null_mut() { + self.s = call_pulseaudio( + |err| unsafe { + pa_simple_new( + null(), // Use the default server. + self.name.as_ptr(), // Our application's name. + PA_STREAM_PLAYBACK, + null(), // Use the default device. + self.desc.as_ptr(), // desc of our stream. + &self.ss, // Our sample format. + null(), // Use default channel map + null(), // Use default buffering attributes. + err, + ) + }, + |ptr| ptr == null_mut(), + io::ErrorKind::ConnectionRefused, + )?; + } + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + self.free_connection(); + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + if self.s == null_mut() { + Err(io::Error::new( + io::ErrorKind::NotConnected, + "Not connected to pulseaudio", + )) + } else { + let ptr = data.as_ptr() as *const libc::c_void; + let len = data.len() as usize * mem::size_of::(); + assert!(len > 0); + call_pulseaudio( + |err| unsafe { pa_simple_write(self.s, ptr, len, err) }, + |ret| ret < 0, + io::ErrorKind::BrokenPipe, + )?; + Ok(()) + } + } +} diff --git a/playback/src/audio_backend/rodio.rs b/playback/src/audio_backend/rodio.rs new file mode 100644 index 00000000..c4b9c927 --- /dev/null +++ b/playback/src/audio_backend/rodio.rs @@ -0,0 +1,115 @@ +use super::{Open, Sink}; +extern crate rodio; +extern crate cpal; +use std::{io, thread, time}; +use std::process::exit; + +pub struct RodioSink { + rodio_sink: rodio::Sink, +} + +fn list_formats(ref device: &rodio::Device) { + let default_fmt = match device.default_output_format() { + Ok(fmt) => cpal::SupportedFormat::from(fmt), + Err(e) => { + warn!("Error getting default rodio::Sink format: {:?}", e); + return; + }, + }; + + let mut output_formats = match device.supported_output_formats() { + Ok(f) => f.peekable(), + Err(e) => { + warn!("Error getting supported rodio::Sink formats: {:?}", e); + return; + }, + }; + + if output_formats.peek().is_some() { + debug!(" Available formats:"); + for format in output_formats { + let s = format!("{}ch, {:?}, min {:?}, max {:?}", format.channels, format.data_type, format.min_sample_rate, format.max_sample_rate); + if format == default_fmt { + debug!(" (default) {}", s); + } else { + debug!(" {:?}", format); + } + } + } +} + +fn list_outputs() { + let default_device = rodio::default_output_device().unwrap(); + println!("Default Audio Device:\n {}", default_device.name()); + list_formats(&default_device); + + println!("Other Available Audio Devices:"); + for device in rodio::output_devices() { + if device.name() != default_device.name() { + println!(" {}", device.name()); + list_formats(&device); + } + } +} + +impl Open for RodioSink { + fn open(device: Option) -> RodioSink { + debug!("Using rodio sink"); + + let mut rodio_device = rodio::default_output_device().expect("no output device available"); + if device.is_some() { + let device_name = device.unwrap(); + + if device_name == "?".to_string() { + list_outputs(); + exit(0) + } + let mut found = false; + for d in rodio::output_devices() { + if d.name() == device_name { + rodio_device = d; + found = true; + break; + } + } + if !found { + println!("No output sink matching '{}' found.", device_name); + exit(0) + } + } + let sink = rodio::Sink::new(&rodio_device); + + RodioSink { + rodio_sink: sink, + } + } +} + +impl Sink for RodioSink { + fn start(&mut self) -> io::Result<()> { + // More similar to an "unpause" than "play". Doesn't undo "stop". + // self.rodio_sink.play(); + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + // This will immediately stop playback, but the sink is then unusable. + // We just have to let the current buffer play till the end. + // self.rodio_sink.stop(); + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + let source = rodio::buffer::SamplesBuffer::new(2, 44100, data); + self.rodio_sink.append(source); + + // Chunk sizes seem to be about 256 to 3000 ish items long. + // Assuming they're on average 1628 then a half second buffer is: + // 44100 elements --> about 27 chunks + while self.rodio_sink.len() > 26 { + // sleep and wait for rodio to drain a bit + thread::sleep(time::Duration::from_millis(10)); + } + Ok(()) + } +} diff --git a/playback/src/audio_backend/sdl.rs b/playback/src/audio_backend/sdl.rs new file mode 100644 index 00000000..71d19e50 --- /dev/null +++ b/playback/src/audio_backend/sdl.rs @@ -0,0 +1,56 @@ +use super::{Open, Sink}; +use sdl2::audio::{AudioQueue, AudioSpecDesired}; +use std::{io, thread, time}; + +type Channel = i16; + +pub struct SdlSink { + queue: AudioQueue, +} + +impl Open for SdlSink { + fn open(device: Option) -> SdlSink { + debug!("Using SDL sink"); + + if device.is_some() { + panic!("SDL sink does not support specifying a device name"); + } + + let ctx = sdl2::init().expect("Could not init SDL"); + let audio = ctx.audio().expect("Could not init SDL audio subsystem"); + + let desired_spec = AudioSpecDesired { + freq: Some(44_100), + channels: Some(2), + samples: None, + }; + let queue = audio + .open_queue(None, &desired_spec) + .expect("Could not open SDL audio device"); + + SdlSink { queue: queue } + } +} + +impl Sink for SdlSink { + fn start(&mut self) -> io::Result<()> { + self.queue.clear(); + self.queue.resume(); + Ok(()) + } + + fn stop(&mut self) -> io::Result<()> { + self.queue.pause(); + self.queue.clear(); + Ok(()) + } + + fn write(&mut self, data: &[i16]) -> io::Result<()> { + while self.queue.size() > (2 * 2 * 44_100) { + // sleep and wait for sdl thread to drain the queue a bit + thread::sleep(time::Duration::from_millis(10)); + } + self.queue.queue(data); + Ok(()) + } +} diff --git a/playback/src/config.rs b/playback/src/config.rs new file mode 100644 index 00000000..0f711100 --- /dev/null +++ b/playback/src/config.rs @@ -0,0 +1,43 @@ +use std::str::FromStr; + +#[derive(Clone, Copy, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub enum Bitrate { + Bitrate96, + Bitrate160, + Bitrate320, +} + +impl FromStr for Bitrate { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "96" => Ok(Bitrate::Bitrate96), + "160" => Ok(Bitrate::Bitrate160), + "320" => Ok(Bitrate::Bitrate320), + _ => Err(()), + } + } +} + +impl Default for Bitrate { + fn default() -> Bitrate { + Bitrate::Bitrate160 + } +} + +#[derive(Clone, Debug)] +pub struct PlayerConfig { + pub bitrate: Bitrate, + pub normalisation: bool, + pub normalisation_pregain: f32, +} + +impl Default for PlayerConfig { + fn default() -> PlayerConfig { + PlayerConfig { + bitrate: Bitrate::default(), + normalisation: false, + normalisation_pregain: 0.0, + } + } +} diff --git a/playback/src/lib.rs b/playback/src/lib.rs new file mode 100644 index 00000000..557e17ff --- /dev/null +++ b/playback/src/lib.rs @@ -0,0 +1,32 @@ +#[macro_use] +extern crate log; + +extern crate byteorder; +extern crate futures; + +#[cfg(feature = "alsa-backend")] +extern crate alsa; + +#[cfg(feature = "portaudio-rs")] +extern crate portaudio_rs; + +#[cfg(feature = "libpulse-sys")] +extern crate libpulse_sys; + +#[cfg(feature = "jackaudio-backend")] +extern crate jack; + +#[cfg(feature = "sdl-backend")] +extern crate sdl2; + +#[cfg(feature = "libc")] +extern crate libc; + +extern crate librespot_audio as audio; +extern crate librespot_core as core; +extern crate librespot_metadata as metadata; + +pub mod audio_backend; +pub mod config; +pub mod mixer; +pub mod player; diff --git a/playback/src/mixer/alsamixer.rs b/playback/src/mixer/alsamixer.rs new file mode 100644 index 00000000..5c77d470 --- /dev/null +++ b/playback/src/mixer/alsamixer.rs @@ -0,0 +1,78 @@ +use super::AudioFilter; +use super::{Mixer, MixerConfig}; +use std::error::Error; + +use alsa; + +#[derive(Clone)] +pub struct AlsaMixer { + config: MixerConfig, +} + +impl AlsaMixer { + fn map_volume(&self, set_volume: Option) -> Result<(u16), Box> { + let mixer = alsa::mixer::Mixer::new(&self.config.card, false)?; + let sid = alsa::mixer::SelemId::new(&*self.config.mixer, self.config.index); + + let selem = mixer + .find_selem(&sid) + .expect(format!("Couldn't find simple mixer control for {}", self.config.mixer).as_str()); + let (min, max) = selem.get_playback_volume_range(); + let range = (max - min) as f64; + + let new_vol: u16; + + if let Some(vol) = set_volume { + let alsa_volume: i64 = ((vol as f64 / 0xFFFF as f64) * range) as i64 + min; + debug!("Mapping volume {:?} ->> alsa {:?}", vol, alsa_volume); + selem + .set_playback_volume_all(alsa_volume) + .expect("Couldn't set alsa volume"); + new_vol = vol; + } else { + let cur_vol = selem + .get_playback_volume(alsa::mixer::SelemChannelId::mono()) + .expect("Couldn't get current volume"); + new_vol = (((cur_vol - min) as f64 / range) * 0xFFFF as f64) as u16; + debug!("Mapping volume {:?} <<- alsa {:?}", new_vol, cur_vol); + } + + Ok(new_vol) + } +} + +impl Mixer for AlsaMixer { + fn open(config: Option) -> AlsaMixer { + let config = config.unwrap_or_default(); + info!( + "Setting up new mixer: card:{} mixer:{} index:{}", + config.card, config.mixer, config.index + ); + AlsaMixer { config: config } + } + + fn start(&self) {} + + fn stop(&self) {} + + fn volume(&self) -> u16 { + match self.map_volume(None) { + Ok(vol) => vol, + Err(e) => { + error!("Error getting volume for <{}>, {:?}", self.config.card, e); + 0 + } + } + } + + fn set_volume(&self, volume: u16) { + match self.map_volume(Some(volume)) { + Ok(_) => (), + Err(e) => error!("Error setting volume for <{}>, {:?}", self.config.card, e), + } + } + + fn get_audio_filter(&self) -> Option> { + None + } +} diff --git a/playback/src/mixer/mod.rs b/playback/src/mixer/mod.rs new file mode 100644 index 00000000..f19a8661 --- /dev/null +++ b/playback/src/mixer/mod.rs @@ -0,0 +1,53 @@ +pub trait Mixer: Send { + fn open(Option) -> Self + where + Self: Sized; + fn start(&self); + fn stop(&self); + fn set_volume(&self, volume: u16); + fn volume(&self) -> u16; + fn get_audio_filter(&self) -> Option> { + None + } +} + +pub trait AudioFilter { + fn modify_stream(&self, data: &mut [i16]); +} + +#[cfg(feature = "alsa-backend")] +pub mod alsamixer; +#[cfg(feature = "alsa-backend")] +use self::alsamixer::AlsaMixer; + +#[derive(Debug, Clone)] +pub struct MixerConfig { + pub card: String, + pub mixer: String, + pub index: u32, +} + +impl Default for MixerConfig { + fn default() -> MixerConfig { MixerConfig { + card: String::from("default"), + mixer: String::from("PCM"), + index: 0, + } + } +} + +pub mod softmixer; +use self::softmixer::SoftMixer; + +fn mk_sink(device: Option) -> Box { + Box::new(M::open(device)) +} + +pub fn find>(name: Option) -> Option) -> Box> { + match name.as_ref().map(AsRef::as_ref) { + None | Some("softvol") => Some(mk_sink::), + #[cfg(feature = "alsa-backend")] + Some("alsa") => Some(mk_sink::), + _ => None, + } +} diff --git a/src/mixer/softmixer.rs b/playback/src/mixer/softmixer.rs similarity index 70% rename from src/mixer/softmixer.rs rename to playback/src/mixer/softmixer.rs index 1637537b..4b969785 100644 --- a/src/mixer/softmixer.rs +++ b/playback/src/mixer/softmixer.rs @@ -1,24 +1,22 @@ -use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; -use super::Mixer; use super::AudioFilter; +use super::{Mixer, MixerConfig}; #[derive(Clone)] pub struct SoftMixer { - volume: Arc + volume: Arc, } impl Mixer for SoftMixer { - fn open() -> SoftMixer { + fn open(_: Option) -> SoftMixer { SoftMixer { - volume: Arc::new(AtomicUsize::new(0xFFFF)) + volume: Arc::new(AtomicUsize::new(0xFFFF)), } } - fn start(&self) { - } - fn stop(&self) { - } + fn start(&self) {} + fn stop(&self) {} fn volume(&self) -> u16 { self.volume.load(Ordering::Relaxed) as u16 } @@ -26,12 +24,14 @@ impl Mixer for SoftMixer { self.volume.store(volume as usize, Ordering::Relaxed); } fn get_audio_filter(&self) -> Option> { - Some(Box::new(SoftVolumeApplier { volume: self.volume.clone() })) + Some(Box::new(SoftVolumeApplier { + volume: self.volume.clone(), + })) } } struct SoftVolumeApplier { - volume: Arc + volume: Arc, } impl AudioFilter for SoftVolumeApplier { diff --git a/playback/src/player.rs b/playback/src/player.rs new file mode 100644 index 00000000..a421c9ab --- /dev/null +++ b/playback/src/player.rs @@ -0,0 +1,654 @@ +use byteorder::{LittleEndian, ReadBytesExt}; +use futures; +use futures::sync::oneshot; +use futures::{future, Future}; +use std; +use std::borrow::Cow; +use std::io::{Read, Result, Seek, SeekFrom}; +use std::mem; +use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError}; +use std::thread; +use std::time::Duration; + +use config::{Bitrate, PlayerConfig}; +use core::session::Session; +use core::spotify_id::SpotifyId; + +use audio::{AudioDecrypt, AudioFile}; +use audio::{VorbisDecoder, VorbisPacket}; +use audio_backend::Sink; +use metadata::{FileFormat, Metadata, Track}; +use mixer::AudioFilter; + +pub struct Player { + commands: Option>, + thread_handle: Option>, +} + +struct PlayerInternal { + session: Session, + config: PlayerConfig, + commands: std::sync::mpsc::Receiver, + + state: PlayerState, + sink: Box, + sink_running: bool, + audio_filter: Option>, + event_sender: futures::sync::mpsc::UnboundedSender, +} + +enum PlayerCommand { + Load(SpotifyId, bool, u32, oneshot::Sender<()>), + Play, + Pause, + Stop, + Seek(u32), +} + +#[derive(Debug, Clone)] +pub enum PlayerEvent { + Started { + track_id: SpotifyId, + }, + + Changed { + old_track_id: SpotifyId, + new_track_id: SpotifyId, + }, + + Stopped { + track_id: SpotifyId, + }, +} + +type PlayerEventChannel = futures::sync::mpsc::UnboundedReceiver; + +#[derive(Clone, Copy, Debug)] +struct NormalisationData { + track_gain_db: f32, + track_peak: f32, + album_gain_db: f32, + album_peak: f32, +} + +impl NormalisationData { + fn parse_from_file(mut file: T) -> Result { + const SPOTIFY_NORMALIZATION_HEADER_START_OFFSET: u64 = 144; + file.seek(SeekFrom::Start(SPOTIFY_NORMALIZATION_HEADER_START_OFFSET)) + .unwrap(); + + let track_gain_db = file.read_f32::().unwrap(); + let track_peak = file.read_f32::().unwrap(); + let album_gain_db = file.read_f32::().unwrap(); + let album_peak = file.read_f32::().unwrap(); + + let r = NormalisationData { + track_gain_db: track_gain_db, + track_peak: track_peak, + album_gain_db: album_gain_db, + album_peak: album_peak, + }; + + Ok(r) + } + + fn get_factor(config: &PlayerConfig, data: NormalisationData) -> f32 { + let mut normalisation_factor = + f32::powf(10.0, (data.track_gain_db + config.normalisation_pregain) / 20.0); + + if normalisation_factor * data.track_peak > 1.0 { + warn!("Reducing normalisation factor to prevent clipping. Please add negative pregain to avoid."); + normalisation_factor = 1.0 / data.track_peak; + } + + debug!("Normalisation Data: {:?}", data); + debug!("Applied normalisation factor: {}", normalisation_factor); + + normalisation_factor + } +} + +impl Player { + pub fn new( + config: PlayerConfig, + session: Session, + audio_filter: Option>, + sink_builder: F, + ) -> (Player, PlayerEventChannel) + where + F: FnOnce() -> Box + Send + 'static, + { + let (cmd_tx, cmd_rx) = std::sync::mpsc::channel(); + let (event_sender, event_receiver) = futures::sync::mpsc::unbounded(); + + let handle = thread::spawn(move || { + debug!("new Player[{}]", session.session_id()); + + let internal = PlayerInternal { + session: session, + config: config, + commands: cmd_rx, + + state: PlayerState::Stopped, + sink: sink_builder(), + sink_running: false, + audio_filter: audio_filter, + event_sender: event_sender, + }; + + internal.run(); + }); + + ( + Player { + commands: Some(cmd_tx), + thread_handle: Some(handle), + }, + event_receiver, + ) + } + + fn command(&self, cmd: PlayerCommand) { + self.commands.as_ref().unwrap().send(cmd).unwrap(); + } + + pub fn load( + &self, + track: SpotifyId, + start_playing: bool, + position_ms: u32, + ) -> oneshot::Receiver<()> { + let (tx, rx) = oneshot::channel(); + self.command(PlayerCommand::Load(track, start_playing, position_ms, tx)); + + rx + } + + pub fn play(&self) { + self.command(PlayerCommand::Play) + } + + pub fn pause(&self) { + self.command(PlayerCommand::Pause) + } + + pub fn stop(&self) { + self.command(PlayerCommand::Stop) + } + + pub fn seek(&self, position_ms: u32) { + self.command(PlayerCommand::Seek(position_ms)); + } +} + +impl Drop for Player { + fn drop(&mut self) { + debug!("Shutting down player thread ..."); + self.commands = None; + if let Some(handle) = self.thread_handle.take() { + match handle.join() { + Ok(_) => (), + Err(_) => error!("Player thread panicked!"), + } + } + } +} + +type Decoder = VorbisDecoder>>; +enum PlayerState { + Stopped, + Paused { + track_id: SpotifyId, + decoder: Decoder, + end_of_track: oneshot::Sender<()>, + normalisation_factor: f32, + }, + Playing { + track_id: SpotifyId, + decoder: Decoder, + end_of_track: oneshot::Sender<()>, + normalisation_factor: f32, + }, + EndOfTrack { + track_id: SpotifyId, + }, + Invalid, +} + +impl PlayerState { + fn is_playing(&self) -> bool { + use self::PlayerState::*; + match *self { + Stopped | EndOfTrack { .. } | Paused { .. } => false, + Playing { .. } => true, + Invalid => panic!("invalid state"), + } + } + + fn decoder(&mut self) -> Option<&mut Decoder> { + use self::PlayerState::*; + match *self { + Stopped | EndOfTrack { .. } => None, + Paused { ref mut decoder, .. } | Playing { ref mut decoder, .. } => Some(decoder), + Invalid => panic!("invalid state"), + } + } + + fn playing_to_end_of_track(&mut self) { + use self::PlayerState::*; + match mem::replace(self, Invalid) { + Playing { + track_id, + end_of_track, + .. + } => { + let _ = end_of_track.send(()); + *self = EndOfTrack { track_id }; + } + _ => panic!("Called playing_to_end_of_track in non-playing state."), + } + } + + fn paused_to_playing(&mut self) { + use self::PlayerState::*; + match ::std::mem::replace(self, Invalid) { + Paused { + track_id, + decoder, + end_of_track, + normalisation_factor, + } => { + *self = Playing { + track_id: track_id, + decoder: decoder, + end_of_track: end_of_track, + normalisation_factor: normalisation_factor, + }; + } + _ => panic!("invalid state"), + } + } + + fn playing_to_paused(&mut self) { + use self::PlayerState::*; + match ::std::mem::replace(self, Invalid) { + Playing { + track_id, + decoder, + end_of_track, + normalisation_factor, + } => { + *self = Paused { + track_id: track_id, + decoder: decoder, + end_of_track: end_of_track, + normalisation_factor: normalisation_factor, + }; + } + _ => panic!("invalid state"), + } + } +} + +impl PlayerInternal { + fn run(mut self) { + loop { + let cmd = if self.state.is_playing() { + if self.sink_running { + match self.commands.try_recv() { + Ok(cmd) => Some(cmd), + Err(TryRecvError::Empty) => None, + Err(TryRecvError::Disconnected) => return, + } + } else { + match self.commands.recv_timeout(Duration::from_secs(5)) { + Ok(cmd) => Some(cmd), + Err(RecvTimeoutError::Timeout) => None, + Err(RecvTimeoutError::Disconnected) => return, + } + } + } else { + match self.commands.recv() { + Ok(cmd) => Some(cmd), + Err(RecvError) => return, + } + }; + + if let Some(cmd) = cmd { + self.handle_command(cmd); + } + + if self.state.is_playing() && !self.sink_running { + self.start_sink(); + } + + if self.sink_running { + let mut current_normalisation_factor: f32 = 1.0; + + let packet = if let PlayerState::Playing { + ref mut decoder, + normalisation_factor, + .. + } = self.state + { + current_normalisation_factor = normalisation_factor; + Some(decoder.next_packet().expect("Vorbis error")) + } else { + None + }; + + if let Some(packet) = packet { + self.handle_packet(packet, current_normalisation_factor); + } + } + + if self.session.is_invalid() { + return; + } + } + } + + fn start_sink(&mut self) { + match self.sink.start() { + Ok(()) => self.sink_running = true, + Err(err) => error!("Could not start audio: {}", err), + } + } + + fn stop_sink_if_running(&mut self) { + if self.sink_running { + self.stop_sink(); + } + } + + fn stop_sink(&mut self) { + self.sink.stop().unwrap(); + self.sink_running = false; + } + + fn handle_packet(&mut self, packet: Option, normalisation_factor: f32) { + match packet { + Some(mut packet) => { + if packet.data().len() > 0 { + if let Some(ref editor) = self.audio_filter { + editor.modify_stream(&mut packet.data_mut()) + }; + + if self.config.normalisation && normalisation_factor != 1.0 { + for x in packet.data_mut().iter_mut() { + *x = (*x as f32 * normalisation_factor) as i16; + } + } + + if let Err(err) = self.sink.write(&packet.data()) { + error!("Could not write audio: {}", err); + self.stop_sink(); + } + } + } + + None => { + self.stop_sink(); + self.state.playing_to_end_of_track(); + } + } + } + + fn handle_command(&mut self, cmd: PlayerCommand) { + debug!("command={:?}", cmd); + match cmd { + PlayerCommand::Load(track_id, play, position, end_of_track) => { + if self.state.is_playing() { + self.stop_sink_if_running(); + } + + match self.load_track(track_id, position as i64) { + Some((decoder, normalisation_factor)) => { + if play { + match self.state { + PlayerState::Playing { + track_id: old_track_id, + .. + } + | PlayerState::EndOfTrack { + track_id: old_track_id, + .. + } => self.send_event(PlayerEvent::Changed { + old_track_id: old_track_id, + new_track_id: track_id, + }), + _ => self.send_event(PlayerEvent::Started { track_id }), + } + + self.start_sink(); + + self.state = PlayerState::Playing { + track_id: track_id, + decoder: decoder, + end_of_track: end_of_track, + normalisation_factor: normalisation_factor, + }; + } else { + self.state = PlayerState::Paused { + track_id: track_id, + decoder: decoder, + end_of_track: end_of_track, + normalisation_factor: normalisation_factor, + }; + match self.state { + PlayerState::Playing { + track_id: old_track_id, + .. + } + | PlayerState::EndOfTrack { + track_id: old_track_id, + .. + } => self.send_event(PlayerEvent::Changed { + old_track_id: old_track_id, + new_track_id: track_id, + }), + _ => (), + } + self.send_event(PlayerEvent::Stopped { track_id }); + } + } + + None => { + let _ = end_of_track.send(()); + } + } + } + + PlayerCommand::Seek(position) => { + if let Some(decoder) = self.state.decoder() { + match decoder.seek(position as i64) { + Ok(_) => (), + Err(err) => error!("Vorbis error: {:?}", err), + } + } else { + warn!("Player::seek called from invalid state"); + } + } + + PlayerCommand::Play => { + if let PlayerState::Paused { track_id, .. } = self.state { + self.state.paused_to_playing(); + + self.send_event(PlayerEvent::Started { track_id }); + self.start_sink(); + } else { + warn!("Player::play called from invalid state"); + } + } + + PlayerCommand::Pause => { + if let PlayerState::Playing { track_id, .. } = self.state { + self.state.playing_to_paused(); + + self.stop_sink_if_running(); + self.send_event(PlayerEvent::Stopped { track_id }); + } else { + warn!("Player::pause called from invalid state"); + } + } + + PlayerCommand::Stop => match self.state { + PlayerState::Playing { track_id, .. } + | PlayerState::Paused { track_id, .. } + | PlayerState::EndOfTrack { track_id } => { + self.stop_sink_if_running(); + self.send_event(PlayerEvent::Stopped { track_id }); + self.state = PlayerState::Stopped; + } + PlayerState::Stopped => { + warn!("Player::stop called from invalid state"); + } + PlayerState::Invalid => panic!("invalid state"), + }, + } + } + + fn send_event(&mut self, event: PlayerEvent) { + let _ = self.event_sender.unbounded_send(event.clone()); + } + + fn find_available_alternative<'a>(&self, track: &'a Track) -> Option> { + if track.available { + Some(Cow::Borrowed(track)) + } else { + let alternatives = track + .alternatives + .iter() + .map(|alt_id| Track::get(&self.session, *alt_id)); + let alternatives = future::join_all(alternatives).wait().unwrap(); + + alternatives.into_iter().find(|alt| alt.available).map(Cow::Owned) + } + } + + fn load_track(&self, track_id: SpotifyId, position: i64) -> Option<(Decoder, f32)> { + let track = Track::get(&self.session, track_id).wait().unwrap(); + + info!( + "Loading track \"{}\" with Spotify URI \"spotify:track:{}\"", + track.name, + track_id.to_base62() + ); + + let track = match self.find_available_alternative(&track) { + Some(track) => track, + None => { + warn!("Track \"{}\" is not available", track.name); + return None; + } + }; + + let format = match self.config.bitrate { + Bitrate::Bitrate96 => FileFormat::OGG_VORBIS_96, + Bitrate::Bitrate160 => FileFormat::OGG_VORBIS_160, + Bitrate::Bitrate320 => FileFormat::OGG_VORBIS_320, + }; + + let file_id = match track.files.get(&format) { + Some(&file_id) => file_id, + None => { + warn!("Track \"{}\" is not available in format {:?}", track.name, format); + return None; + } + }; + + let key = self + .session + .audio_key() + .request(track.id, file_id); + let encrypted_file = AudioFile::open(&self.session, file_id); + + + let encrypted_file = encrypted_file.wait().unwrap(); + let key = key.wait().unwrap(); + let mut decrypted_file = AudioDecrypt::new(key, encrypted_file); + + let normalisation_factor = match NormalisationData::parse_from_file(&mut decrypted_file) { + Ok(normalisation_data) => NormalisationData::get_factor(&self.config, normalisation_data), + Err(_) => { + warn!("Unable to extract normalisation data, using default value."); + 1.0 as f32 + } + }; + + let audio_file = Subfile::new(decrypted_file, 0xa7); + + let mut decoder = VorbisDecoder::new(audio_file).unwrap(); + + if position != 0 { + match decoder.seek(position) { + Ok(_) => (), + Err(err) => error!("Vorbis error: {:?}", err), + } + } + + info!("Track \"{}\" loaded", track.name); + + Some((decoder, normalisation_factor)) + } +} + +impl Drop for PlayerInternal { + fn drop(&mut self) { + debug!("drop Player[{}]", self.session.session_id()); + } +} + +impl ::std::fmt::Debug for PlayerCommand { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { + PlayerCommand::Load(track, play, position, _) => f + .debug_tuple("Load") + .field(&track) + .field(&play) + .field(&position) + .finish(), + PlayerCommand::Play => f.debug_tuple("Play").finish(), + PlayerCommand::Pause => f.debug_tuple("Pause").finish(), + PlayerCommand::Stop => f.debug_tuple("Stop").finish(), + PlayerCommand::Seek(position) => f.debug_tuple("Seek").field(&position).finish(), + } + } +} + +struct Subfile { + stream: T, + offset: u64, +} + +impl Subfile { + pub fn new(mut stream: T, offset: u64) -> Subfile { + stream.seek(SeekFrom::Start(offset)).unwrap(); + Subfile { + stream: stream, + offset: offset, + } + } +} + +impl Read for Subfile { + fn read(&mut self, buf: &mut [u8]) -> Result { + self.stream.read(buf) + } +} + +impl Seek for Subfile { + fn seek(&mut self, mut pos: SeekFrom) -> Result { + pos = match pos { + SeekFrom::Start(offset) => SeekFrom::Start(offset + self.offset), + x => x, + }; + + let newpos = try!(self.stream.seek(pos)); + if newpos > self.offset { + Ok(newpos - self.offset) + } else { + Ok(0) + } + } +} diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 3a8f5857..18bba8fb 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -5,4 +5,7 @@ authors = ["Paul Liétar "] build = "build.rs" [dependencies] -protobuf = "1.0.10" +protobuf = "2.8.*" + +[build-dependencies] +protobuf-codegen-pure = "2.8.*" diff --git a/protocol/build.rs b/protocol/build.rs index f8ad050f..a1c5c662 100644 --- a/protocol/build.rs +++ b/protocol/build.rs @@ -1,15 +1,35 @@ -use std::io::prelude::*; +extern crate protobuf_codegen_pure; +use protobuf_codegen_pure::Customize; use std::fs::File; +use std::io::prelude::*; mod files; fn main() { + let mut changed = false; + let mut file = File::open("files.rs").unwrap(); + let mut f_str = String::new(); + file.read_to_string(&mut f_str).unwrap(); + drop(file); for &(path, expected_checksum) in files::FILES { let actual = cksum_file(path).unwrap(); if expected_checksum != actual { - panic!("Checksum for {:?} does not match. Try running build.sh", path); + protobuf_codegen_pure::run(protobuf_codegen_pure::Args { + out_dir: "src", + input: &[path], + includes: &["proto"], + customize: Customize { ..Default::default() }, + }).expect("protoc"); + let new_checksum = cksum_file(path).unwrap(); + f_str = f_str.replace(&expected_checksum.to_string(), &new_checksum.to_string()); + changed = true; } } + if changed { + // Write new checksums to file + let mut file = File::create("files.rs").unwrap(); + file.write_all(f_str.as_bytes()).unwrap(); + } } fn cksum_file>(path: T) -> std::io::Result { @@ -23,83 +43,51 @@ fn cksum_file>(path: T) -> std::io::Result { fn cksum>(data: T) -> u32 { let data = data.as_ref(); - let mut value = 0u32; - for x in data { - value = (value << 8) ^ CRC_LOOKUP_ARRAY[(*x as u32 ^ (value >> 24)) as usize]; - } + let mut value = 0u32; + for x in data { + value = (value << 8) ^ CRC_LOOKUP_ARRAY[(*x as u32 ^ (value >> 24)) as usize]; + } let mut n = data.len(); while n != 0 { - value = (value << 8) ^ CRC_LOOKUP_ARRAY[((n & 0xFF) as u32 ^ (value >> 24)) as usize]; + value = (value << 8) ^ CRC_LOOKUP_ARRAY[((n & 0xFF) as u32 ^ (value >> 24)) as usize]; n >>= 8; } !value } -static CRC_LOOKUP_ARRAY : &'static[u32] = &[ - 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, - 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, - 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, - 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, - 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, - 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, - 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, - 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, - 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, - 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, - 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, - 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, - 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, - 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, - 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, - 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, - 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, - 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, - 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, - 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, - 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, - 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, - 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, - 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, - 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, - 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, - 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, - 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, - 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, - 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, - 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, - 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, - 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, - 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, - 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, - 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, - 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, - 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, - 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, - 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, - 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, - 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, - 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, - 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, - 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, - 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, - 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, - 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, - 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, - 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, - 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, - 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 +static CRC_LOOKUP_ARRAY: &'static [u32] = &[ + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, + 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, + 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, + 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, + 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, + 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, + 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, + 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, + 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, + 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, + 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, + 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, + 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, + 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4, ]; diff --git a/protocol/build.sh b/protocol/build.sh deleted file mode 100644 index 53718858..00000000 --- a/protocol/build.sh +++ /dev/null @@ -1,29 +0,0 @@ -set -eu - -SRC="authentication keyexchange mercury - metadata pubsub spirc" - -cat > src/lib.rs < files.rs <> src/lib.rs - echo " (\"$src\", $checksum)," >> files.rs -done - -echo "];" >> files.rs diff --git a/protocol/files.rs b/protocol/files.rs index ad208d76..25529ce8 100644 --- a/protocol/files.rs +++ b/protocol/files.rs @@ -1,10 +1,10 @@ -// Autogenerated by build.sh +// Autogenerated by build.rs -pub const FILES : &'static [(&'static str, u32)] = &[ +pub const FILES: &'static [(&'static str, u32)] = &[ ("proto/authentication.proto", 2098196376), ("proto/keyexchange.proto", 451735664), ("proto/mercury.proto", 709993906), ("proto/metadata.proto", 2474472423), ("proto/pubsub.proto", 2686584829), - ("proto/spirc.proto", 3618770573), + ("proto/spirc.proto", 1587493382), ]; diff --git a/protocol/proto/spirc.proto b/protocol/proto/spirc.proto index 4f29f876..acaeae1f 100644 --- a/protocol/proto/spirc.proto +++ b/protocol/proto/spirc.proto @@ -75,6 +75,8 @@ enum CapabilityType { kCommandAcks = 0xa; kSupportsRename = 0xb; kHidden = 0xc; + kSupportsPlaylistV2 = 0xd; + kSupportsExternalEpisodes = 0xe; } message Goodbye { diff --git a/protocol/src/authentication.rs b/protocol/src/authentication.rs index e343cfae..a6c85990 100644 --- a/protocol/src/authentication.rs +++ b/protocol/src/authentication.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,10 +17,15 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `authentication.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct ClientResponseEncrypted { // message fields @@ -34,30 +39,27 @@ pub struct ClientResponseEncrypted { appkey: ::protobuf::SingularPtrField, client_info: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ClientResponseEncrypted {} +impl<'a> ::std::default::Default for &'a ClientResponseEncrypted { + fn default() -> &'a ClientResponseEncrypted { + ::default_instance() + } +} impl ClientResponseEncrypted { pub fn new() -> ClientResponseEncrypted { ::std::default::Default::default() } - pub fn default_instance() -> &'static ClientResponseEncrypted { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ClientResponseEncrypted, - }; - unsafe { - instance.get(ClientResponseEncrypted::new) - } - } - // required .LoginCredentials login_credentials = 10; + + pub fn get_login_credentials(&self) -> &LoginCredentials { + self.login_credentials.as_ref().unwrap_or_else(|| LoginCredentials::default_instance()) + } pub fn clear_login_credentials(&mut self) { self.login_credentials.clear(); } @@ -85,20 +87,12 @@ impl ClientResponseEncrypted { self.login_credentials.take().unwrap_or_else(|| LoginCredentials::new()) } - pub fn get_login_credentials(&self) -> &LoginCredentials { - self.login_credentials.as_ref().unwrap_or_else(|| LoginCredentials::default_instance()) - } + // optional .AccountCreation account_creation = 20; - fn get_login_credentials_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.login_credentials - } - fn mut_login_credentials_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.login_credentials + pub fn get_account_creation(&self) -> AccountCreation { + self.account_creation.unwrap_or(AccountCreation::ACCOUNT_CREATION_ALWAYS_PROMPT) } - - // optional .AccountCreation account_creation = 20; - pub fn clear_account_creation(&mut self) { self.account_creation = ::std::option::Option::None; } @@ -112,20 +106,12 @@ impl ClientResponseEncrypted { self.account_creation = ::std::option::Option::Some(v); } - pub fn get_account_creation(&self) -> AccountCreation { - self.account_creation.unwrap_or(AccountCreation::ACCOUNT_CREATION_ALWAYS_PROMPT) - } + // optional .FingerprintResponseUnion fingerprint_response = 30; - fn get_account_creation_for_reflect(&self) -> &::std::option::Option { - &self.account_creation - } - fn mut_account_creation_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.account_creation + pub fn get_fingerprint_response(&self) -> &FingerprintResponseUnion { + self.fingerprint_response.as_ref().unwrap_or_else(|| FingerprintResponseUnion::default_instance()) } - - // optional .FingerprintResponseUnion fingerprint_response = 30; - pub fn clear_fingerprint_response(&mut self) { self.fingerprint_response.clear(); } @@ -153,20 +139,12 @@ impl ClientResponseEncrypted { self.fingerprint_response.take().unwrap_or_else(|| FingerprintResponseUnion::new()) } - pub fn get_fingerprint_response(&self) -> &FingerprintResponseUnion { - self.fingerprint_response.as_ref().unwrap_or_else(|| FingerprintResponseUnion::default_instance()) - } + // optional .PeerTicketUnion peer_ticket = 40; - fn get_fingerprint_response_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.fingerprint_response - } - fn mut_fingerprint_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.fingerprint_response + pub fn get_peer_ticket(&self) -> &PeerTicketUnion { + self.peer_ticket.as_ref().unwrap_or_else(|| PeerTicketUnion::default_instance()) } - - // optional .PeerTicketUnion peer_ticket = 40; - pub fn clear_peer_ticket(&mut self) { self.peer_ticket.clear(); } @@ -194,20 +172,12 @@ impl ClientResponseEncrypted { self.peer_ticket.take().unwrap_or_else(|| PeerTicketUnion::new()) } - pub fn get_peer_ticket(&self) -> &PeerTicketUnion { - self.peer_ticket.as_ref().unwrap_or_else(|| PeerTicketUnion::default_instance()) - } + // required .SystemInfo system_info = 50; - fn get_peer_ticket_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.peer_ticket - } - fn mut_peer_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.peer_ticket + pub fn get_system_info(&self) -> &SystemInfo { + self.system_info.as_ref().unwrap_or_else(|| SystemInfo::default_instance()) } - - // required .SystemInfo system_info = 50; - pub fn clear_system_info(&mut self) { self.system_info.clear(); } @@ -235,20 +205,15 @@ impl ClientResponseEncrypted { self.system_info.take().unwrap_or_else(|| SystemInfo::new()) } - pub fn get_system_info(&self) -> &SystemInfo { - self.system_info.as_ref().unwrap_or_else(|| SystemInfo::default_instance()) - } + // optional string platform_model = 60; - fn get_system_info_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.system_info - } - fn mut_system_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.system_info + pub fn get_platform_model(&self) -> &str { + match self.platform_model.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string platform_model = 60; - pub fn clear_platform_model(&mut self) { self.platform_model.clear(); } @@ -276,23 +241,15 @@ impl ClientResponseEncrypted { self.platform_model.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_platform_model(&self) -> &str { - match self.platform_model.as_ref() { + // optional string version_string = 70; + + + pub fn get_version_string(&self) -> &str { + match self.version_string.as_ref() { Some(v) => &v, None => "", } } - - fn get_platform_model_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.platform_model - } - - fn mut_platform_model_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.platform_model - } - - // optional string version_string = 70; - pub fn clear_version_string(&mut self) { self.version_string.clear(); } @@ -320,23 +277,12 @@ impl ClientResponseEncrypted { self.version_string.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_version_string(&self) -> &str { - match self.version_string.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .LibspotifyAppKey appkey = 80; - fn get_version_string_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.version_string - } - fn mut_version_string_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.version_string + pub fn get_appkey(&self) -> &LibspotifyAppKey { + self.appkey.as_ref().unwrap_or_else(|| LibspotifyAppKey::default_instance()) } - - // optional .LibspotifyAppKey appkey = 80; - pub fn clear_appkey(&mut self) { self.appkey.clear(); } @@ -364,20 +310,12 @@ impl ClientResponseEncrypted { self.appkey.take().unwrap_or_else(|| LibspotifyAppKey::new()) } - pub fn get_appkey(&self) -> &LibspotifyAppKey { - self.appkey.as_ref().unwrap_or_else(|| LibspotifyAppKey::default_instance()) - } + // optional .ClientInfo client_info = 90; - fn get_appkey_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.appkey - } - fn mut_appkey_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.appkey + pub fn get_client_info(&self) -> &ClientInfo { + self.client_info.as_ref().unwrap_or_else(|| ClientInfo::default_instance()) } - - // optional .ClientInfo client_info = 90; - pub fn clear_client_info(&mut self) { self.client_info.clear(); } @@ -404,18 +342,6 @@ impl ClientResponseEncrypted { pub fn take_client_info(&mut self) -> ClientInfo { self.client_info.take().unwrap_or_else(|| ClientInfo::new()) } - - pub fn get_client_info(&self) -> &ClientInfo { - self.client_info.as_ref().unwrap_or_else(|| ClientInfo::default_instance()) - } - - fn get_client_info_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.client_info - } - - fn mut_client_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.client_info - } } impl ::protobuf::Message for ClientResponseEncrypted { @@ -467,11 +393,7 @@ impl ::protobuf::Message for ClientResponseEncrypted { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_credentials)?; }, 20 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.account_creation = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.account_creation, 20, &mut self.unknown_fields)? }, 30 => { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_response)?; @@ -600,27 +522,25 @@ impl ::protobuf::Message for ClientResponseEncrypted { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ClientResponseEncrypted { fn new() -> ClientResponseEncrypted { ClientResponseEncrypted::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -630,48 +550,48 @@ impl ::protobuf::MessageStatic for ClientResponseEncrypted { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_credentials", - ClientResponseEncrypted::get_login_credentials_for_reflect, - ClientResponseEncrypted::mut_login_credentials_for_reflect, + |m: &ClientResponseEncrypted| { &m.login_credentials }, + |m: &mut ClientResponseEncrypted| { &mut m.login_credentials }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "account_creation", - ClientResponseEncrypted::get_account_creation_for_reflect, - ClientResponseEncrypted::mut_account_creation_for_reflect, + |m: &ClientResponseEncrypted| { &m.account_creation }, + |m: &mut ClientResponseEncrypted| { &mut m.account_creation }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fingerprint_response", - ClientResponseEncrypted::get_fingerprint_response_for_reflect, - ClientResponseEncrypted::mut_fingerprint_response_for_reflect, + |m: &ClientResponseEncrypted| { &m.fingerprint_response }, + |m: &mut ClientResponseEncrypted| { &mut m.fingerprint_response }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "peer_ticket", - ClientResponseEncrypted::get_peer_ticket_for_reflect, - ClientResponseEncrypted::mut_peer_ticket_for_reflect, + |m: &ClientResponseEncrypted| { &m.peer_ticket }, + |m: &mut ClientResponseEncrypted| { &mut m.peer_ticket }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "system_info", - ClientResponseEncrypted::get_system_info_for_reflect, - ClientResponseEncrypted::mut_system_info_for_reflect, + |m: &ClientResponseEncrypted| { &m.system_info }, + |m: &mut ClientResponseEncrypted| { &mut m.system_info }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "platform_model", - ClientResponseEncrypted::get_platform_model_for_reflect, - ClientResponseEncrypted::mut_platform_model_for_reflect, + |m: &ClientResponseEncrypted| { &m.platform_model }, + |m: &mut ClientResponseEncrypted| { &mut m.platform_model }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "version_string", - ClientResponseEncrypted::get_version_string_for_reflect, - ClientResponseEncrypted::mut_version_string_for_reflect, + |m: &ClientResponseEncrypted| { &m.version_string }, + |m: &mut ClientResponseEncrypted| { &mut m.version_string }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "appkey", - ClientResponseEncrypted::get_appkey_for_reflect, - ClientResponseEncrypted::mut_appkey_for_reflect, + |m: &ClientResponseEncrypted| { &m.appkey }, + |m: &mut ClientResponseEncrypted| { &mut m.appkey }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "client_info", - ClientResponseEncrypted::get_client_info_for_reflect, - ClientResponseEncrypted::mut_client_info_for_reflect, + |m: &ClientResponseEncrypted| { &m.client_info }, + |m: &mut ClientResponseEncrypted| { &mut m.client_info }, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientResponseEncrypted", @@ -681,19 +601,29 @@ impl ::protobuf::MessageStatic for ClientResponseEncrypted { }) } } + + fn default_instance() -> &'static ClientResponseEncrypted { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClientResponseEncrypted, + }; + unsafe { + instance.get(ClientResponseEncrypted::new) + } + } } impl ::protobuf::Clear for ClientResponseEncrypted { fn clear(&mut self) { - self.clear_login_credentials(); - self.clear_account_creation(); - self.clear_fingerprint_response(); - self.clear_peer_ticket(); - self.clear_system_info(); - self.clear_platform_model(); - self.clear_version_string(); - self.clear_appkey(); - self.clear_client_info(); + self.login_credentials.clear(); + self.account_creation = ::std::option::Option::None; + self.fingerprint_response.clear(); + self.peer_ticket.clear(); + self.system_info.clear(); + self.platform_model.clear(); + self.version_string.clear(); + self.appkey.clear(); + self.client_info.clear(); self.unknown_fields.clear(); } } @@ -717,30 +647,30 @@ pub struct LoginCredentials { typ: ::std::option::Option, auth_data: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCredentials {} +impl<'a> ::std::default::Default for &'a LoginCredentials { + fn default() -> &'a LoginCredentials { + ::default_instance() + } +} impl LoginCredentials { pub fn new() -> LoginCredentials { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCredentials { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCredentials, - }; - unsafe { - instance.get(LoginCredentials::new) - } - } - // optional string username = 10; + + pub fn get_username(&self) -> &str { + match self.username.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_username(&mut self) { self.username.clear(); } @@ -768,23 +698,12 @@ impl LoginCredentials { self.username.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_username(&self) -> &str { - match self.username.as_ref() { - Some(v) => &v, - None => "", - } - } + // required .AuthenticationType typ = 20; - fn get_username_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.username - } - fn mut_username_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.username + pub fn get_typ(&self) -> AuthenticationType { + self.typ.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) } - - // required .AuthenticationType typ = 20; - pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -798,20 +717,15 @@ impl LoginCredentials { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> AuthenticationType { - self.typ.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) - } + // optional bytes auth_data = 30; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_auth_data(&self) -> &[u8] { + match self.auth_data.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes auth_data = 30; - pub fn clear_auth_data(&mut self) { self.auth_data.clear(); } @@ -838,21 +752,6 @@ impl LoginCredentials { pub fn take_auth_data(&mut self) -> ::std::vec::Vec { self.auth_data.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_auth_data(&self) -> &[u8] { - match self.auth_data.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_auth_data_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.auth_data - } - - fn mut_auth_data_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.auth_data - } } impl ::protobuf::Message for LoginCredentials { @@ -871,11 +770,7 @@ impl ::protobuf::Message for LoginCredentials { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.username)?; }, 20 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 20, &mut self.unknown_fields)? }, 30 => { ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.auth_data)?; @@ -932,27 +827,25 @@ impl ::protobuf::Message for LoginCredentials { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCredentials { fn new() -> LoginCredentials { LoginCredentials::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -962,18 +855,18 @@ impl ::protobuf::MessageStatic for LoginCredentials { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "username", - LoginCredentials::get_username_for_reflect, - LoginCredentials::mut_username_for_reflect, + |m: &LoginCredentials| { &m.username }, + |m: &mut LoginCredentials| { &mut m.username }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - LoginCredentials::get_typ_for_reflect, - LoginCredentials::mut_typ_for_reflect, + |m: &LoginCredentials| { &m.typ }, + |m: &mut LoginCredentials| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "auth_data", - LoginCredentials::get_auth_data_for_reflect, - LoginCredentials::mut_auth_data_for_reflect, + |m: &LoginCredentials| { &m.auth_data }, + |m: &mut LoginCredentials| { &mut m.auth_data }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCredentials", @@ -983,13 +876,23 @@ impl ::protobuf::MessageStatic for LoginCredentials { }) } } + + fn default_instance() -> &'static LoginCredentials { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCredentials, + }; + unsafe { + instance.get(LoginCredentials::new) + } + } } impl ::protobuf::Clear for LoginCredentials { fn clear(&mut self) { - self.clear_username(); - self.clear_typ(); - self.clear_auth_data(); + self.username.clear(); + self.typ = ::std::option::Option::None; + self.auth_data.clear(); self.unknown_fields.clear(); } } @@ -1012,30 +915,27 @@ pub struct FingerprintResponseUnion { grain: ::protobuf::SingularPtrField, hmac_ripemd: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintResponseUnion {} +impl<'a> ::std::default::Default for &'a FingerprintResponseUnion { + fn default() -> &'a FingerprintResponseUnion { + ::default_instance() + } +} impl FingerprintResponseUnion { pub fn new() -> FingerprintResponseUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintResponseUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintResponseUnion, - }; - unsafe { - instance.get(FingerprintResponseUnion::new) - } - } - // optional .FingerprintGrainResponse grain = 10; + + pub fn get_grain(&self) -> &FingerprintGrainResponse { + self.grain.as_ref().unwrap_or_else(|| FingerprintGrainResponse::default_instance()) + } pub fn clear_grain(&mut self) { self.grain.clear(); } @@ -1063,20 +963,12 @@ impl FingerprintResponseUnion { self.grain.take().unwrap_or_else(|| FingerprintGrainResponse::new()) } - pub fn get_grain(&self) -> &FingerprintGrainResponse { - self.grain.as_ref().unwrap_or_else(|| FingerprintGrainResponse::default_instance()) - } + // optional .FingerprintHmacRipemdResponse hmac_ripemd = 20; - fn get_grain_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.grain - } - fn mut_grain_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.grain + pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdResponse { + self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdResponse::default_instance()) } - - // optional .FingerprintHmacRipemdResponse hmac_ripemd = 20; - pub fn clear_hmac_ripemd(&mut self) { self.hmac_ripemd.clear(); } @@ -1103,18 +995,6 @@ impl FingerprintResponseUnion { pub fn take_hmac_ripemd(&mut self) -> FingerprintHmacRipemdResponse { self.hmac_ripemd.take().unwrap_or_else(|| FingerprintHmacRipemdResponse::new()) } - - pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdResponse { - self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdResponse::default_instance()) - } - - fn get_hmac_ripemd_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.hmac_ripemd - } - - fn mut_hmac_ripemd_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.hmac_ripemd - } } impl ::protobuf::Message for FingerprintResponseUnion { @@ -1194,27 +1074,25 @@ impl ::protobuf::Message for FingerprintResponseUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintResponseUnion { fn new() -> FingerprintResponseUnion { FingerprintResponseUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1224,13 +1102,13 @@ impl ::protobuf::MessageStatic for FingerprintResponseUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "grain", - FingerprintResponseUnion::get_grain_for_reflect, - FingerprintResponseUnion::mut_grain_for_reflect, + |m: &FingerprintResponseUnion| { &m.grain }, + |m: &mut FingerprintResponseUnion| { &mut m.grain }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hmac_ripemd", - FingerprintResponseUnion::get_hmac_ripemd_for_reflect, - FingerprintResponseUnion::mut_hmac_ripemd_for_reflect, + |m: &FingerprintResponseUnion| { &m.hmac_ripemd }, + |m: &mut FingerprintResponseUnion| { &mut m.hmac_ripemd }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintResponseUnion", @@ -1240,12 +1118,22 @@ impl ::protobuf::MessageStatic for FingerprintResponseUnion { }) } } + + fn default_instance() -> &'static FingerprintResponseUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintResponseUnion, + }; + unsafe { + instance.get(FingerprintResponseUnion::new) + } + } } impl ::protobuf::Clear for FingerprintResponseUnion { fn clear(&mut self) { - self.clear_grain(); - self.clear_hmac_ripemd(); + self.grain.clear(); + self.hmac_ripemd.clear(); self.unknown_fields.clear(); } } @@ -1267,30 +1155,30 @@ pub struct FingerprintGrainResponse { // message fields encrypted_key: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintGrainResponse {} +impl<'a> ::std::default::Default for &'a FingerprintGrainResponse { + fn default() -> &'a FingerprintGrainResponse { + ::default_instance() + } +} impl FingerprintGrainResponse { pub fn new() -> FingerprintGrainResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintGrainResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintGrainResponse, - }; - unsafe { - instance.get(FingerprintGrainResponse::new) - } - } - // required bytes encrypted_key = 10; + + pub fn get_encrypted_key(&self) -> &[u8] { + match self.encrypted_key.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_encrypted_key(&mut self) { self.encrypted_key.clear(); } @@ -1317,21 +1205,6 @@ impl FingerprintGrainResponse { pub fn take_encrypted_key(&mut self) -> ::std::vec::Vec { self.encrypted_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_encrypted_key(&self) -> &[u8] { - match self.encrypted_key.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_encrypted_key_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.encrypted_key - } - - fn mut_encrypted_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.encrypted_key - } } impl ::protobuf::Message for FingerprintGrainResponse { @@ -1389,27 +1262,25 @@ impl ::protobuf::Message for FingerprintGrainResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintGrainResponse { fn new() -> FingerprintGrainResponse { FingerprintGrainResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1419,8 +1290,8 @@ impl ::protobuf::MessageStatic for FingerprintGrainResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "encrypted_key", - FingerprintGrainResponse::get_encrypted_key_for_reflect, - FingerprintGrainResponse::mut_encrypted_key_for_reflect, + |m: &FingerprintGrainResponse| { &m.encrypted_key }, + |m: &mut FingerprintGrainResponse| { &mut m.encrypted_key }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintGrainResponse", @@ -1430,11 +1301,21 @@ impl ::protobuf::MessageStatic for FingerprintGrainResponse { }) } } + + fn default_instance() -> &'static FingerprintGrainResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintGrainResponse, + }; + unsafe { + instance.get(FingerprintGrainResponse::new) + } + } } impl ::protobuf::Clear for FingerprintGrainResponse { fn clear(&mut self) { - self.clear_encrypted_key(); + self.encrypted_key.clear(); self.unknown_fields.clear(); } } @@ -1456,30 +1337,30 @@ pub struct FingerprintHmacRipemdResponse { // message fields hmac: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintHmacRipemdResponse {} +impl<'a> ::std::default::Default for &'a FingerprintHmacRipemdResponse { + fn default() -> &'a FingerprintHmacRipemdResponse { + ::default_instance() + } +} impl FingerprintHmacRipemdResponse { pub fn new() -> FingerprintHmacRipemdResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintHmacRipemdResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintHmacRipemdResponse, - }; - unsafe { - instance.get(FingerprintHmacRipemdResponse::new) - } - } - // required bytes hmac = 10; + + pub fn get_hmac(&self) -> &[u8] { + match self.hmac.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_hmac(&mut self) { self.hmac.clear(); } @@ -1506,21 +1387,6 @@ impl FingerprintHmacRipemdResponse { pub fn take_hmac(&mut self) -> ::std::vec::Vec { self.hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_hmac(&self) -> &[u8] { - match self.hmac.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_hmac_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.hmac - } - - fn mut_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.hmac - } } impl ::protobuf::Message for FingerprintHmacRipemdResponse { @@ -1578,27 +1444,25 @@ impl ::protobuf::Message for FingerprintHmacRipemdResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintHmacRipemdResponse { fn new() -> FingerprintHmacRipemdResponse { FingerprintHmacRipemdResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1608,8 +1472,8 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hmac", - FingerprintHmacRipemdResponse::get_hmac_for_reflect, - FingerprintHmacRipemdResponse::mut_hmac_for_reflect, + |m: &FingerprintHmacRipemdResponse| { &m.hmac }, + |m: &mut FingerprintHmacRipemdResponse| { &mut m.hmac }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintHmacRipemdResponse", @@ -1619,11 +1483,21 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdResponse { }) } } + + fn default_instance() -> &'static FingerprintHmacRipemdResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintHmacRipemdResponse, + }; + unsafe { + instance.get(FingerprintHmacRipemdResponse::new) + } + } } impl ::protobuf::Clear for FingerprintHmacRipemdResponse { fn clear(&mut self) { - self.clear_hmac(); + self.hmac.clear(); self.unknown_fields.clear(); } } @@ -1646,30 +1520,27 @@ pub struct PeerTicketUnion { public_key: ::protobuf::SingularPtrField, old_ticket: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PeerTicketUnion {} +impl<'a> ::std::default::Default for &'a PeerTicketUnion { + fn default() -> &'a PeerTicketUnion { + ::default_instance() + } +} impl PeerTicketUnion { pub fn new() -> PeerTicketUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static PeerTicketUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PeerTicketUnion, - }; - unsafe { - instance.get(PeerTicketUnion::new) - } - } - // optional .PeerTicketPublicKey public_key = 10; + + pub fn get_public_key(&self) -> &PeerTicketPublicKey { + self.public_key.as_ref().unwrap_or_else(|| PeerTicketPublicKey::default_instance()) + } pub fn clear_public_key(&mut self) { self.public_key.clear(); } @@ -1697,20 +1568,12 @@ impl PeerTicketUnion { self.public_key.take().unwrap_or_else(|| PeerTicketPublicKey::new()) } - pub fn get_public_key(&self) -> &PeerTicketPublicKey { - self.public_key.as_ref().unwrap_or_else(|| PeerTicketPublicKey::default_instance()) - } + // optional .PeerTicketOld old_ticket = 20; - fn get_public_key_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.public_key - } - fn mut_public_key_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.public_key + pub fn get_old_ticket(&self) -> &PeerTicketOld { + self.old_ticket.as_ref().unwrap_or_else(|| PeerTicketOld::default_instance()) } - - // optional .PeerTicketOld old_ticket = 20; - pub fn clear_old_ticket(&mut self) { self.old_ticket.clear(); } @@ -1737,18 +1600,6 @@ impl PeerTicketUnion { pub fn take_old_ticket(&mut self) -> PeerTicketOld { self.old_ticket.take().unwrap_or_else(|| PeerTicketOld::new()) } - - pub fn get_old_ticket(&self) -> &PeerTicketOld { - self.old_ticket.as_ref().unwrap_or_else(|| PeerTicketOld::default_instance()) - } - - fn get_old_ticket_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.old_ticket - } - - fn mut_old_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.old_ticket - } } impl ::protobuf::Message for PeerTicketUnion { @@ -1828,27 +1679,25 @@ impl ::protobuf::Message for PeerTicketUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PeerTicketUnion { fn new() -> PeerTicketUnion { PeerTicketUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1858,13 +1707,13 @@ impl ::protobuf::MessageStatic for PeerTicketUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "public_key", - PeerTicketUnion::get_public_key_for_reflect, - PeerTicketUnion::mut_public_key_for_reflect, + |m: &PeerTicketUnion| { &m.public_key }, + |m: &mut PeerTicketUnion| { &mut m.public_key }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "old_ticket", - PeerTicketUnion::get_old_ticket_for_reflect, - PeerTicketUnion::mut_old_ticket_for_reflect, + |m: &PeerTicketUnion| { &m.old_ticket }, + |m: &mut PeerTicketUnion| { &mut m.old_ticket }, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketUnion", @@ -1874,12 +1723,22 @@ impl ::protobuf::MessageStatic for PeerTicketUnion { }) } } + + fn default_instance() -> &'static PeerTicketUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PeerTicketUnion, + }; + unsafe { + instance.get(PeerTicketUnion::new) + } + } } impl ::protobuf::Clear for PeerTicketUnion { fn clear(&mut self) { - self.clear_public_key(); - self.clear_old_ticket(); + self.public_key.clear(); + self.old_ticket.clear(); self.unknown_fields.clear(); } } @@ -1901,30 +1760,30 @@ pub struct PeerTicketPublicKey { // message fields public_key: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PeerTicketPublicKey {} +impl<'a> ::std::default::Default for &'a PeerTicketPublicKey { + fn default() -> &'a PeerTicketPublicKey { + ::default_instance() + } +} impl PeerTicketPublicKey { pub fn new() -> PeerTicketPublicKey { ::std::default::Default::default() } - pub fn default_instance() -> &'static PeerTicketPublicKey { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PeerTicketPublicKey, - }; - unsafe { - instance.get(PeerTicketPublicKey::new) - } - } - // required bytes public_key = 10; + + pub fn get_public_key(&self) -> &[u8] { + match self.public_key.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_public_key(&mut self) { self.public_key.clear(); } @@ -1951,21 +1810,6 @@ impl PeerTicketPublicKey { pub fn take_public_key(&mut self) -> ::std::vec::Vec { self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_public_key(&self) -> &[u8] { - match self.public_key.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_public_key_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.public_key - } - - fn mut_public_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.public_key - } } impl ::protobuf::Message for PeerTicketPublicKey { @@ -2023,27 +1867,25 @@ impl ::protobuf::Message for PeerTicketPublicKey { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PeerTicketPublicKey { fn new() -> PeerTicketPublicKey { PeerTicketPublicKey::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2053,8 +1895,8 @@ impl ::protobuf::MessageStatic for PeerTicketPublicKey { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "public_key", - PeerTicketPublicKey::get_public_key_for_reflect, - PeerTicketPublicKey::mut_public_key_for_reflect, + |m: &PeerTicketPublicKey| { &m.public_key }, + |m: &mut PeerTicketPublicKey| { &mut m.public_key }, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketPublicKey", @@ -2064,11 +1906,21 @@ impl ::protobuf::MessageStatic for PeerTicketPublicKey { }) } } + + fn default_instance() -> &'static PeerTicketPublicKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PeerTicketPublicKey, + }; + unsafe { + instance.get(PeerTicketPublicKey::new) + } + } } impl ::protobuf::Clear for PeerTicketPublicKey { fn clear(&mut self) { - self.clear_public_key(); + self.public_key.clear(); self.unknown_fields.clear(); } } @@ -2091,30 +1943,30 @@ pub struct PeerTicketOld { peer_ticket: ::protobuf::SingularField<::std::vec::Vec>, peer_ticket_signature: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PeerTicketOld {} +impl<'a> ::std::default::Default for &'a PeerTicketOld { + fn default() -> &'a PeerTicketOld { + ::default_instance() + } +} impl PeerTicketOld { pub fn new() -> PeerTicketOld { ::std::default::Default::default() } - pub fn default_instance() -> &'static PeerTicketOld { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PeerTicketOld, - }; - unsafe { - instance.get(PeerTicketOld::new) - } - } - // required bytes peer_ticket = 10; + + pub fn get_peer_ticket(&self) -> &[u8] { + match self.peer_ticket.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_peer_ticket(&mut self) { self.peer_ticket.clear(); } @@ -2142,23 +1994,15 @@ impl PeerTicketOld { self.peer_ticket.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_peer_ticket(&self) -> &[u8] { - match self.peer_ticket.as_ref() { + // required bytes peer_ticket_signature = 20; + + + pub fn get_peer_ticket_signature(&self) -> &[u8] { + match self.peer_ticket_signature.as_ref() { Some(v) => &v, None => &[], } } - - fn get_peer_ticket_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.peer_ticket - } - - fn mut_peer_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.peer_ticket - } - - // required bytes peer_ticket_signature = 20; - pub fn clear_peer_ticket_signature(&mut self) { self.peer_ticket_signature.clear(); } @@ -2185,21 +2029,6 @@ impl PeerTicketOld { pub fn take_peer_ticket_signature(&mut self) -> ::std::vec::Vec { self.peer_ticket_signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_peer_ticket_signature(&self) -> &[u8] { - match self.peer_ticket_signature.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_peer_ticket_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.peer_ticket_signature - } - - fn mut_peer_ticket_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.peer_ticket_signature - } } impl ::protobuf::Message for PeerTicketOld { @@ -2269,27 +2098,25 @@ impl ::protobuf::Message for PeerTicketOld { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PeerTicketOld { fn new() -> PeerTicketOld { PeerTicketOld::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2299,13 +2126,13 @@ impl ::protobuf::MessageStatic for PeerTicketOld { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "peer_ticket", - PeerTicketOld::get_peer_ticket_for_reflect, - PeerTicketOld::mut_peer_ticket_for_reflect, + |m: &PeerTicketOld| { &m.peer_ticket }, + |m: &mut PeerTicketOld| { &mut m.peer_ticket }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "peer_ticket_signature", - PeerTicketOld::get_peer_ticket_signature_for_reflect, - PeerTicketOld::mut_peer_ticket_signature_for_reflect, + |m: &PeerTicketOld| { &m.peer_ticket_signature }, + |m: &mut PeerTicketOld| { &mut m.peer_ticket_signature }, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketOld", @@ -2315,12 +2142,22 @@ impl ::protobuf::MessageStatic for PeerTicketOld { }) } } + + fn default_instance() -> &'static PeerTicketOld { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PeerTicketOld, + }; + unsafe { + instance.get(PeerTicketOld::new) + } + } } impl ::protobuf::Clear for PeerTicketOld { fn clear(&mut self) { - self.clear_peer_ticket(); - self.clear_peer_ticket_signature(); + self.peer_ticket.clear(); + self.peer_ticket_signature.clear(); self.unknown_fields.clear(); } } @@ -2351,30 +2188,27 @@ pub struct SystemInfo { system_information_string: ::protobuf::SingularField<::std::string::String>, device_id: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for SystemInfo {} +impl<'a> ::std::default::Default for &'a SystemInfo { + fn default() -> &'a SystemInfo { + ::default_instance() + } +} impl SystemInfo { pub fn new() -> SystemInfo { ::std::default::Default::default() } - pub fn default_instance() -> &'static SystemInfo { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const SystemInfo, - }; - unsafe { - instance.get(SystemInfo::new) - } - } - // required .CpuFamily cpu_family = 10; + + pub fn get_cpu_family(&self) -> CpuFamily { + self.cpu_family.unwrap_or(CpuFamily::CPU_UNKNOWN) + } pub fn clear_cpu_family(&mut self) { self.cpu_family = ::std::option::Option::None; } @@ -2388,20 +2222,12 @@ impl SystemInfo { self.cpu_family = ::std::option::Option::Some(v); } - pub fn get_cpu_family(&self) -> CpuFamily { - self.cpu_family.unwrap_or(CpuFamily::CPU_UNKNOWN) - } + // optional uint32 cpu_subtype = 20; - fn get_cpu_family_for_reflect(&self) -> &::std::option::Option { - &self.cpu_family - } - fn mut_cpu_family_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.cpu_family + pub fn get_cpu_subtype(&self) -> u32 { + self.cpu_subtype.unwrap_or(0) } - - // optional uint32 cpu_subtype = 20; - pub fn clear_cpu_subtype(&mut self) { self.cpu_subtype = ::std::option::Option::None; } @@ -2415,20 +2241,12 @@ impl SystemInfo { self.cpu_subtype = ::std::option::Option::Some(v); } - pub fn get_cpu_subtype(&self) -> u32 { - self.cpu_subtype.unwrap_or(0) - } + // optional uint32 cpu_ext = 30; - fn get_cpu_subtype_for_reflect(&self) -> &::std::option::Option { - &self.cpu_subtype - } - fn mut_cpu_subtype_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.cpu_subtype + pub fn get_cpu_ext(&self) -> u32 { + self.cpu_ext.unwrap_or(0) } - - // optional uint32 cpu_ext = 30; - pub fn clear_cpu_ext(&mut self) { self.cpu_ext = ::std::option::Option::None; } @@ -2442,20 +2260,12 @@ impl SystemInfo { self.cpu_ext = ::std::option::Option::Some(v); } - pub fn get_cpu_ext(&self) -> u32 { - self.cpu_ext.unwrap_or(0) - } + // optional .Brand brand = 40; - fn get_cpu_ext_for_reflect(&self) -> &::std::option::Option { - &self.cpu_ext - } - fn mut_cpu_ext_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.cpu_ext + pub fn get_brand(&self) -> Brand { + self.brand.unwrap_or(Brand::BRAND_UNBRANDED) } - - // optional .Brand brand = 40; - pub fn clear_brand(&mut self) { self.brand = ::std::option::Option::None; } @@ -2469,20 +2279,12 @@ impl SystemInfo { self.brand = ::std::option::Option::Some(v); } - pub fn get_brand(&self) -> Brand { - self.brand.unwrap_or(Brand::BRAND_UNBRANDED) - } + // optional uint32 brand_flags = 50; - fn get_brand_for_reflect(&self) -> &::std::option::Option { - &self.brand - } - fn mut_brand_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.brand + pub fn get_brand_flags(&self) -> u32 { + self.brand_flags.unwrap_or(0) } - - // optional uint32 brand_flags = 50; - pub fn clear_brand_flags(&mut self) { self.brand_flags = ::std::option::Option::None; } @@ -2496,20 +2298,12 @@ impl SystemInfo { self.brand_flags = ::std::option::Option::Some(v); } - pub fn get_brand_flags(&self) -> u32 { - self.brand_flags.unwrap_or(0) - } + // required .Os os = 60; - fn get_brand_flags_for_reflect(&self) -> &::std::option::Option { - &self.brand_flags - } - fn mut_brand_flags_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.brand_flags + pub fn get_os(&self) -> Os { + self.os.unwrap_or(Os::OS_UNKNOWN) } - - // required .Os os = 60; - pub fn clear_os(&mut self) { self.os = ::std::option::Option::None; } @@ -2523,20 +2317,12 @@ impl SystemInfo { self.os = ::std::option::Option::Some(v); } - pub fn get_os(&self) -> Os { - self.os.unwrap_or(Os::OS_UNKNOWN) - } + // optional uint32 os_version = 70; - fn get_os_for_reflect(&self) -> &::std::option::Option { - &self.os - } - fn mut_os_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.os + pub fn get_os_version(&self) -> u32 { + self.os_version.unwrap_or(0) } - - // optional uint32 os_version = 70; - pub fn clear_os_version(&mut self) { self.os_version = ::std::option::Option::None; } @@ -2550,20 +2336,12 @@ impl SystemInfo { self.os_version = ::std::option::Option::Some(v); } - pub fn get_os_version(&self) -> u32 { - self.os_version.unwrap_or(0) - } + // optional uint32 os_ext = 80; - fn get_os_version_for_reflect(&self) -> &::std::option::Option { - &self.os_version - } - fn mut_os_version_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.os_version + pub fn get_os_ext(&self) -> u32 { + self.os_ext.unwrap_or(0) } - - // optional uint32 os_ext = 80; - pub fn clear_os_ext(&mut self) { self.os_ext = ::std::option::Option::None; } @@ -2577,20 +2355,15 @@ impl SystemInfo { self.os_ext = ::std::option::Option::Some(v); } - pub fn get_os_ext(&self) -> u32 { - self.os_ext.unwrap_or(0) - } + // optional string system_information_string = 90; - fn get_os_ext_for_reflect(&self) -> &::std::option::Option { - &self.os_ext - } - fn mut_os_ext_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.os_ext + pub fn get_system_information_string(&self) -> &str { + match self.system_information_string.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string system_information_string = 90; - pub fn clear_system_information_string(&mut self) { self.system_information_string.clear(); } @@ -2618,23 +2391,15 @@ impl SystemInfo { self.system_information_string.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_system_information_string(&self) -> &str { - match self.system_information_string.as_ref() { + // optional string device_id = 100; + + + pub fn get_device_id(&self) -> &str { + match self.device_id.as_ref() { Some(v) => &v, None => "", } } - - fn get_system_information_string_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.system_information_string - } - - fn mut_system_information_string_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.system_information_string - } - - // optional string device_id = 100; - pub fn clear_device_id(&mut self) { self.device_id.clear(); } @@ -2661,21 +2426,6 @@ impl SystemInfo { pub fn take_device_id(&mut self) -> ::std::string::String { self.device_id.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_device_id(&self) -> &str { - match self.device_id.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_device_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.device_id - } - - fn mut_device_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.device_id - } } impl ::protobuf::Message for SystemInfo { @@ -2694,11 +2444,7 @@ impl ::protobuf::Message for SystemInfo { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.cpu_family = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.cpu_family, 10, &mut self.unknown_fields)? }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -2715,11 +2461,7 @@ impl ::protobuf::Message for SystemInfo { self.cpu_ext = ::std::option::Option::Some(tmp); }, 40 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.brand = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.brand, 40, &mut self.unknown_fields)? }, 50 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -2728,12 +2470,8 @@ impl ::protobuf::Message for SystemInfo { let tmp = is.read_uint32()?; self.brand_flags = ::std::option::Option::Some(tmp); }, - 60 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.os = ::std::option::Option::Some(tmp); + 60 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.os, 60, &mut self.unknown_fields)? }, 70 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -2849,27 +2587,25 @@ impl ::protobuf::Message for SystemInfo { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for SystemInfo { fn new() -> SystemInfo { SystemInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2879,53 +2615,53 @@ impl ::protobuf::MessageStatic for SystemInfo { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cpu_family", - SystemInfo::get_cpu_family_for_reflect, - SystemInfo::mut_cpu_family_for_reflect, + |m: &SystemInfo| { &m.cpu_family }, + |m: &mut SystemInfo| { &mut m.cpu_family }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "cpu_subtype", - SystemInfo::get_cpu_subtype_for_reflect, - SystemInfo::mut_cpu_subtype_for_reflect, + |m: &SystemInfo| { &m.cpu_subtype }, + |m: &mut SystemInfo| { &mut m.cpu_subtype }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "cpu_ext", - SystemInfo::get_cpu_ext_for_reflect, - SystemInfo::mut_cpu_ext_for_reflect, + |m: &SystemInfo| { &m.cpu_ext }, + |m: &mut SystemInfo| { &mut m.cpu_ext }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "brand", - SystemInfo::get_brand_for_reflect, - SystemInfo::mut_brand_for_reflect, + |m: &SystemInfo| { &m.brand }, + |m: &mut SystemInfo| { &mut m.brand }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "brand_flags", - SystemInfo::get_brand_flags_for_reflect, - SystemInfo::mut_brand_flags_for_reflect, + |m: &SystemInfo| { &m.brand_flags }, + |m: &mut SystemInfo| { &mut m.brand_flags }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "os", - SystemInfo::get_os_for_reflect, - SystemInfo::mut_os_for_reflect, + |m: &SystemInfo| { &m.os }, + |m: &mut SystemInfo| { &mut m.os }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "os_version", - SystemInfo::get_os_version_for_reflect, - SystemInfo::mut_os_version_for_reflect, + |m: &SystemInfo| { &m.os_version }, + |m: &mut SystemInfo| { &mut m.os_version }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "os_ext", - SystemInfo::get_os_ext_for_reflect, - SystemInfo::mut_os_ext_for_reflect, + |m: &SystemInfo| { &m.os_ext }, + |m: &mut SystemInfo| { &mut m.os_ext }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "system_information_string", - SystemInfo::get_system_information_string_for_reflect, - SystemInfo::mut_system_information_string_for_reflect, + |m: &SystemInfo| { &m.system_information_string }, + |m: &mut SystemInfo| { &mut m.system_information_string }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "device_id", - SystemInfo::get_device_id_for_reflect, - SystemInfo::mut_device_id_for_reflect, + |m: &SystemInfo| { &m.device_id }, + |m: &mut SystemInfo| { &mut m.device_id }, )); ::protobuf::reflect::MessageDescriptor::new::( "SystemInfo", @@ -2935,20 +2671,30 @@ impl ::protobuf::MessageStatic for SystemInfo { }) } } + + fn default_instance() -> &'static SystemInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SystemInfo, + }; + unsafe { + instance.get(SystemInfo::new) + } + } } impl ::protobuf::Clear for SystemInfo { fn clear(&mut self) { - self.clear_cpu_family(); - self.clear_cpu_subtype(); - self.clear_cpu_ext(); - self.clear_brand(); - self.clear_brand_flags(); - self.clear_os(); - self.clear_os_version(); - self.clear_os_ext(); - self.clear_system_information_string(); - self.clear_device_id(); + self.cpu_family = ::std::option::Option::None; + self.cpu_subtype = ::std::option::Option::None; + self.cpu_ext = ::std::option::Option::None; + self.brand = ::std::option::Option::None; + self.brand_flags = ::std::option::Option::None; + self.os = ::std::option::Option::None; + self.os_version = ::std::option::Option::None; + self.os_ext = ::std::option::Option::None; + self.system_information_string.clear(); + self.device_id.clear(); self.unknown_fields.clear(); } } @@ -2974,30 +2720,27 @@ pub struct LibspotifyAppKey { useragent: ::protobuf::SingularField<::std::string::String>, callback_hash: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LibspotifyAppKey {} +impl<'a> ::std::default::Default for &'a LibspotifyAppKey { + fn default() -> &'a LibspotifyAppKey { + ::default_instance() + } +} impl LibspotifyAppKey { pub fn new() -> LibspotifyAppKey { ::std::default::Default::default() } - pub fn default_instance() -> &'static LibspotifyAppKey { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LibspotifyAppKey, - }; - unsafe { - instance.get(LibspotifyAppKey::new) - } - } - // required uint32 version = 1; + + pub fn get_version(&self) -> u32 { + self.version.unwrap_or(0) + } pub fn clear_version(&mut self) { self.version = ::std::option::Option::None; } @@ -3011,20 +2754,15 @@ impl LibspotifyAppKey { self.version = ::std::option::Option::Some(v); } - pub fn get_version(&self) -> u32 { - self.version.unwrap_or(0) - } + // required bytes devkey = 2; - fn get_version_for_reflect(&self) -> &::std::option::Option { - &self.version - } - fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.version + pub fn get_devkey(&self) -> &[u8] { + match self.devkey.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes devkey = 2; - pub fn clear_devkey(&mut self) { self.devkey.clear(); } @@ -3052,23 +2790,15 @@ impl LibspotifyAppKey { self.devkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_devkey(&self) -> &[u8] { - match self.devkey.as_ref() { + // required bytes signature = 3; + + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { Some(v) => &v, None => &[], } } - - fn get_devkey_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.devkey - } - - fn mut_devkey_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.devkey - } - - // required bytes signature = 3; - pub fn clear_signature(&mut self) { self.signature.clear(); } @@ -3096,23 +2826,15 @@ impl LibspotifyAppKey { self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_signature(&self) -> &[u8] { - match self.signature.as_ref() { - Some(v) => &v, - None => &[], - } - } + // required string useragent = 4; - fn get_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.signature - } - fn mut_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.signature + pub fn get_useragent(&self) -> &str { + match self.useragent.as_ref() { + Some(v) => &v, + None => "", + } } - - // required string useragent = 4; - pub fn clear_useragent(&mut self) { self.useragent.clear(); } @@ -3140,23 +2862,15 @@ impl LibspotifyAppKey { self.useragent.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_useragent(&self) -> &str { - match self.useragent.as_ref() { - Some(v) => &v, - None => "", - } - } + // required bytes callback_hash = 5; - fn get_useragent_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.useragent - } - fn mut_useragent_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.useragent + pub fn get_callback_hash(&self) -> &[u8] { + match self.callback_hash.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes callback_hash = 5; - pub fn clear_callback_hash(&mut self) { self.callback_hash.clear(); } @@ -3183,21 +2897,6 @@ impl LibspotifyAppKey { pub fn take_callback_hash(&mut self) -> ::std::vec::Vec { self.callback_hash.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_callback_hash(&self) -> &[u8] { - match self.callback_hash.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_callback_hash_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.callback_hash - } - - fn mut_callback_hash_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.callback_hash - } } impl ::protobuf::Message for LibspotifyAppKey { @@ -3307,27 +3006,25 @@ impl ::protobuf::Message for LibspotifyAppKey { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LibspotifyAppKey { fn new() -> LibspotifyAppKey { LibspotifyAppKey::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3337,28 +3034,28 @@ impl ::protobuf::MessageStatic for LibspotifyAppKey { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "version", - LibspotifyAppKey::get_version_for_reflect, - LibspotifyAppKey::mut_version_for_reflect, + |m: &LibspotifyAppKey| { &m.version }, + |m: &mut LibspotifyAppKey| { &mut m.version }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "devkey", - LibspotifyAppKey::get_devkey_for_reflect, - LibspotifyAppKey::mut_devkey_for_reflect, + |m: &LibspotifyAppKey| { &m.devkey }, + |m: &mut LibspotifyAppKey| { &mut m.devkey }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "signature", - LibspotifyAppKey::get_signature_for_reflect, - LibspotifyAppKey::mut_signature_for_reflect, + |m: &LibspotifyAppKey| { &m.signature }, + |m: &mut LibspotifyAppKey| { &mut m.signature }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "useragent", - LibspotifyAppKey::get_useragent_for_reflect, - LibspotifyAppKey::mut_useragent_for_reflect, + |m: &LibspotifyAppKey| { &m.useragent }, + |m: &mut LibspotifyAppKey| { &mut m.useragent }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "callback_hash", - LibspotifyAppKey::get_callback_hash_for_reflect, - LibspotifyAppKey::mut_callback_hash_for_reflect, + |m: &LibspotifyAppKey| { &m.callback_hash }, + |m: &mut LibspotifyAppKey| { &mut m.callback_hash }, )); ::protobuf::reflect::MessageDescriptor::new::( "LibspotifyAppKey", @@ -3368,15 +3065,25 @@ impl ::protobuf::MessageStatic for LibspotifyAppKey { }) } } + + fn default_instance() -> &'static LibspotifyAppKey { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LibspotifyAppKey, + }; + unsafe { + instance.get(LibspotifyAppKey::new) + } + } } impl ::protobuf::Clear for LibspotifyAppKey { fn clear(&mut self) { - self.clear_version(); - self.clear_devkey(); - self.clear_signature(); - self.clear_useragent(); - self.clear_callback_hash(); + self.version = ::std::option::Option::None; + self.devkey.clear(); + self.signature.clear(); + self.useragent.clear(); + self.callback_hash.clear(); self.unknown_fields.clear(); } } @@ -3400,30 +3107,27 @@ pub struct ClientInfo { fb: ::protobuf::SingularPtrField, language: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ClientInfo {} +impl<'a> ::std::default::Default for &'a ClientInfo { + fn default() -> &'a ClientInfo { + ::default_instance() + } +} impl ClientInfo { pub fn new() -> ClientInfo { ::std::default::Default::default() } - pub fn default_instance() -> &'static ClientInfo { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ClientInfo, - }; - unsafe { - instance.get(ClientInfo::new) - } - } - // optional bool limited = 1; + + pub fn get_limited(&self) -> bool { + self.limited.unwrap_or(false) + } pub fn clear_limited(&mut self) { self.limited = ::std::option::Option::None; } @@ -3437,20 +3141,12 @@ impl ClientInfo { self.limited = ::std::option::Option::Some(v); } - pub fn get_limited(&self) -> bool { - self.limited.unwrap_or(false) - } + // optional .ClientInfoFacebook fb = 2; - fn get_limited_for_reflect(&self) -> &::std::option::Option { - &self.limited - } - fn mut_limited_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.limited + pub fn get_fb(&self) -> &ClientInfoFacebook { + self.fb.as_ref().unwrap_or_else(|| ClientInfoFacebook::default_instance()) } - - // optional .ClientInfoFacebook fb = 2; - pub fn clear_fb(&mut self) { self.fb.clear(); } @@ -3478,20 +3174,15 @@ impl ClientInfo { self.fb.take().unwrap_or_else(|| ClientInfoFacebook::new()) } - pub fn get_fb(&self) -> &ClientInfoFacebook { - self.fb.as_ref().unwrap_or_else(|| ClientInfoFacebook::default_instance()) - } + // optional string language = 3; - fn get_fb_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.fb - } - fn mut_fb_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.fb + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string language = 3; - pub fn clear_language(&mut self) { self.language.clear(); } @@ -3518,21 +3209,6 @@ impl ClientInfo { pub fn take_language(&mut self) -> ::std::string::String { self.language.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_language(&self) -> &str { - match self.language.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_language_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.language - } - - fn mut_language_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.language - } } impl ::protobuf::Message for ClientInfo { @@ -3617,27 +3293,25 @@ impl ::protobuf::Message for ClientInfo { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ClientInfo { fn new() -> ClientInfo { ClientInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3647,18 +3321,18 @@ impl ::protobuf::MessageStatic for ClientInfo { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "limited", - ClientInfo::get_limited_for_reflect, - ClientInfo::mut_limited_for_reflect, + |m: &ClientInfo| { &m.limited }, + |m: &mut ClientInfo| { &mut m.limited }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fb", - ClientInfo::get_fb_for_reflect, - ClientInfo::mut_fb_for_reflect, + |m: &ClientInfo| { &m.fb }, + |m: &mut ClientInfo| { &mut m.fb }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "language", - ClientInfo::get_language_for_reflect, - ClientInfo::mut_language_for_reflect, + |m: &ClientInfo| { &m.language }, + |m: &mut ClientInfo| { &mut m.language }, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientInfo", @@ -3668,13 +3342,23 @@ impl ::protobuf::MessageStatic for ClientInfo { }) } } + + fn default_instance() -> &'static ClientInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClientInfo, + }; + unsafe { + instance.get(ClientInfo::new) + } + } } impl ::protobuf::Clear for ClientInfo { fn clear(&mut self) { - self.clear_limited(); - self.clear_fb(); - self.clear_language(); + self.limited = ::std::option::Option::None; + self.fb.clear(); + self.language.clear(); self.unknown_fields.clear(); } } @@ -3696,30 +3380,30 @@ pub struct ClientInfoFacebook { // message fields machine_id: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ClientInfoFacebook {} +impl<'a> ::std::default::Default for &'a ClientInfoFacebook { + fn default() -> &'a ClientInfoFacebook { + ::default_instance() + } +} impl ClientInfoFacebook { pub fn new() -> ClientInfoFacebook { ::std::default::Default::default() } - pub fn default_instance() -> &'static ClientInfoFacebook { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ClientInfoFacebook, - }; - unsafe { - instance.get(ClientInfoFacebook::new) - } - } - // optional string machine_id = 1; + + pub fn get_machine_id(&self) -> &str { + match self.machine_id.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_machine_id(&mut self) { self.machine_id.clear(); } @@ -3746,21 +3430,6 @@ impl ClientInfoFacebook { pub fn take_machine_id(&mut self) -> ::std::string::String { self.machine_id.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_machine_id(&self) -> &str { - match self.machine_id.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_machine_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.machine_id - } - - fn mut_machine_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.machine_id - } } impl ::protobuf::Message for ClientInfoFacebook { @@ -3815,27 +3484,25 @@ impl ::protobuf::Message for ClientInfoFacebook { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ClientInfoFacebook { fn new() -> ClientInfoFacebook { ClientInfoFacebook::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3845,8 +3512,8 @@ impl ::protobuf::MessageStatic for ClientInfoFacebook { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "machine_id", - ClientInfoFacebook::get_machine_id_for_reflect, - ClientInfoFacebook::mut_machine_id_for_reflect, + |m: &ClientInfoFacebook| { &m.machine_id }, + |m: &mut ClientInfoFacebook| { &mut m.machine_id }, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientInfoFacebook", @@ -3856,11 +3523,21 @@ impl ::protobuf::MessageStatic for ClientInfoFacebook { }) } } + + fn default_instance() -> &'static ClientInfoFacebook { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClientInfoFacebook, + }; + unsafe { + instance.get(ClientInfoFacebook::new) + } + } } impl ::protobuf::Clear for ClientInfoFacebook { fn clear(&mut self) { - self.clear_machine_id(); + self.machine_id.clear(); self.unknown_fields.clear(); } } @@ -3889,30 +3566,30 @@ pub struct APWelcome { account_info: ::protobuf::SingularPtrField, fb: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for APWelcome {} +impl<'a> ::std::default::Default for &'a APWelcome { + fn default() -> &'a APWelcome { + ::default_instance() + } +} impl APWelcome { pub fn new() -> APWelcome { ::std::default::Default::default() } - pub fn default_instance() -> &'static APWelcome { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const APWelcome, - }; - unsafe { - instance.get(APWelcome::new) - } - } - // required string canonical_username = 10; + + pub fn get_canonical_username(&self) -> &str { + match self.canonical_username.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_canonical_username(&mut self) { self.canonical_username.clear(); } @@ -3929,34 +3606,23 @@ impl APWelcome { // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. pub fn mut_canonical_username(&mut self) -> &mut ::std::string::String { - if self.canonical_username.is_none() { - self.canonical_username.set_default(); - } - self.canonical_username.as_mut().unwrap() - } - - // Take field - pub fn take_canonical_username(&mut self) -> ::std::string::String { - self.canonical_username.take().unwrap_or_else(|| ::std::string::String::new()) - } - - pub fn get_canonical_username(&self) -> &str { - match self.canonical_username.as_ref() { - Some(v) => &v, - None => "", + if self.canonical_username.is_none() { + self.canonical_username.set_default(); } + self.canonical_username.as_mut().unwrap() } - fn get_canonical_username_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.canonical_username - } - - fn mut_canonical_username_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.canonical_username + // Take field + pub fn take_canonical_username(&mut self) -> ::std::string::String { + self.canonical_username.take().unwrap_or_else(|| ::std::string::String::new()) } // required .AccountType account_type_logged_in = 20; + + pub fn get_account_type_logged_in(&self) -> AccountType { + self.account_type_logged_in.unwrap_or(AccountType::Spotify) + } pub fn clear_account_type_logged_in(&mut self) { self.account_type_logged_in = ::std::option::Option::None; } @@ -3970,20 +3636,12 @@ impl APWelcome { self.account_type_logged_in = ::std::option::Option::Some(v); } - pub fn get_account_type_logged_in(&self) -> AccountType { - self.account_type_logged_in.unwrap_or(AccountType::Spotify) - } + // required .AccountType credentials_type_logged_in = 25; - fn get_account_type_logged_in_for_reflect(&self) -> &::std::option::Option { - &self.account_type_logged_in - } - fn mut_account_type_logged_in_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.account_type_logged_in + pub fn get_credentials_type_logged_in(&self) -> AccountType { + self.credentials_type_logged_in.unwrap_or(AccountType::Spotify) } - - // required .AccountType credentials_type_logged_in = 25; - pub fn clear_credentials_type_logged_in(&mut self) { self.credentials_type_logged_in = ::std::option::Option::None; } @@ -3997,20 +3655,12 @@ impl APWelcome { self.credentials_type_logged_in = ::std::option::Option::Some(v); } - pub fn get_credentials_type_logged_in(&self) -> AccountType { - self.credentials_type_logged_in.unwrap_or(AccountType::Spotify) - } + // required .AuthenticationType reusable_auth_credentials_type = 30; - fn get_credentials_type_logged_in_for_reflect(&self) -> &::std::option::Option { - &self.credentials_type_logged_in - } - fn mut_credentials_type_logged_in_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.credentials_type_logged_in + pub fn get_reusable_auth_credentials_type(&self) -> AuthenticationType { + self.reusable_auth_credentials_type.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) } - - // required .AuthenticationType reusable_auth_credentials_type = 30; - pub fn clear_reusable_auth_credentials_type(&mut self) { self.reusable_auth_credentials_type = ::std::option::Option::None; } @@ -4024,20 +3674,15 @@ impl APWelcome { self.reusable_auth_credentials_type = ::std::option::Option::Some(v); } - pub fn get_reusable_auth_credentials_type(&self) -> AuthenticationType { - self.reusable_auth_credentials_type.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) - } + // required bytes reusable_auth_credentials = 40; - fn get_reusable_auth_credentials_type_for_reflect(&self) -> &::std::option::Option { - &self.reusable_auth_credentials_type - } - fn mut_reusable_auth_credentials_type_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.reusable_auth_credentials_type + pub fn get_reusable_auth_credentials(&self) -> &[u8] { + match self.reusable_auth_credentials.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes reusable_auth_credentials = 40; - pub fn clear_reusable_auth_credentials(&mut self) { self.reusable_auth_credentials.clear(); } @@ -4065,23 +3710,15 @@ impl APWelcome { self.reusable_auth_credentials.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_reusable_auth_credentials(&self) -> &[u8] { - match self.reusable_auth_credentials.as_ref() { + // optional bytes lfs_secret = 50; + + + pub fn get_lfs_secret(&self) -> &[u8] { + match self.lfs_secret.as_ref() { Some(v) => &v, None => &[], } } - - fn get_reusable_auth_credentials_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.reusable_auth_credentials - } - - fn mut_reusable_auth_credentials_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.reusable_auth_credentials - } - - // optional bytes lfs_secret = 50; - pub fn clear_lfs_secret(&mut self) { self.lfs_secret.clear(); } @@ -4109,23 +3746,12 @@ impl APWelcome { self.lfs_secret.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_lfs_secret(&self) -> &[u8] { - match self.lfs_secret.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional .AccountInfo account_info = 60; - fn get_lfs_secret_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.lfs_secret - } - fn mut_lfs_secret_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.lfs_secret + pub fn get_account_info(&self) -> &AccountInfo { + self.account_info.as_ref().unwrap_or_else(|| AccountInfo::default_instance()) } - - // optional .AccountInfo account_info = 60; - pub fn clear_account_info(&mut self) { self.account_info.clear(); } @@ -4153,20 +3779,12 @@ impl APWelcome { self.account_info.take().unwrap_or_else(|| AccountInfo::new()) } - pub fn get_account_info(&self) -> &AccountInfo { - self.account_info.as_ref().unwrap_or_else(|| AccountInfo::default_instance()) - } + // optional .AccountInfoFacebook fb = 70; - fn get_account_info_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.account_info - } - fn mut_account_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.account_info + pub fn get_fb(&self) -> &AccountInfoFacebook { + self.fb.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) } - - // optional .AccountInfoFacebook fb = 70; - pub fn clear_fb(&mut self) { self.fb.clear(); } @@ -4193,18 +3811,6 @@ impl APWelcome { pub fn take_fb(&mut self) -> AccountInfoFacebook { self.fb.take().unwrap_or_else(|| AccountInfoFacebook::new()) } - - pub fn get_fb(&self) -> &AccountInfoFacebook { - self.fb.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) - } - - fn get_fb_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.fb - } - - fn mut_fb_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.fb - } } impl ::protobuf::Message for APWelcome { @@ -4245,25 +3851,13 @@ impl ::protobuf::Message for APWelcome { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.canonical_username)?; }, 20 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.account_type_logged_in = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.account_type_logged_in, 20, &mut self.unknown_fields)? }, 25 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.credentials_type_logged_in = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.credentials_type_logged_in, 25, &mut self.unknown_fields)? }, 30 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.reusable_auth_credentials_type = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.reusable_auth_credentials_type, 30, &mut self.unknown_fields)? }, 40 => { ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.reusable_auth_credentials)?; @@ -4365,27 +3959,25 @@ impl ::protobuf::Message for APWelcome { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for APWelcome { fn new() -> APWelcome { APWelcome::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4395,43 +3987,43 @@ impl ::protobuf::MessageStatic for APWelcome { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "canonical_username", - APWelcome::get_canonical_username_for_reflect, - APWelcome::mut_canonical_username_for_reflect, + |m: &APWelcome| { &m.canonical_username }, + |m: &mut APWelcome| { &mut m.canonical_username }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "account_type_logged_in", - APWelcome::get_account_type_logged_in_for_reflect, - APWelcome::mut_account_type_logged_in_for_reflect, + |m: &APWelcome| { &m.account_type_logged_in }, + |m: &mut APWelcome| { &mut m.account_type_logged_in }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "credentials_type_logged_in", - APWelcome::get_credentials_type_logged_in_for_reflect, - APWelcome::mut_credentials_type_logged_in_for_reflect, + |m: &APWelcome| { &m.credentials_type_logged_in }, + |m: &mut APWelcome| { &mut m.credentials_type_logged_in }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "reusable_auth_credentials_type", - APWelcome::get_reusable_auth_credentials_type_for_reflect, - APWelcome::mut_reusable_auth_credentials_type_for_reflect, + |m: &APWelcome| { &m.reusable_auth_credentials_type }, + |m: &mut APWelcome| { &mut m.reusable_auth_credentials_type }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "reusable_auth_credentials", - APWelcome::get_reusable_auth_credentials_for_reflect, - APWelcome::mut_reusable_auth_credentials_for_reflect, + |m: &APWelcome| { &m.reusable_auth_credentials }, + |m: &mut APWelcome| { &mut m.reusable_auth_credentials }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "lfs_secret", - APWelcome::get_lfs_secret_for_reflect, - APWelcome::mut_lfs_secret_for_reflect, + |m: &APWelcome| { &m.lfs_secret }, + |m: &mut APWelcome| { &mut m.lfs_secret }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "account_info", - APWelcome::get_account_info_for_reflect, - APWelcome::mut_account_info_for_reflect, + |m: &APWelcome| { &m.account_info }, + |m: &mut APWelcome| { &mut m.account_info }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fb", - APWelcome::get_fb_for_reflect, - APWelcome::mut_fb_for_reflect, + |m: &APWelcome| { &m.fb }, + |m: &mut APWelcome| { &mut m.fb }, )); ::protobuf::reflect::MessageDescriptor::new::( "APWelcome", @@ -4441,18 +4033,28 @@ impl ::protobuf::MessageStatic for APWelcome { }) } } + + fn default_instance() -> &'static APWelcome { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const APWelcome, + }; + unsafe { + instance.get(APWelcome::new) + } + } } impl ::protobuf::Clear for APWelcome { fn clear(&mut self) { - self.clear_canonical_username(); - self.clear_account_type_logged_in(); - self.clear_credentials_type_logged_in(); - self.clear_reusable_auth_credentials_type(); - self.clear_reusable_auth_credentials(); - self.clear_lfs_secret(); - self.clear_account_info(); - self.clear_fb(); + self.canonical_username.clear(); + self.account_type_logged_in = ::std::option::Option::None; + self.credentials_type_logged_in = ::std::option::Option::None; + self.reusable_auth_credentials_type = ::std::option::Option::None; + self.reusable_auth_credentials.clear(); + self.lfs_secret.clear(); + self.account_info.clear(); + self.fb.clear(); self.unknown_fields.clear(); } } @@ -4475,30 +4077,27 @@ pub struct AccountInfo { spotify: ::protobuf::SingularPtrField, facebook: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for AccountInfo {} +impl<'a> ::std::default::Default for &'a AccountInfo { + fn default() -> &'a AccountInfo { + ::default_instance() + } +} impl AccountInfo { pub fn new() -> AccountInfo { ::std::default::Default::default() } - pub fn default_instance() -> &'static AccountInfo { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const AccountInfo, - }; - unsafe { - instance.get(AccountInfo::new) - } - } - // optional .AccountInfoSpotify spotify = 1; + + pub fn get_spotify(&self) -> &AccountInfoSpotify { + self.spotify.as_ref().unwrap_or_else(|| AccountInfoSpotify::default_instance()) + } pub fn clear_spotify(&mut self) { self.spotify.clear(); } @@ -4526,20 +4125,12 @@ impl AccountInfo { self.spotify.take().unwrap_or_else(|| AccountInfoSpotify::new()) } - pub fn get_spotify(&self) -> &AccountInfoSpotify { - self.spotify.as_ref().unwrap_or_else(|| AccountInfoSpotify::default_instance()) - } + // optional .AccountInfoFacebook facebook = 2; - fn get_spotify_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.spotify - } - fn mut_spotify_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.spotify + pub fn get_facebook(&self) -> &AccountInfoFacebook { + self.facebook.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) } - - // optional .AccountInfoFacebook facebook = 2; - pub fn clear_facebook(&mut self) { self.facebook.clear(); } @@ -4566,18 +4157,6 @@ impl AccountInfo { pub fn take_facebook(&mut self) -> AccountInfoFacebook { self.facebook.take().unwrap_or_else(|| AccountInfoFacebook::new()) } - - pub fn get_facebook(&self) -> &AccountInfoFacebook { - self.facebook.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) - } - - fn get_facebook_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.facebook - } - - fn mut_facebook_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.facebook - } } impl ::protobuf::Message for AccountInfo { @@ -4657,27 +4236,25 @@ impl ::protobuf::Message for AccountInfo { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for AccountInfo { fn new() -> AccountInfo { AccountInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4687,13 +4264,13 @@ impl ::protobuf::MessageStatic for AccountInfo { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "spotify", - AccountInfo::get_spotify_for_reflect, - AccountInfo::mut_spotify_for_reflect, + |m: &AccountInfo| { &m.spotify }, + |m: &mut AccountInfo| { &mut m.spotify }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "facebook", - AccountInfo::get_facebook_for_reflect, - AccountInfo::mut_facebook_for_reflect, + |m: &AccountInfo| { &m.facebook }, + |m: &mut AccountInfo| { &mut m.facebook }, )); ::protobuf::reflect::MessageDescriptor::new::( "AccountInfo", @@ -4703,12 +4280,22 @@ impl ::protobuf::MessageStatic for AccountInfo { }) } } + + fn default_instance() -> &'static AccountInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AccountInfo, + }; + unsafe { + instance.get(AccountInfo::new) + } + } } impl ::protobuf::Clear for AccountInfo { fn clear(&mut self) { - self.clear_spotify(); - self.clear_facebook(); + self.spotify.clear(); + self.facebook.clear(); self.unknown_fields.clear(); } } @@ -4728,27 +4315,20 @@ impl ::protobuf::reflect::ProtobufValue for AccountInfo { #[derive(PartialEq,Clone,Default)] pub struct AccountInfoSpotify { // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for AccountInfoSpotify {} +impl<'a> ::std::default::Default for &'a AccountInfoSpotify { + fn default() -> &'a AccountInfoSpotify { + ::default_instance() + } +} impl AccountInfoSpotify { pub fn new() -> AccountInfoSpotify { ::std::default::Default::default() } - - pub fn default_instance() -> &'static AccountInfoSpotify { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const AccountInfoSpotify, - }; - unsafe { - instance.get(AccountInfoSpotify::new) - } - } } impl ::protobuf::Message for AccountInfoSpotify { @@ -4794,27 +4374,25 @@ impl ::protobuf::Message for AccountInfoSpotify { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for AccountInfoSpotify { fn new() -> AccountInfoSpotify { AccountInfoSpotify::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4830,6 +4408,16 @@ impl ::protobuf::MessageStatic for AccountInfoSpotify { }) } } + + fn default_instance() -> &'static AccountInfoSpotify { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AccountInfoSpotify, + }; + unsafe { + instance.get(AccountInfoSpotify::new) + } + } } impl ::protobuf::Clear for AccountInfoSpotify { @@ -4856,30 +4444,30 @@ pub struct AccountInfoFacebook { access_token: ::protobuf::SingularField<::std::string::String>, machine_id: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for AccountInfoFacebook {} +impl<'a> ::std::default::Default for &'a AccountInfoFacebook { + fn default() -> &'a AccountInfoFacebook { + ::default_instance() + } +} impl AccountInfoFacebook { pub fn new() -> AccountInfoFacebook { ::std::default::Default::default() } - pub fn default_instance() -> &'static AccountInfoFacebook { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const AccountInfoFacebook, - }; - unsafe { - instance.get(AccountInfoFacebook::new) - } - } - // optional string access_token = 1; + + pub fn get_access_token(&self) -> &str { + match self.access_token.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_access_token(&mut self) { self.access_token.clear(); } @@ -4907,23 +4495,15 @@ impl AccountInfoFacebook { self.access_token.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_access_token(&self) -> &str { - match self.access_token.as_ref() { + // optional string machine_id = 2; + + + pub fn get_machine_id(&self) -> &str { + match self.machine_id.as_ref() { Some(v) => &v, None => "", } } - - fn get_access_token_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.access_token - } - - fn mut_access_token_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.access_token - } - - // optional string machine_id = 2; - pub fn clear_machine_id(&mut self) { self.machine_id.clear(); } @@ -4950,21 +4530,6 @@ impl AccountInfoFacebook { pub fn take_machine_id(&mut self) -> ::std::string::String { self.machine_id.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_machine_id(&self) -> &str { - match self.machine_id.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_machine_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.machine_id - } - - fn mut_machine_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.machine_id - } } impl ::protobuf::Message for AccountInfoFacebook { @@ -5028,27 +4593,25 @@ impl ::protobuf::Message for AccountInfoFacebook { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for AccountInfoFacebook { fn new() -> AccountInfoFacebook { AccountInfoFacebook::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5058,13 +4621,13 @@ impl ::protobuf::MessageStatic for AccountInfoFacebook { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "access_token", - AccountInfoFacebook::get_access_token_for_reflect, - AccountInfoFacebook::mut_access_token_for_reflect, + |m: &AccountInfoFacebook| { &m.access_token }, + |m: &mut AccountInfoFacebook| { &mut m.access_token }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "machine_id", - AccountInfoFacebook::get_machine_id_for_reflect, - AccountInfoFacebook::mut_machine_id_for_reflect, + |m: &AccountInfoFacebook| { &m.machine_id }, + |m: &mut AccountInfoFacebook| { &mut m.machine_id }, )); ::protobuf::reflect::MessageDescriptor::new::( "AccountInfoFacebook", @@ -5074,12 +4637,22 @@ impl ::protobuf::MessageStatic for AccountInfoFacebook { }) } } + + fn default_instance() -> &'static AccountInfoFacebook { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AccountInfoFacebook, + }; + unsafe { + instance.get(AccountInfoFacebook::new) + } + } } impl ::protobuf::Clear for AccountInfoFacebook { fn clear(&mut self) { - self.clear_access_token(); - self.clear_machine_id(); + self.access_token.clear(); + self.machine_id.clear(); self.unknown_fields.clear(); } } @@ -5132,7 +4705,7 @@ impl ::protobuf::ProtobufEnum for AuthenticationType { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5148,6 +4721,12 @@ impl ::protobuf::ProtobufEnum for AuthenticationType { impl ::std::marker::Copy for AuthenticationType { } +impl ::std::default::Default for AuthenticationType { + fn default() -> Self { + AuthenticationType::AUTHENTICATION_USER_PASS + } +} + impl ::protobuf::reflect::ProtobufValue for AuthenticationType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5181,7 +4760,7 @@ impl ::protobuf::ProtobufEnum for AccountCreation { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5197,6 +4776,13 @@ impl ::protobuf::ProtobufEnum for AccountCreation { impl ::std::marker::Copy for AccountCreation { } +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for AccountCreation { + fn default() -> Self { + AccountCreation::ACCOUNT_CREATION_ALWAYS_PROMPT + } +} + impl ::protobuf::reflect::ProtobufValue for AccountCreation { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5254,7 +4840,7 @@ impl ::protobuf::ProtobufEnum for CpuFamily { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5270,6 +4856,12 @@ impl ::protobuf::ProtobufEnum for CpuFamily { impl ::std::marker::Copy for CpuFamily { } +impl ::std::default::Default for CpuFamily { + fn default() -> Self { + CpuFamily::CPU_UNKNOWN + } +} + impl ::protobuf::reflect::ProtobufValue for CpuFamily { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5309,7 +4901,7 @@ impl ::protobuf::ProtobufEnum for Brand { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5325,6 +4917,12 @@ impl ::protobuf::ProtobufEnum for Brand { impl ::std::marker::Copy for Brand { } +impl ::std::default::Default for Brand { + fn default() -> Self { + Brand::BRAND_UNBRANDED + } +} + impl ::protobuf::reflect::ProtobufValue for Brand { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5421,7 +5019,7 @@ impl ::protobuf::ProtobufEnum for Os { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5437,6 +5035,12 @@ impl ::protobuf::ProtobufEnum for Os { impl ::std::marker::Copy for Os { } +impl ::std::default::Default for Os { + fn default() -> Self { + Os::OS_UNKNOWN + } +} + impl ::protobuf::reflect::ProtobufValue for Os { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5470,7 +5074,7 @@ impl ::protobuf::ProtobufEnum for AccountType { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5486,6 +5090,12 @@ impl ::protobuf::ProtobufEnum for AccountType { impl ::std::marker::Copy for AccountType { } +impl ::std::default::Default for AccountType { + fn default() -> Self { + AccountType::Spotify + } +} + impl ::protobuf::reflect::ProtobufValue for AccountType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5493,374 +5103,77 @@ impl ::protobuf::reflect::ProtobufValue for AccountType { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x14authentication.proto\"\xec\x03\n\x17ClientResponseEncrypted\x12>\n\ - \x11login_credentials\x18\n\x20\x02(\x0b2\x11.LoginCredentialsR\x10login\ - Credentials\x12;\n\x10account_creation\x18\x14\x20\x01(\x0e2\x10.Account\ - CreationR\x0faccountCreation\x12L\n\x14fingerprint_response\x18\x1e\x20\ - \x01(\x0b2\x19.FingerprintResponseUnionR\x13fingerprintResponse\x121\n\ - \x0bpeer_ticket\x18(\x20\x01(\x0b2\x10.PeerTicketUnionR\npeerTicket\x12,\ - \n\x0bsystem_info\x182\x20\x02(\x0b2\x0b.SystemInfoR\nsystemInfo\x12%\n\ - \x0eplatform_model\x18<\x20\x01(\tR\rplatformModel\x12%\n\x0eversion_str\ - ing\x18F\x20\x01(\tR\rversionString\x12)\n\x06appkey\x18P\x20\x01(\x0b2\ - \x11.LibspotifyAppKeyR\x06appkey\x12,\n\x0bclient_info\x18Z\x20\x01(\x0b\ - 2\x0b.ClientInfoR\nclientInfo\"r\n\x10LoginCredentials\x12\x1a\n\x08user\ - name\x18\n\x20\x01(\tR\x08username\x12%\n\x03typ\x18\x14\x20\x02(\x0e2\ - \x13.AuthenticationTypeR\x03typ\x12\x1b\n\tauth_data\x18\x1e\x20\x01(\ - \x0cR\x08authData\"\x8c\x01\n\x18FingerprintResponseUnion\x12/\n\x05grai\ - n\x18\n\x20\x01(\x0b2\x19.FingerprintGrainResponseR\x05grain\x12?\n\x0bh\ - mac_ripemd\x18\x14\x20\x01(\x0b2\x1e.FingerprintHmacRipemdResponseR\nhma\ - cRipemd\"?\n\x18FingerprintGrainResponse\x12#\n\rencrypted_key\x18\n\x20\ - \x02(\x0cR\x0cencryptedKey\"3\n\x1dFingerprintHmacRipemdResponse\x12\x12\ - \n\x04hmac\x18\n\x20\x02(\x0cR\x04hmac\"u\n\x0fPeerTicketUnion\x123\n\np\ - ublic_key\x18\n\x20\x01(\x0b2\x14.PeerTicketPublicKeyR\tpublicKey\x12-\n\ - \nold_ticket\x18\x14\x20\x01(\x0b2\x0e.PeerTicketOldR\toldTicket\"4\n\ - \x13PeerTicketPublicKey\x12\x1d\n\npublic_key\x18\n\x20\x02(\x0cR\tpubli\ - cKey\"d\n\rPeerTicketOld\x12\x1f\n\x0bpeer_ticket\x18\n\x20\x02(\x0cR\np\ - eerTicket\x122\n\x15peer_ticket_signature\x18\x14\x20\x02(\x0cR\x13peerT\ - icketSignature\"\xd4\x02\n\nSystemInfo\x12)\n\ncpu_family\x18\n\x20\x02(\ - \x0e2\n.CpuFamilyR\tcpuFamily\x12\x1f\n\x0bcpu_subtype\x18\x14\x20\x01(\ - \rR\ncpuSubtype\x12\x17\n\x07cpu_ext\x18\x1e\x20\x01(\rR\x06cpuExt\x12\ - \x1c\n\x05brand\x18(\x20\x01(\x0e2\x06.BrandR\x05brand\x12\x1f\n\x0bbran\ - d_flags\x182\x20\x01(\rR\nbrandFlags\x12\x13\n\x02os\x18<\x20\x02(\x0e2\ - \x03.OsR\x02os\x12\x1d\n\nos_version\x18F\x20\x01(\rR\tosVersion\x12\x15\ - \n\x06os_ext\x18P\x20\x01(\rR\x05osExt\x12:\n\x19system_information_stri\ - ng\x18Z\x20\x01(\tR\x17systemInformationString\x12\x1b\n\tdevice_id\x18d\ - \x20\x01(\tR\x08deviceId\"\xa5\x01\n\x10LibspotifyAppKey\x12\x18\n\x07ve\ - rsion\x18\x01\x20\x02(\rR\x07version\x12\x16\n\x06devkey\x18\x02\x20\x02\ - (\x0cR\x06devkey\x12\x1c\n\tsignature\x18\x03\x20\x02(\x0cR\tsignature\ - \x12\x1c\n\tuseragent\x18\x04\x20\x02(\tR\tuseragent\x12#\n\rcallback_ha\ - sh\x18\x05\x20\x02(\x0cR\x0ccallbackHash\"g\n\nClientInfo\x12\x18\n\x07l\ - imited\x18\x01\x20\x01(\x08R\x07limited\x12#\n\x02fb\x18\x02\x20\x01(\ - \x0b2\x13.ClientInfoFacebookR\x02fb\x12\x1a\n\x08language\x18\x03\x20\ - \x01(\tR\x08language\"3\n\x12ClientInfoFacebook\x12\x1d\n\nmachine_id\ - \x18\x01\x20\x01(\tR\tmachineId\"\xd4\x03\n\tAPWelcome\x12-\n\x12canonic\ - al_username\x18\n\x20\x02(\tR\x11canonicalUsername\x12A\n\x16account_typ\ - e_logged_in\x18\x14\x20\x02(\x0e2\x0c.AccountTypeR\x13accountTypeLoggedI\ - n\x12I\n\x1acredentials_type_logged_in\x18\x19\x20\x02(\x0e2\x0c.Account\ - TypeR\x17credentialsTypeLoggedIn\x12X\n\x1ereusable_auth_credentials_typ\ - e\x18\x1e\x20\x02(\x0e2\x13.AuthenticationTypeR\x1breusableAuthCredentia\ - lsType\x12:\n\x19reusable_auth_credentials\x18(\x20\x02(\x0cR\x17reusabl\ - eAuthCredentials\x12\x1d\n\nlfs_secret\x182\x20\x01(\x0cR\tlfsSecret\x12\ - /\n\x0caccount_info\x18<\x20\x01(\x0b2\x0c.AccountInfoR\x0baccountInfo\ - \x12$\n\x02fb\x18F\x20\x01(\x0b2\x14.AccountInfoFacebookR\x02fb\"n\n\x0b\ - AccountInfo\x12-\n\x07spotify\x18\x01\x20\x01(\x0b2\x13.AccountInfoSpoti\ - fyR\x07spotify\x120\n\x08facebook\x18\x02\x20\x01(\x0b2\x14.AccountInfoF\ - acebookR\x08facebook\"\x14\n\x12AccountInfoSpotify\"W\n\x13AccountInfoFa\ - cebook\x12!\n\x0caccess_token\x18\x01\x20\x01(\tR\x0baccessToken\x12\x1d\ - \n\nmachine_id\x18\x02\x20\x01(\tR\tmachineId*\xd6\x01\n\x12Authenticati\ - onType\x12\x1c\n\x18AUTHENTICATION_USER_PASS\x10\0\x12-\n)AUTHENTICATION\ - _STORED_SPOTIFY_CREDENTIALS\x10\x01\x12.\n*AUTHENTICATION_STORED_FACEBOO\ - K_CREDENTIALS\x10\x02\x12\x20\n\x1cAUTHENTICATION_SPOTIFY_TOKEN\x10\x03\ - \x12!\n\x1dAUTHENTICATION_FACEBOOK_TOKEN\x10\x04*Y\n\x0fAccountCreation\ - \x12\"\n\x1eACCOUNT_CREATION_ALWAYS_PROMPT\x10\x01\x12\"\n\x1eACCOUNT_CR\ - EATION_ALWAYS_CREATE\x10\x03*\x9d\x01\n\tCpuFamily\x12\x0f\n\x0bCPU_UNKN\ - OWN\x10\0\x12\x0b\n\x07CPU_X86\x10\x01\x12\x0e\n\nCPU_X86_64\x10\x02\x12\ - \x0b\n\x07CPU_PPC\x10\x03\x12\x0e\n\nCPU_PPC_64\x10\x04\x12\x0b\n\x07CPU\ - _ARM\x10\x05\x12\x0c\n\x08CPU_IA64\x10\x06\x12\n\n\x06CPU_SH\x10\x07\x12\ - \x0c\n\x08CPU_MIPS\x10\x08\x12\x10\n\x0cCPU_BLACKFIN\x10\t*K\n\x05Brand\ - \x12\x13\n\x0fBRAND_UNBRANDED\x10\0\x12\r\n\tBRAND_INQ\x10\x01\x12\r\n\t\ - BRAND_HTC\x10\x02\x12\x0f\n\x0bBRAND_NOKIA\x10\x03*\xd1\x02\n\x02Os\x12\ - \x0e\n\nOS_UNKNOWN\x10\0\x12\x0e\n\nOS_WINDOWS\x10\x01\x12\n\n\x06OS_OSX\ - \x10\x02\x12\r\n\tOS_IPHONE\x10\x03\x12\n\n\x06OS_S60\x10\x04\x12\x0c\n\ - \x08OS_LINUX\x10\x05\x12\x11\n\rOS_WINDOWS_CE\x10\x06\x12\x0e\n\nOS_ANDR\ - OID\x10\x07\x12\x0b\n\x07OS_PALM\x10\x08\x12\x0e\n\nOS_FREEBSD\x10\t\x12\ - \x11\n\rOS_BLACKBERRY\x10\n\x12\x0c\n\x08OS_SONOS\x10\x0b\x12\x0f\n\x0bO\ - S_LOGITECH\x10\x0c\x12\n\n\x06OS_WP7\x10\r\x12\x0c\n\x08OS_ONKYO\x10\x0e\ - \x12\x0e\n\nOS_PHILIPS\x10\x0f\x12\t\n\x05OS_WD\x10\x10\x12\x0c\n\x08OS_\ - VOLVO\x10\x11\x12\x0b\n\x07OS_TIVO\x10\x12\x12\x0b\n\x07OS_AWOX\x10\x13\ - \x12\x0c\n\x08OS_MEEGO\x10\x14\x12\r\n\tOS_QNXNTO\x10\x15\x12\n\n\x06OS_\ - BCO\x10\x16*(\n\x0bAccountType\x12\x0b\n\x07Spotify\x10\0\x12\x0c\n\x08F\ - acebook\x10\x01J\xee/\n\x07\x12\x05\0\0\xa4\x01\x01\n\x08\n\x01\x0c\x12\ - \x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x0c\x01\n\n\n\x03\x04\0\x01\ - \x12\x03\x02\x08\x1f\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x046\n\x0c\n\ - \x05\x04\0\x02\0\x04\x12\x03\x03\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x06\x12\ - \x03\x03\r\x1d\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x1e/\n\x0c\n\x05\ - \x04\0\x02\0\x03\x12\x03\x0325\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\ - 5\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x04\x04\x0c\n\x0c\n\x05\x04\0\ - \x02\x01\x06\x12\x03\x04\r\x1c\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\ - \x1d-\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x0404\n\x0b\n\x04\x04\0\x02\ - \x02\x12\x03\x05\x04B\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\x05\x04\x0c\ - \n\x0c\n\x05\x04\0\x02\x02\x06\x12\x03\x05\r%\n\x0c\n\x05\x04\0\x02\x02\ - \x01\x12\x03\x05&:\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05=A\n\x0b\n\ - \x04\x04\0\x02\x03\x12\x03\x06\x040\n\x0c\n\x05\x04\0\x02\x03\x04\x12\ - \x03\x06\x04\x0c\n\x0c\n\x05\x04\0\x02\x03\x06\x12\x03\x06\r\x1c\n\x0c\n\ - \x05\x04\0\x02\x03\x01\x12\x03\x06\x1d(\n\x0c\n\x05\x04\0\x02\x03\x03\ - \x12\x03\x06+/\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x04+\n\x0c\n\x05\ - \x04\0\x02\x04\x04\x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x06\x12\ - \x03\x07\r\x17\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\x18#\n\x0c\n\ - \x05\x04\0\x02\x04\x03\x12\x03\x07&*\n\x0b\n\x04\x04\0\x02\x05\x12\x03\ - \x08\x04*\n\x0c\n\x05\x04\0\x02\x05\x04\x12\x03\x08\x04\x0c\n\x0c\n\x05\ - \x04\0\x02\x05\x05\x12\x03\x08\r\x13\n\x0c\n\x05\x04\0\x02\x05\x01\x12\ - \x03\x08\x14\"\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x08%)\n\x0b\n\x04\ - \x04\0\x02\x06\x12\x03\t\x04*\n\x0c\n\x05\x04\0\x02\x06\x04\x12\x03\t\ - \x04\x0c\n\x0c\n\x05\x04\0\x02\x06\x05\x12\x03\t\r\x13\n\x0c\n\x05\x04\0\ - \x02\x06\x01\x12\x03\t\x14\"\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\t%)\n\ - \x0b\n\x04\x04\0\x02\x07\x12\x03\n\x04,\n\x0c\n\x05\x04\0\x02\x07\x04\ - \x12\x03\n\x04\x0c\n\x0c\n\x05\x04\0\x02\x07\x06\x12\x03\n\r\x1d\n\x0c\n\ - \x05\x04\0\x02\x07\x01\x12\x03\n\x1e$\n\x0c\n\x05\x04\0\x02\x07\x03\x12\ - \x03\n'+\n\x0b\n\x04\x04\0\x02\x08\x12\x03\x0b\x04+\n\x0c\n\x05\x04\0\ - \x02\x08\x04\x12\x03\x0b\x04\x0c\n\x0c\n\x05\x04\0\x02\x08\x06\x12\x03\ - \x0b\r\x17\n\x0c\n\x05\x04\0\x02\x08\x01\x12\x03\x0b\x18#\n\x0c\n\x05\ - \x04\0\x02\x08\x03\x12\x03\x0b&*\n\n\n\x02\x04\x01\x12\x04\x0e\0\x12\x01\ - \n\n\n\x03\x04\x01\x01\x12\x03\x0e\x08\x18\n\x0b\n\x04\x04\x01\x02\0\x12\ - \x03\x0f\x04#\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x0f\x04\x0c\n\x0c\n\ - \x05\x04\x01\x02\0\x05\x12\x03\x0f\r\x13\n\x0c\n\x05\x04\x01\x02\0\x01\ - \x12\x03\x0f\x14\x1c\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0f\x1f\"\n\ - \x0b\n\x04\x04\x01\x02\x01\x12\x03\x10\x04+\n\x0c\n\x05\x04\x01\x02\x01\ - \x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03\x10\r\ - \x1f\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x10\x20#\n\x0c\n\x05\x04\ - \x01\x02\x01\x03\x12\x03\x10&*\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x11\ - \x04$\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03\x11\x04\x0c\n\x0c\n\x05\ - \x04\x01\x02\x02\x05\x12\x03\x11\r\x12\n\x0c\n\x05\x04\x01\x02\x02\x01\ - \x12\x03\x11\x13\x1c\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x11\x1f#\n\ - \n\n\x02\x05\0\x12\x04\x14\0\x1a\x01\n\n\n\x03\x05\0\x01\x12\x03\x14\x05\ - \x17\n\x0b\n\x04\x05\0\x02\0\x12\x03\x15\x04#\n\x0c\n\x05\x05\0\x02\0\ - \x01\x12\x03\x15\x04\x1c\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x15\x1f\"\n\ - \x0b\n\x04\x05\0\x02\x01\x12\x03\x16\x044\n\x0c\n\x05\x05\0\x02\x01\x01\ - \x12\x03\x16\x04-\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x1603\n\x0b\n\ - \x04\x05\0\x02\x02\x12\x03\x17\x045\n\x0c\n\x05\x05\0\x02\x02\x01\x12\ - \x03\x17\x04.\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x1714\n\x0b\n\x04\ - \x05\0\x02\x03\x12\x03\x18\x04'\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\ - \x18\x04\x20\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x18#&\n\x0b\n\x04\x05\ - \0\x02\x04\x12\x03\x19\x04(\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x19\ - \x04!\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x19$'\n\n\n\x02\x05\x01\x12\ - \x04\x1c\0\x1f\x01\n\n\n\x03\x05\x01\x01\x12\x03\x1c\x05\x14\n\x0b\n\x04\ - \x05\x01\x02\0\x12\x03\x1d\x04)\n\x0c\n\x05\x05\x01\x02\0\x01\x12\x03\ - \x1d\x04\"\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03\x1d%(\n\x0b\n\x04\x05\ - \x01\x02\x01\x12\x03\x1e\x04)\n\x0c\n\x05\x05\x01\x02\x01\x01\x12\x03\ - \x1e\x04\"\n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03\x1e%(\n\n\n\x02\x04\ - \x02\x12\x04!\0$\x01\n\n\n\x03\x04\x02\x01\x12\x03!\x08\x20\n\x0b\n\x04\ - \x04\x02\x02\0\x12\x03\"\x042\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\"\ - \x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x06\x12\x03\"\r%\n\x0c\n\x05\x04\x02\ - \x02\0\x01\x12\x03\"&+\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\".1\n\x0b\n\ - \x04\x04\x02\x02\x01\x12\x03#\x04>\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\ - \x03#\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03#\r*\n\x0c\n\x05\ - \x04\x02\x02\x01\x01\x12\x03#+6\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03#\ - 9=\n\n\n\x02\x04\x03\x12\x04&\0(\x01\n\n\n\x03\x04\x03\x01\x12\x03&\x08\ - \x20\n\x0b\n\x04\x04\x03\x02\0\x12\x03'\x04'\n\x0c\n\x05\x04\x03\x02\0\ - \x04\x12\x03'\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03'\r\x12\n\x0c\ - \n\x05\x04\x03\x02\0\x01\x12\x03'\x13\x20\n\x0c\n\x05\x04\x03\x02\0\x03\ - \x12\x03'#&\n\n\n\x02\x04\x04\x12\x04*\0,\x01\n\n\n\x03\x04\x04\x01\x12\ - \x03*\x08%\n\x0b\n\x04\x04\x04\x02\0\x12\x03+\x04\x1e\n\x0c\n\x05\x04\ - \x04\x02\0\x04\x12\x03+\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03+\r\ - \x12\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03+\x13\x17\n\x0c\n\x05\x04\x04\ - \x02\0\x03\x12\x03+\x1a\x1d\n\n\n\x02\x04\x05\x12\x04.\01\x01\n\n\n\x03\ - \x04\x05\x01\x12\x03.\x08\x17\n\x0b\n\x04\x04\x05\x02\0\x12\x03/\x042\n\ - \x0c\n\x05\x04\x05\x02\0\x04\x12\x03/\x04\x0c\n\x0c\n\x05\x04\x05\x02\0\ - \x06\x12\x03/\r\x20\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03/!+\n\x0c\n\x05\ - \x04\x05\x02\0\x03\x12\x03/.1\n\x0b\n\x04\x04\x05\x02\x01\x12\x030\x04-\ - \n\x0c\n\x05\x04\x05\x02\x01\x04\x12\x030\x04\x0c\n\x0c\n\x05\x04\x05\ - \x02\x01\x06\x12\x030\r\x1a\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x030\x1b\ - %\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x030(,\n\n\n\x02\x04\x06\x12\x043\ - \05\x01\n\n\n\x03\x04\x06\x01\x12\x033\x08\x1b\n\x0b\n\x04\x04\x06\x02\0\ - \x12\x034\x04$\n\x0c\n\x05\x04\x06\x02\0\x04\x12\x034\x04\x0c\n\x0c\n\ - \x05\x04\x06\x02\0\x05\x12\x034\r\x12\n\x0c\n\x05\x04\x06\x02\0\x01\x12\ - \x034\x13\x1d\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x034\x20#\n\n\n\x02\x04\ - \x07\x12\x047\0:\x01\n\n\n\x03\x04\x07\x01\x12\x037\x08\x15\n\x0b\n\x04\ - \x04\x07\x02\0\x12\x038\x04%\n\x0c\n\x05\x04\x07\x02\0\x04\x12\x038\x04\ - \x0c\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x038\r\x12\n\x0c\n\x05\x04\x07\ - \x02\0\x01\x12\x038\x13\x1e\n\x0c\n\x05\x04\x07\x02\0\x03\x12\x038!$\n\ - \x0b\n\x04\x04\x07\x02\x01\x12\x039\x040\n\x0c\n\x05\x04\x07\x02\x01\x04\ - \x12\x039\x04\x0c\n\x0c\n\x05\x04\x07\x02\x01\x05\x12\x039\r\x12\n\x0c\n\ - \x05\x04\x07\x02\x01\x01\x12\x039\x13(\n\x0c\n\x05\x04\x07\x02\x01\x03\ - \x12\x039+/\n\n\n\x02\x04\x08\x12\x04<\0G\x01\n\n\n\x03\x04\x08\x01\x12\ - \x03<\x08\x12\n\x0b\n\x04\x04\x08\x02\0\x12\x03=\x04(\n\x0c\n\x05\x04\ - \x08\x02\0\x04\x12\x03=\x04\x0c\n\x0c\n\x05\x04\x08\x02\0\x06\x12\x03=\r\ - \x16\n\x0c\n\x05\x04\x08\x02\0\x01\x12\x03=\x17!\n\x0c\n\x05\x04\x08\x02\ - \0\x03\x12\x03=$'\n\x0b\n\x04\x04\x08\x02\x01\x12\x03>\x04'\n\x0c\n\x05\ - \x04\x08\x02\x01\x04\x12\x03>\x04\x0c\n\x0c\n\x05\x04\x08\x02\x01\x05\ - \x12\x03>\r\x13\n\x0c\n\x05\x04\x08\x02\x01\x01\x12\x03>\x14\x1f\n\x0c\n\ - \x05\x04\x08\x02\x01\x03\x12\x03>\"&\n\x0b\n\x04\x04\x08\x02\x02\x12\x03\ - ?\x04#\n\x0c\n\x05\x04\x08\x02\x02\x04\x12\x03?\x04\x0c\n\x0c\n\x05\x04\ - \x08\x02\x02\x05\x12\x03?\r\x13\n\x0c\n\x05\x04\x08\x02\x02\x01\x12\x03?\ - \x14\x1b\n\x0c\n\x05\x04\x08\x02\x02\x03\x12\x03?\x1e\"\n\x0b\n\x04\x04\ - \x08\x02\x03\x12\x03@\x04\x20\n\x0c\n\x05\x04\x08\x02\x03\x04\x12\x03@\ - \x04\x0c\n\x0c\n\x05\x04\x08\x02\x03\x06\x12\x03@\r\x12\n\x0c\n\x05\x04\ - \x08\x02\x03\x01\x12\x03@\x13\x18\n\x0c\n\x05\x04\x08\x02\x03\x03\x12\ - \x03@\x1b\x1f\n\x0b\n\x04\x04\x08\x02\x04\x12\x03A\x04'\n\x0c\n\x05\x04\ - \x08\x02\x04\x04\x12\x03A\x04\x0c\n\x0c\n\x05\x04\x08\x02\x04\x05\x12\ - \x03A\r\x13\n\x0c\n\x05\x04\x08\x02\x04\x01\x12\x03A\x14\x1f\n\x0c\n\x05\ - \x04\x08\x02\x04\x03\x12\x03A\"&\n\x0b\n\x04\x04\x08\x02\x05\x12\x03B\ - \x04\x1a\n\x0c\n\x05\x04\x08\x02\x05\x04\x12\x03B\x04\x0c\n\x0c\n\x05\ - \x04\x08\x02\x05\x06\x12\x03B\r\x0f\n\x0c\n\x05\x04\x08\x02\x05\x01\x12\ - \x03B\x10\x12\n\x0c\n\x05\x04\x08\x02\x05\x03\x12\x03B\x15\x19\n\x0b\n\ - \x04\x04\x08\x02\x06\x12\x03C\x04&\n\x0c\n\x05\x04\x08\x02\x06\x04\x12\ - \x03C\x04\x0c\n\x0c\n\x05\x04\x08\x02\x06\x05\x12\x03C\r\x13\n\x0c\n\x05\ - \x04\x08\x02\x06\x01\x12\x03C\x14\x1e\n\x0c\n\x05\x04\x08\x02\x06\x03\ - \x12\x03C!%\n\x0b\n\x04\x04\x08\x02\x07\x12\x03D\x04\"\n\x0c\n\x05\x04\ - \x08\x02\x07\x04\x12\x03D\x04\x0c\n\x0c\n\x05\x04\x08\x02\x07\x05\x12\ - \x03D\r\x13\n\x0c\n\x05\x04\x08\x02\x07\x01\x12\x03D\x14\x1a\n\x0c\n\x05\ - \x04\x08\x02\x07\x03\x12\x03D\x1d!\n\x0b\n\x04\x04\x08\x02\x08\x12\x03E\ - \x045\n\x0c\n\x05\x04\x08\x02\x08\x04\x12\x03E\x04\x0c\n\x0c\n\x05\x04\ - \x08\x02\x08\x05\x12\x03E\r\x13\n\x0c\n\x05\x04\x08\x02\x08\x01\x12\x03E\ - \x14-\n\x0c\n\x05\x04\x08\x02\x08\x03\x12\x03E04\n\x0b\n\x04\x04\x08\x02\ - \t\x12\x03F\x04%\n\x0c\n\x05\x04\x08\x02\t\x04\x12\x03F\x04\x0c\n\x0c\n\ - \x05\x04\x08\x02\t\x05\x12\x03F\r\x13\n\x0c\n\x05\x04\x08\x02\t\x01\x12\ - \x03F\x14\x1d\n\x0c\n\x05\x04\x08\x02\t\x03\x12\x03F\x20$\n\n\n\x02\x05\ - \x02\x12\x04I\0T\x01\n\n\n\x03\x05\x02\x01\x12\x03I\x05\x0e\n\x0b\n\x04\ - \x05\x02\x02\0\x12\x03J\x04\x16\n\x0c\n\x05\x05\x02\x02\0\x01\x12\x03J\ - \x04\x0f\n\x0c\n\x05\x05\x02\x02\0\x02\x12\x03J\x12\x15\n\x0b\n\x04\x05\ - \x02\x02\x01\x12\x03K\x04\x12\n\x0c\n\x05\x05\x02\x02\x01\x01\x12\x03K\ - \x04\x0b\n\x0c\n\x05\x05\x02\x02\x01\x02\x12\x03K\x0e\x11\n\x0b\n\x04\ - \x05\x02\x02\x02\x12\x03L\x04\x15\n\x0c\n\x05\x05\x02\x02\x02\x01\x12\ - \x03L\x04\x0e\n\x0c\n\x05\x05\x02\x02\x02\x02\x12\x03L\x11\x14\n\x0b\n\ - \x04\x05\x02\x02\x03\x12\x03M\x04\x12\n\x0c\n\x05\x05\x02\x02\x03\x01\ - \x12\x03M\x04\x0b\n\x0c\n\x05\x05\x02\x02\x03\x02\x12\x03M\x0e\x11\n\x0b\ - \n\x04\x05\x02\x02\x04\x12\x03N\x04\x15\n\x0c\n\x05\x05\x02\x02\x04\x01\ - \x12\x03N\x04\x0e\n\x0c\n\x05\x05\x02\x02\x04\x02\x12\x03N\x11\x14\n\x0b\ - \n\x04\x05\x02\x02\x05\x12\x03O\x04\x12\n\x0c\n\x05\x05\x02\x02\x05\x01\ - \x12\x03O\x04\x0b\n\x0c\n\x05\x05\x02\x02\x05\x02\x12\x03O\x0e\x11\n\x0b\ - \n\x04\x05\x02\x02\x06\x12\x03P\x04\x13\n\x0c\n\x05\x05\x02\x02\x06\x01\ - \x12\x03P\x04\x0c\n\x0c\n\x05\x05\x02\x02\x06\x02\x12\x03P\x0f\x12\n\x0b\ - \n\x04\x05\x02\x02\x07\x12\x03Q\x04\x11\n\x0c\n\x05\x05\x02\x02\x07\x01\ - \x12\x03Q\x04\n\n\x0c\n\x05\x05\x02\x02\x07\x02\x12\x03Q\r\x10\n\x0b\n\ - \x04\x05\x02\x02\x08\x12\x03R\x04\x13\n\x0c\n\x05\x05\x02\x02\x08\x01\ - \x12\x03R\x04\x0c\n\x0c\n\x05\x05\x02\x02\x08\x02\x12\x03R\x0f\x12\n\x0b\ - \n\x04\x05\x02\x02\t\x12\x03S\x04\x17\n\x0c\n\x05\x05\x02\x02\t\x01\x12\ - \x03S\x04\x10\n\x0c\n\x05\x05\x02\x02\t\x02\x12\x03S\x13\x16\n\n\n\x02\ - \x05\x03\x12\x04V\0[\x01\n\n\n\x03\x05\x03\x01\x12\x03V\x05\n\n\x0b\n\ - \x04\x05\x03\x02\0\x12\x03W\x04\x1a\n\x0c\n\x05\x05\x03\x02\0\x01\x12\ - \x03W\x04\x13\n\x0c\n\x05\x05\x03\x02\0\x02\x12\x03W\x16\x19\n\x0b\n\x04\ - \x05\x03\x02\x01\x12\x03X\x04\x14\n\x0c\n\x05\x05\x03\x02\x01\x01\x12\ - \x03X\x04\r\n\x0c\n\x05\x05\x03\x02\x01\x02\x12\x03X\x10\x13\n\x0b\n\x04\ - \x05\x03\x02\x02\x12\x03Y\x04\x14\n\x0c\n\x05\x05\x03\x02\x02\x01\x12\ - \x03Y\x04\r\n\x0c\n\x05\x05\x03\x02\x02\x02\x12\x03Y\x10\x13\n\x0b\n\x04\ - \x05\x03\x02\x03\x12\x03Z\x04\x16\n\x0c\n\x05\x05\x03\x02\x03\x01\x12\ - \x03Z\x04\x0f\n\x0c\n\x05\x05\x03\x02\x03\x02\x12\x03Z\x12\x15\n\n\n\x02\ - \x05\x04\x12\x04]\0u\x01\n\n\n\x03\x05\x04\x01\x12\x03]\x05\x07\n\x0b\n\ - \x04\x05\x04\x02\0\x12\x03^\x04\x15\n\x0c\n\x05\x05\x04\x02\0\x01\x12\ - \x03^\x04\x0e\n\x0c\n\x05\x05\x04\x02\0\x02\x12\x03^\x11\x14\n\x0b\n\x04\ - \x05\x04\x02\x01\x12\x03_\x04\x15\n\x0c\n\x05\x05\x04\x02\x01\x01\x12\ - \x03_\x04\x0e\n\x0c\n\x05\x05\x04\x02\x01\x02\x12\x03_\x11\x14\n\x0b\n\ - \x04\x05\x04\x02\x02\x12\x03`\x04\x11\n\x0c\n\x05\x05\x04\x02\x02\x01\ - \x12\x03`\x04\n\n\x0c\n\x05\x05\x04\x02\x02\x02\x12\x03`\r\x10\n\x0b\n\ - \x04\x05\x04\x02\x03\x12\x03a\x04\x14\n\x0c\n\x05\x05\x04\x02\x03\x01\ - \x12\x03a\x04\r\n\x0c\n\x05\x05\x04\x02\x03\x02\x12\x03a\x10\x13\n\x0b\n\ - \x04\x05\x04\x02\x04\x12\x03b\x04\x11\n\x0c\n\x05\x05\x04\x02\x04\x01\ - \x12\x03b\x04\n\n\x0c\n\x05\x05\x04\x02\x04\x02\x12\x03b\r\x10\n\x0b\n\ - \x04\x05\x04\x02\x05\x12\x03c\x04\x13\n\x0c\n\x05\x05\x04\x02\x05\x01\ - \x12\x03c\x04\x0c\n\x0c\n\x05\x05\x04\x02\x05\x02\x12\x03c\x0f\x12\n\x0b\ - \n\x04\x05\x04\x02\x06\x12\x03d\x04\x18\n\x0c\n\x05\x05\x04\x02\x06\x01\ - \x12\x03d\x04\x11\n\x0c\n\x05\x05\x04\x02\x06\x02\x12\x03d\x14\x17\n\x0b\ - \n\x04\x05\x04\x02\x07\x12\x03e\x04\x15\n\x0c\n\x05\x05\x04\x02\x07\x01\ - \x12\x03e\x04\x0e\n\x0c\n\x05\x05\x04\x02\x07\x02\x12\x03e\x11\x14\n\x0b\ - \n\x04\x05\x04\x02\x08\x12\x03f\x04\x12\n\x0c\n\x05\x05\x04\x02\x08\x01\ - \x12\x03f\x04\x0b\n\x0c\n\x05\x05\x04\x02\x08\x02\x12\x03f\x0e\x11\n\x0b\ - \n\x04\x05\x04\x02\t\x12\x03g\x04\x15\n\x0c\n\x05\x05\x04\x02\t\x01\x12\ - \x03g\x04\x0e\n\x0c\n\x05\x05\x04\x02\t\x02\x12\x03g\x11\x14\n\x0b\n\x04\ - \x05\x04\x02\n\x12\x03h\x04\x18\n\x0c\n\x05\x05\x04\x02\n\x01\x12\x03h\ - \x04\x11\n\x0c\n\x05\x05\x04\x02\n\x02\x12\x03h\x14\x17\n\x0b\n\x04\x05\ - \x04\x02\x0b\x12\x03i\x04\x13\n\x0c\n\x05\x05\x04\x02\x0b\x01\x12\x03i\ - \x04\x0c\n\x0c\n\x05\x05\x04\x02\x0b\x02\x12\x03i\x0f\x12\n\x0b\n\x04\ - \x05\x04\x02\x0c\x12\x03j\x04\x16\n\x0c\n\x05\x05\x04\x02\x0c\x01\x12\ - \x03j\x04\x0f\n\x0c\n\x05\x05\x04\x02\x0c\x02\x12\x03j\x12\x15\n\x0b\n\ - \x04\x05\x04\x02\r\x12\x03k\x04\x11\n\x0c\n\x05\x05\x04\x02\r\x01\x12\ - \x03k\x04\n\n\x0c\n\x05\x05\x04\x02\r\x02\x12\x03k\r\x10\n\x0b\n\x04\x05\ - \x04\x02\x0e\x12\x03l\x04\x13\n\x0c\n\x05\x05\x04\x02\x0e\x01\x12\x03l\ - \x04\x0c\n\x0c\n\x05\x05\x04\x02\x0e\x02\x12\x03l\x0f\x12\n\x0b\n\x04\ - \x05\x04\x02\x0f\x12\x03m\x04\x15\n\x0c\n\x05\x05\x04\x02\x0f\x01\x12\ - \x03m\x04\x0e\n\x0c\n\x05\x05\x04\x02\x0f\x02\x12\x03m\x11\x14\n\x0b\n\ - \x04\x05\x04\x02\x10\x12\x03n\x04\x11\n\x0c\n\x05\x05\x04\x02\x10\x01\ - \x12\x03n\x04\t\n\x0c\n\x05\x05\x04\x02\x10\x02\x12\x03n\x0c\x10\n\x0b\n\ - \x04\x05\x04\x02\x11\x12\x03o\x04\x14\n\x0c\n\x05\x05\x04\x02\x11\x01\ - \x12\x03o\x04\x0c\n\x0c\n\x05\x05\x04\x02\x11\x02\x12\x03o\x0f\x13\n\x0b\ - \n\x04\x05\x04\x02\x12\x12\x03p\x04\x13\n\x0c\n\x05\x05\x04\x02\x12\x01\ - \x12\x03p\x04\x0b\n\x0c\n\x05\x05\x04\x02\x12\x02\x12\x03p\x0e\x12\n\x0b\ - \n\x04\x05\x04\x02\x13\x12\x03q\x04\x13\n\x0c\n\x05\x05\x04\x02\x13\x01\ - \x12\x03q\x04\x0b\n\x0c\n\x05\x05\x04\x02\x13\x02\x12\x03q\x0e\x12\n\x0b\ - \n\x04\x05\x04\x02\x14\x12\x03r\x04\x14\n\x0c\n\x05\x05\x04\x02\x14\x01\ - \x12\x03r\x04\x0c\n\x0c\n\x05\x05\x04\x02\x14\x02\x12\x03r\x0f\x13\n\x0b\ - \n\x04\x05\x04\x02\x15\x12\x03s\x04\x15\n\x0c\n\x05\x05\x04\x02\x15\x01\ - \x12\x03s\x04\r\n\x0c\n\x05\x05\x04\x02\x15\x02\x12\x03s\x10\x14\n\x0b\n\ - \x04\x05\x04\x02\x16\x12\x03t\x04\x12\n\x0c\n\x05\x05\x04\x02\x16\x01\ - \x12\x03t\x04\n\n\x0c\n\x05\x05\x04\x02\x16\x02\x12\x03t\r\x11\n\n\n\x02\ - \x04\t\x12\x04w\0}\x01\n\n\n\x03\x04\t\x01\x12\x03w\x08\x18\n\x0b\n\x04\ - \x04\t\x02\0\x12\x03x\x04\"\n\x0c\n\x05\x04\t\x02\0\x04\x12\x03x\x04\x0c\ - \n\x0c\n\x05\x04\t\x02\0\x05\x12\x03x\r\x13\n\x0c\n\x05\x04\t\x02\0\x01\ - \x12\x03x\x14\x1b\n\x0c\n\x05\x04\t\x02\0\x03\x12\x03x\x1e!\n\x0b\n\x04\ - \x04\t\x02\x01\x12\x03y\x04\x20\n\x0c\n\x05\x04\t\x02\x01\x04\x12\x03y\ - \x04\x0c\n\x0c\n\x05\x04\t\x02\x01\x05\x12\x03y\r\x12\n\x0c\n\x05\x04\t\ - \x02\x01\x01\x12\x03y\x13\x19\n\x0c\n\x05\x04\t\x02\x01\x03\x12\x03y\x1c\ - \x1f\n\x0b\n\x04\x04\t\x02\x02\x12\x03z\x04#\n\x0c\n\x05\x04\t\x02\x02\ - \x04\x12\x03z\x04\x0c\n\x0c\n\x05\x04\t\x02\x02\x05\x12\x03z\r\x12\n\x0c\ - \n\x05\x04\t\x02\x02\x01\x12\x03z\x13\x1c\n\x0c\n\x05\x04\t\x02\x02\x03\ - \x12\x03z\x1f\"\n\x0b\n\x04\x04\t\x02\x03\x12\x03{\x04$\n\x0c\n\x05\x04\ - \t\x02\x03\x04\x12\x03{\x04\x0c\n\x0c\n\x05\x04\t\x02\x03\x05\x12\x03{\r\ - \x13\n\x0c\n\x05\x04\t\x02\x03\x01\x12\x03{\x14\x1d\n\x0c\n\x05\x04\t\ - \x02\x03\x03\x12\x03{\x20#\n\x0b\n\x04\x04\t\x02\x04\x12\x03|\x04'\n\x0c\ - \n\x05\x04\t\x02\x04\x04\x12\x03|\x04\x0c\n\x0c\n\x05\x04\t\x02\x04\x05\ - \x12\x03|\r\x12\n\x0c\n\x05\x04\t\x02\x04\x01\x12\x03|\x13\x20\n\x0c\n\ - \x05\x04\t\x02\x04\x03\x12\x03|#&\n\x0b\n\x02\x04\n\x12\x05\x7f\0\x83\ - \x01\x01\n\n\n\x03\x04\n\x01\x12\x03\x7f\x08\x12\n\x0c\n\x04\x04\n\x02\0\ - \x12\x04\x80\x01\x04\x20\n\r\n\x05\x04\n\x02\0\x04\x12\x04\x80\x01\x04\ - \x0c\n\r\n\x05\x04\n\x02\0\x05\x12\x04\x80\x01\r\x11\n\r\n\x05\x04\n\x02\ - \0\x01\x12\x04\x80\x01\x12\x19\n\r\n\x05\x04\n\x02\0\x03\x12\x04\x80\x01\ - \x1c\x1f\n\x0c\n\x04\x04\n\x02\x01\x12\x04\x81\x01\x04)\n\r\n\x05\x04\n\ - \x02\x01\x04\x12\x04\x81\x01\x04\x0c\n\r\n\x05\x04\n\x02\x01\x06\x12\x04\ - \x81\x01\r\x1f\n\r\n\x05\x04\n\x02\x01\x01\x12\x04\x81\x01\x20\"\n\r\n\ - \x05\x04\n\x02\x01\x03\x12\x04\x81\x01%(\n\x0c\n\x04\x04\n\x02\x02\x12\ - \x04\x82\x01\x04#\n\r\n\x05\x04\n\x02\x02\x04\x12\x04\x82\x01\x04\x0c\n\ - \r\n\x05\x04\n\x02\x02\x05\x12\x04\x82\x01\r\x13\n\r\n\x05\x04\n\x02\x02\ - \x01\x12\x04\x82\x01\x14\x1c\n\r\n\x05\x04\n\x02\x02\x03\x12\x04\x82\x01\ - \x1f\"\n\x0c\n\x02\x04\x0b\x12\x06\x85\x01\0\x87\x01\x01\n\x0b\n\x03\x04\ - \x0b\x01\x12\x04\x85\x01\x08\x1a\n\x0c\n\x04\x04\x0b\x02\0\x12\x04\x86\ - \x01\x04%\n\r\n\x05\x04\x0b\x02\0\x04\x12\x04\x86\x01\x04\x0c\n\r\n\x05\ - \x04\x0b\x02\0\x05\x12\x04\x86\x01\r\x13\n\r\n\x05\x04\x0b\x02\0\x01\x12\ - \x04\x86\x01\x14\x1e\n\r\n\x05\x04\x0b\x02\0\x03\x12\x04\x86\x01!$\n\x0c\ - \n\x02\x04\x0c\x12\x06\x89\x01\0\x92\x01\x01\n\x0b\n\x03\x04\x0c\x01\x12\ - \x04\x89\x01\x08\x11\n\x0c\n\x04\x04\x0c\x02\0\x12\x04\x8a\x01\x04-\n\r\ - \n\x05\x04\x0c\x02\0\x04\x12\x04\x8a\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\0\ - \x05\x12\x04\x8a\x01\r\x13\n\r\n\x05\x04\x0c\x02\0\x01\x12\x04\x8a\x01\ - \x14&\n\r\n\x05\x04\x0c\x02\0\x03\x12\x04\x8a\x01),\n\x0c\n\x04\x04\x0c\ - \x02\x01\x12\x04\x8b\x01\x047\n\r\n\x05\x04\x0c\x02\x01\x04\x12\x04\x8b\ - \x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x01\x06\x12\x04\x8b\x01\r\x18\n\r\n\ - \x05\x04\x0c\x02\x01\x01\x12\x04\x8b\x01\x19/\n\r\n\x05\x04\x0c\x02\x01\ - \x03\x12\x04\x8b\x0126\n\x0c\n\x04\x04\x0c\x02\x02\x12\x04\x8c\x01\x04;\ - \n\r\n\x05\x04\x0c\x02\x02\x04\x12\x04\x8c\x01\x04\x0c\n\r\n\x05\x04\x0c\ - \x02\x02\x06\x12\x04\x8c\x01\r\x18\n\r\n\x05\x04\x0c\x02\x02\x01\x12\x04\ - \x8c\x01\x193\n\r\n\x05\x04\x0c\x02\x02\x03\x12\x04\x8c\x016:\n\x0c\n\ - \x04\x04\x0c\x02\x03\x12\x04\x8d\x01\x04F\n\r\n\x05\x04\x0c\x02\x03\x04\ - \x12\x04\x8d\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x03\x06\x12\x04\x8d\x01\r\ - \x1f\n\r\n\x05\x04\x0c\x02\x03\x01\x12\x04\x8d\x01\x20>\n\r\n\x05\x04\ - \x0c\x02\x03\x03\x12\x04\x8d\x01AE\n\x0c\n\x04\x04\x0c\x02\x04\x12\x04\ - \x8e\x01\x044\n\r\n\x05\x04\x0c\x02\x04\x04\x12\x04\x8e\x01\x04\x0c\n\r\ - \n\x05\x04\x0c\x02\x04\x05\x12\x04\x8e\x01\r\x12\n\r\n\x05\x04\x0c\x02\ - \x04\x01\x12\x04\x8e\x01\x13,\n\r\n\x05\x04\x0c\x02\x04\x03\x12\x04\x8e\ - \x01/3\n\x0c\n\x04\x04\x0c\x02\x05\x12\x04\x8f\x01\x04%\n\r\n\x05\x04\ - \x0c\x02\x05\x04\x12\x04\x8f\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x05\x05\ - \x12\x04\x8f\x01\r\x12\n\r\n\x05\x04\x0c\x02\x05\x01\x12\x04\x8f\x01\x13\ - \x1d\n\r\n\x05\x04\x0c\x02\x05\x03\x12\x04\x8f\x01\x20$\n\x0c\n\x04\x04\ - \x0c\x02\x06\x12\x04\x90\x01\x04-\n\r\n\x05\x04\x0c\x02\x06\x04\x12\x04\ - \x90\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x06\x06\x12\x04\x90\x01\r\x18\n\r\ - \n\x05\x04\x0c\x02\x06\x01\x12\x04\x90\x01\x19%\n\r\n\x05\x04\x0c\x02\ - \x06\x03\x12\x04\x90\x01(,\n\x0c\n\x04\x04\x0c\x02\x07\x12\x04\x91\x01\ - \x04+\n\r\n\x05\x04\x0c\x02\x07\x04\x12\x04\x91\x01\x04\x0c\n\r\n\x05\ - \x04\x0c\x02\x07\x06\x12\x04\x91\x01\r\x20\n\r\n\x05\x04\x0c\x02\x07\x01\ - \x12\x04\x91\x01!#\n\r\n\x05\x04\x0c\x02\x07\x03\x12\x04\x91\x01&*\n\x0c\ - \n\x02\x05\x05\x12\x06\x94\x01\0\x97\x01\x01\n\x0b\n\x03\x05\x05\x01\x12\ - \x04\x94\x01\x05\x10\n\x0c\n\x04\x05\x05\x02\0\x12\x04\x95\x01\x04\x12\n\ - \r\n\x05\x05\x05\x02\0\x01\x12\x04\x95\x01\x04\x0b\n\r\n\x05\x05\x05\x02\ - \0\x02\x12\x04\x95\x01\x0e\x11\n\x0c\n\x04\x05\x05\x02\x01\x12\x04\x96\ - \x01\x04\x13\n\r\n\x05\x05\x05\x02\x01\x01\x12\x04\x96\x01\x04\x0c\n\r\n\ - \x05\x05\x05\x02\x01\x02\x12\x04\x96\x01\x0f\x12\n\x0c\n\x02\x04\r\x12\ - \x06\x99\x01\0\x9c\x01\x01\n\x0b\n\x03\x04\r\x01\x12\x04\x99\x01\x08\x13\ - \n\x0c\n\x04\x04\r\x02\0\x12\x04\x9a\x01\x04.\n\r\n\x05\x04\r\x02\0\x04\ - \x12\x04\x9a\x01\x04\x0c\n\r\n\x05\x04\r\x02\0\x06\x12\x04\x9a\x01\r\x1f\ - \n\r\n\x05\x04\r\x02\0\x01\x12\x04\x9a\x01\x20'\n\r\n\x05\x04\r\x02\0\ - \x03\x12\x04\x9a\x01*-\n\x0c\n\x04\x04\r\x02\x01\x12\x04\x9b\x01\x040\n\ - \r\n\x05\x04\r\x02\x01\x04\x12\x04\x9b\x01\x04\x0c\n\r\n\x05\x04\r\x02\ - \x01\x06\x12\x04\x9b\x01\r\x20\n\r\n\x05\x04\r\x02\x01\x01\x12\x04\x9b\ - \x01!)\n\r\n\x05\x04\r\x02\x01\x03\x12\x04\x9b\x01,/\n\x0c\n\x02\x04\x0e\ - \x12\x06\x9e\x01\0\x9f\x01\x01\n\x0b\n\x03\x04\x0e\x01\x12\x04\x9e\x01\ - \x08\x1a\n\x0c\n\x02\x04\x0f\x12\x06\xa1\x01\0\xa4\x01\x01\n\x0b\n\x03\ - \x04\x0f\x01\x12\x04\xa1\x01\x08\x1b\n\x0c\n\x04\x04\x0f\x02\0\x12\x04\ - \xa2\x01\x04'\n\r\n\x05\x04\x0f\x02\0\x04\x12\x04\xa2\x01\x04\x0c\n\r\n\ - \x05\x04\x0f\x02\0\x05\x12\x04\xa2\x01\r\x13\n\r\n\x05\x04\x0f\x02\0\x01\ - \x12\x04\xa2\x01\x14\x20\n\r\n\x05\x04\x0f\x02\0\x03\x12\x04\xa2\x01#&\n\ - \x0c\n\x04\x04\x0f\x02\x01\x12\x04\xa3\x01\x04%\n\r\n\x05\x04\x0f\x02\ - \x01\x04\x12\x04\xa3\x01\x04\x0c\n\r\n\x05\x04\x0f\x02\x01\x05\x12\x04\ - \xa3\x01\r\x13\n\r\n\x05\x04\x0f\x02\x01\x01\x12\x04\xa3\x01\x14\x1e\n\r\ - \n\x05\x04\x0f\x02\x01\x03\x12\x04\xa3\x01!$\ + \n\x14authentication.proto\x12\0\"\xfe\x02\n\x17ClientResponseEncrypted\ + \x12.\n\x11login_credentials\x18\n\x20\x02(\x0b2\x11.LoginCredentialsB\0\ + \x12,\n\x10account_creation\x18\x14\x20\x01(\x0e2\x10.AccountCreationB\0\ + \x129\n\x14fingerprint_response\x18\x1e\x20\x01(\x0b2\x19.FingerprintRes\ + ponseUnionB\0\x12'\n\x0bpeer_ticket\x18(\x20\x01(\x0b2\x10.PeerTicketUni\ + onB\0\x12\"\n\x0bsystem_info\x182\x20\x02(\x0b2\x0b.SystemInfoB\0\x12\ + \x18\n\x0eplatform_model\x18<\x20\x01(\tB\0\x12\x18\n\x0eversion_string\ + \x18F\x20\x01(\tB\0\x12#\n\x06appkey\x18P\x20\x01(\x0b2\x11.LibspotifyAp\ + pKeyB\0\x12\"\n\x0bclient_info\x18Z\x20\x01(\x0b2\x0b.ClientInfoB\0:\0\"\ + a\n\x10LoginCredentials\x12\x12\n\x08username\x18\n\x20\x01(\tB\0\x12\"\ + \n\x03typ\x18\x14\x20\x02(\x0e2\x13.AuthenticationTypeB\0\x12\x13\n\taut\ + h_data\x18\x1e\x20\x01(\x0cB\0:\0\"\x7f\n\x18FingerprintResponseUnion\ + \x12*\n\x05grain\x18\n\x20\x01(\x0b2\x19.FingerprintGrainResponseB\0\x12\ + 5\n\x0bhmac_ripemd\x18\x14\x20\x01(\x0b2\x1e.FingerprintHmacRipemdRespon\ + seB\0:\0\"5\n\x18FingerprintGrainResponse\x12\x17\n\rencrypted_key\x18\n\ + \x20\x02(\x0cB\0:\0\"1\n\x1dFingerprintHmacRipemdResponse\x12\x0e\n\x04h\ + mac\x18\n\x20\x02(\x0cB\0:\0\"e\n\x0fPeerTicketUnion\x12*\n\npublic_key\ + \x18\n\x20\x01(\x0b2\x14.PeerTicketPublicKeyB\0\x12$\n\nold_ticket\x18\ + \x14\x20\x01(\x0b2\x0e.PeerTicketOldB\0:\0\"-\n\x13PeerTicketPublicKey\ + \x12\x14\n\npublic_key\x18\n\x20\x02(\x0cB\0:\0\"I\n\rPeerTicketOld\x12\ + \x15\n\x0bpeer_ticket\x18\n\x20\x02(\x0cB\0\x12\x1f\n\x15peer_ticket_sig\ + nature\x18\x14\x20\x02(\x0cB\0:\0\"\xff\x01\n\nSystemInfo\x12\x20\n\ncpu\ + _family\x18\n\x20\x02(\x0e2\n.CpuFamilyB\0\x12\x15\n\x0bcpu_subtype\x18\ + \x14\x20\x01(\rB\0\x12\x11\n\x07cpu_ext\x18\x1e\x20\x01(\rB\0\x12\x17\n\ + \x05brand\x18(\x20\x01(\x0e2\x06.BrandB\0\x12\x15\n\x0bbrand_flags\x182\ + \x20\x01(\rB\0\x12\x11\n\x02os\x18<\x20\x02(\x0e2\x03.OsB\0\x12\x14\n\no\ + s_version\x18F\x20\x01(\rB\0\x12\x10\n\x06os_ext\x18P\x20\x01(\rB\0\x12#\ + \n\x19system_information_string\x18Z\x20\x01(\tB\0\x12\x13\n\tdevice_id\ + \x18d\x20\x01(\tB\0:\0\"|\n\x10LibspotifyAppKey\x12\x11\n\x07version\x18\ + \x01\x20\x02(\rB\0\x12\x10\n\x06devkey\x18\x02\x20\x02(\x0cB\0\x12\x13\n\ + \tsignature\x18\x03\x20\x02(\x0cB\0\x12\x13\n\tuseragent\x18\x04\x20\x02\ + (\tB\0\x12\x17\n\rcallback_hash\x18\x05\x20\x02(\x0cB\0:\0\"X\n\nClientI\ + nfo\x12\x11\n\x07limited\x18\x01\x20\x01(\x08B\0\x12!\n\x02fb\x18\x02\ + \x20\x01(\x0b2\x13.ClientInfoFacebookB\0\x12\x12\n\x08language\x18\x03\ + \x20\x01(\tB\0:\0\",\n\x12ClientInfoFacebook\x12\x14\n\nmachine_id\x18\ + \x01\x20\x01(\tB\0:\0\"\xd3\x02\n\tAPWelcome\x12\x1c\n\x12canonical_user\ + name\x18\n\x20\x02(\tB\0\x12.\n\x16account_type_logged_in\x18\x14\x20\ + \x02(\x0e2\x0c.AccountTypeB\0\x122\n\x1acredentials_type_logged_in\x18\ + \x19\x20\x02(\x0e2\x0c.AccountTypeB\0\x12=\n\x1ereusable_auth_credential\ + s_type\x18\x1e\x20\x02(\x0e2\x13.AuthenticationTypeB\0\x12#\n\x19reusabl\ + e_auth_credentials\x18(\x20\x02(\x0cB\0\x12\x14\n\nlfs_secret\x182\x20\ + \x01(\x0cB\0\x12$\n\x0caccount_info\x18<\x20\x01(\x0b2\x0c.AccountInfoB\ + \0\x12\"\n\x02fb\x18F\x20\x01(\x0b2\x14.AccountInfoFacebookB\0:\0\"a\n\ + \x0bAccountInfo\x12&\n\x07spotify\x18\x01\x20\x01(\x0b2\x13.AccountInfoS\ + potifyB\0\x12(\n\x08facebook\x18\x02\x20\x01(\x0b2\x14.AccountInfoFacebo\ + okB\0:\0\"\x16\n\x12AccountInfoSpotify:\0\"E\n\x13AccountInfoFacebook\ + \x12\x16\n\x0caccess_token\x18\x01\x20\x01(\tB\0\x12\x14\n\nmachine_id\ + \x18\x02\x20\x01(\tB\0:\0*\xd8\x01\n\x12AuthenticationType\x12\x1c\n\x18\ + AUTHENTICATION_USER_PASS\x10\0\x12-\n)AUTHENTICATION_STORED_SPOTIFY_CRED\ + ENTIALS\x10\x01\x12.\n*AUTHENTICATION_STORED_FACEBOOK_CREDENTIALS\x10\ + \x02\x12\x20\n\x1cAUTHENTICATION_SPOTIFY_TOKEN\x10\x03\x12!\n\x1dAUTHENT\ + ICATION_FACEBOOK_TOKEN\x10\x04\x1a\0*[\n\x0fAccountCreation\x12\"\n\x1eA\ + CCOUNT_CREATION_ALWAYS_PROMPT\x10\x01\x12\"\n\x1eACCOUNT_CREATION_ALWAYS\ + _CREATE\x10\x03\x1a\0*\x9f\x01\n\tCpuFamily\x12\x0f\n\x0bCPU_UNKNOWN\x10\ + \0\x12\x0b\n\x07CPU_X86\x10\x01\x12\x0e\n\nCPU_X86_64\x10\x02\x12\x0b\n\ + \x07CPU_PPC\x10\x03\x12\x0e\n\nCPU_PPC_64\x10\x04\x12\x0b\n\x07CPU_ARM\ + \x10\x05\x12\x0c\n\x08CPU_IA64\x10\x06\x12\n\n\x06CPU_SH\x10\x07\x12\x0c\ + \n\x08CPU_MIPS\x10\x08\x12\x10\n\x0cCPU_BLACKFIN\x10\t\x1a\0*M\n\x05Bran\ + d\x12\x13\n\x0fBRAND_UNBRANDED\x10\0\x12\r\n\tBRAND_INQ\x10\x01\x12\r\n\ + \tBRAND_HTC\x10\x02\x12\x0f\n\x0bBRAND_NOKIA\x10\x03\x1a\0*\xd3\x02\n\ + \x02Os\x12\x0e\n\nOS_UNKNOWN\x10\0\x12\x0e\n\nOS_WINDOWS\x10\x01\x12\n\n\ + \x06OS_OSX\x10\x02\x12\r\n\tOS_IPHONE\x10\x03\x12\n\n\x06OS_S60\x10\x04\ + \x12\x0c\n\x08OS_LINUX\x10\x05\x12\x11\n\rOS_WINDOWS_CE\x10\x06\x12\x0e\ + \n\nOS_ANDROID\x10\x07\x12\x0b\n\x07OS_PALM\x10\x08\x12\x0e\n\nOS_FREEBS\ + D\x10\t\x12\x11\n\rOS_BLACKBERRY\x10\n\x12\x0c\n\x08OS_SONOS\x10\x0b\x12\ + \x0f\n\x0bOS_LOGITECH\x10\x0c\x12\n\n\x06OS_WP7\x10\r\x12\x0c\n\x08OS_ON\ + KYO\x10\x0e\x12\x0e\n\nOS_PHILIPS\x10\x0f\x12\t\n\x05OS_WD\x10\x10\x12\ + \x0c\n\x08OS_VOLVO\x10\x11\x12\x0b\n\x07OS_TIVO\x10\x12\x12\x0b\n\x07OS_\ + AWOX\x10\x13\x12\x0c\n\x08OS_MEEGO\x10\x14\x12\r\n\tOS_QNXNTO\x10\x15\ + \x12\n\n\x06OS_BCO\x10\x16\x1a\0**\n\x0bAccountType\x12\x0b\n\x07Spotify\ + \x10\0\x12\x0c\n\x08Facebook\x10\x01\x1a\0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/protocol/src/keyexchange.rs b/protocol/src/keyexchange.rs index 0a4735a6..b026ec87 100644 --- a/protocol/src/keyexchange.rs +++ b/protocol/src/keyexchange.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,10 +17,15 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `keyexchange.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct ClientHello { // message fields @@ -33,30 +38,27 @@ pub struct ClientHello { padding: ::protobuf::SingularField<::std::vec::Vec>, feature_set: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ClientHello {} +impl<'a> ::std::default::Default for &'a ClientHello { + fn default() -> &'a ClientHello { + ::default_instance() + } +} impl ClientHello { pub fn new() -> ClientHello { ::std::default::Default::default() } - pub fn default_instance() -> &'static ClientHello { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ClientHello, - }; - unsafe { - instance.get(ClientHello::new) - } - } - // required .BuildInfo build_info = 10; + + pub fn get_build_info(&self) -> &BuildInfo { + self.build_info.as_ref().unwrap_or_else(|| BuildInfo::default_instance()) + } pub fn clear_build_info(&mut self) { self.build_info.clear(); } @@ -84,20 +86,12 @@ impl ClientHello { self.build_info.take().unwrap_or_else(|| BuildInfo::new()) } - pub fn get_build_info(&self) -> &BuildInfo { - self.build_info.as_ref().unwrap_or_else(|| BuildInfo::default_instance()) - } + // repeated .Fingerprint fingerprints_supported = 20; - fn get_build_info_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.build_info - } - fn mut_build_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.build_info + pub fn get_fingerprints_supported(&self) -> &[Fingerprint] { + &self.fingerprints_supported } - - // repeated .Fingerprint fingerprints_supported = 20; - pub fn clear_fingerprints_supported(&mut self) { self.fingerprints_supported.clear(); } @@ -117,20 +111,12 @@ impl ClientHello { ::std::mem::replace(&mut self.fingerprints_supported, ::std::vec::Vec::new()) } - pub fn get_fingerprints_supported(&self) -> &[Fingerprint] { - &self.fingerprints_supported - } + // repeated .Cryptosuite cryptosuites_supported = 30; - fn get_fingerprints_supported_for_reflect(&self) -> &::std::vec::Vec { - &self.fingerprints_supported - } - fn mut_fingerprints_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { - &mut self.fingerprints_supported + pub fn get_cryptosuites_supported(&self) -> &[Cryptosuite] { + &self.cryptosuites_supported } - - // repeated .Cryptosuite cryptosuites_supported = 30; - pub fn clear_cryptosuites_supported(&mut self) { self.cryptosuites_supported.clear(); } @@ -150,20 +136,12 @@ impl ClientHello { ::std::mem::replace(&mut self.cryptosuites_supported, ::std::vec::Vec::new()) } - pub fn get_cryptosuites_supported(&self) -> &[Cryptosuite] { - &self.cryptosuites_supported - } + // repeated .Powscheme powschemes_supported = 40; - fn get_cryptosuites_supported_for_reflect(&self) -> &::std::vec::Vec { - &self.cryptosuites_supported - } - fn mut_cryptosuites_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { - &mut self.cryptosuites_supported + pub fn get_powschemes_supported(&self) -> &[Powscheme] { + &self.powschemes_supported } - - // repeated .Powscheme powschemes_supported = 40; - pub fn clear_powschemes_supported(&mut self) { self.powschemes_supported.clear(); } @@ -183,20 +161,12 @@ impl ClientHello { ::std::mem::replace(&mut self.powschemes_supported, ::std::vec::Vec::new()) } - pub fn get_powschemes_supported(&self) -> &[Powscheme] { - &self.powschemes_supported - } + // required .LoginCryptoHelloUnion login_crypto_hello = 50; - fn get_powschemes_supported_for_reflect(&self) -> &::std::vec::Vec { - &self.powschemes_supported - } - fn mut_powschemes_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { - &mut self.powschemes_supported + pub fn get_login_crypto_hello(&self) -> &LoginCryptoHelloUnion { + self.login_crypto_hello.as_ref().unwrap_or_else(|| LoginCryptoHelloUnion::default_instance()) } - - // required .LoginCryptoHelloUnion login_crypto_hello = 50; - pub fn clear_login_crypto_hello(&mut self) { self.login_crypto_hello.clear(); } @@ -224,20 +194,15 @@ impl ClientHello { self.login_crypto_hello.take().unwrap_or_else(|| LoginCryptoHelloUnion::new()) } - pub fn get_login_crypto_hello(&self) -> &LoginCryptoHelloUnion { - self.login_crypto_hello.as_ref().unwrap_or_else(|| LoginCryptoHelloUnion::default_instance()) - } + // required bytes client_nonce = 60; - fn get_login_crypto_hello_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.login_crypto_hello - } - fn mut_login_crypto_hello_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.login_crypto_hello + pub fn get_client_nonce(&self) -> &[u8] { + match self.client_nonce.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes client_nonce = 60; - pub fn clear_client_nonce(&mut self) { self.client_nonce.clear(); } @@ -265,23 +230,15 @@ impl ClientHello { self.client_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_client_nonce(&self) -> &[u8] { - match self.client_nonce.as_ref() { + // optional bytes padding = 70; + + + pub fn get_padding(&self) -> &[u8] { + match self.padding.as_ref() { Some(v) => &v, None => &[], } } - - fn get_client_nonce_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.client_nonce - } - - fn mut_client_nonce_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.client_nonce - } - - // optional bytes padding = 70; - pub fn clear_padding(&mut self) { self.padding.clear(); } @@ -309,23 +266,12 @@ impl ClientHello { self.padding.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_padding(&self) -> &[u8] { - match self.padding.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional .FeatureSet feature_set = 80; - fn get_padding_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.padding - } - fn mut_padding_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.padding + pub fn get_feature_set(&self) -> &FeatureSet { + self.feature_set.as_ref().unwrap_or_else(|| FeatureSet::default_instance()) } - - // optional .FeatureSet feature_set = 80; - pub fn clear_feature_set(&mut self) { self.feature_set.clear(); } @@ -352,18 +298,6 @@ impl ClientHello { pub fn take_feature_set(&mut self) -> FeatureSet { self.feature_set.take().unwrap_or_else(|| FeatureSet::new()) } - - pub fn get_feature_set(&self) -> &FeatureSet { - self.feature_set.as_ref().unwrap_or_else(|| FeatureSet::default_instance()) - } - - fn get_feature_set_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.feature_set - } - - fn mut_feature_set_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.feature_set - } } impl ::protobuf::Message for ClientHello { @@ -403,13 +337,13 @@ impl ::protobuf::Message for ClientHello { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.build_info)?; }, 20 => { - ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.fingerprints_supported)?; + ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.fingerprints_supported, 20, &mut self.unknown_fields)? }, 30 => { - ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.cryptosuites_supported)?; + ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.cryptosuites_supported, 30, &mut self.unknown_fields)? }, 40 => { - ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.powschemes_supported)?; + ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.powschemes_supported, 40, &mut self.unknown_fields)? }, 50 => { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_hello)?; @@ -514,27 +448,25 @@ impl ::protobuf::Message for ClientHello { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ClientHello { fn new() -> ClientHello { ClientHello::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -544,43 +476,43 @@ impl ::protobuf::MessageStatic for ClientHello { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "build_info", - ClientHello::get_build_info_for_reflect, - ClientHello::mut_build_info_for_reflect, + |m: &ClientHello| { &m.build_info }, + |m: &mut ClientHello| { &mut m.build_info }, )); fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "fingerprints_supported", - ClientHello::get_fingerprints_supported_for_reflect, - ClientHello::mut_fingerprints_supported_for_reflect, + |m: &ClientHello| { &m.fingerprints_supported }, + |m: &mut ClientHello| { &mut m.fingerprints_supported }, )); fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cryptosuites_supported", - ClientHello::get_cryptosuites_supported_for_reflect, - ClientHello::mut_cryptosuites_supported_for_reflect, + |m: &ClientHello| { &m.cryptosuites_supported }, + |m: &mut ClientHello| { &mut m.cryptosuites_supported }, )); fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "powschemes_supported", - ClientHello::get_powschemes_supported_for_reflect, - ClientHello::mut_powschemes_supported_for_reflect, + |m: &ClientHello| { &m.powschemes_supported }, + |m: &mut ClientHello| { &mut m.powschemes_supported }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_hello", - ClientHello::get_login_crypto_hello_for_reflect, - ClientHello::mut_login_crypto_hello_for_reflect, + |m: &ClientHello| { &m.login_crypto_hello }, + |m: &mut ClientHello| { &mut m.login_crypto_hello }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "client_nonce", - ClientHello::get_client_nonce_for_reflect, - ClientHello::mut_client_nonce_for_reflect, + |m: &ClientHello| { &m.client_nonce }, + |m: &mut ClientHello| { &mut m.client_nonce }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "padding", - ClientHello::get_padding_for_reflect, - ClientHello::mut_padding_for_reflect, + |m: &ClientHello| { &m.padding }, + |m: &mut ClientHello| { &mut m.padding }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "feature_set", - ClientHello::get_feature_set_for_reflect, - ClientHello::mut_feature_set_for_reflect, + |m: &ClientHello| { &m.feature_set }, + |m: &mut ClientHello| { &mut m.feature_set }, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientHello", @@ -590,18 +522,28 @@ impl ::protobuf::MessageStatic for ClientHello { }) } } + + fn default_instance() -> &'static ClientHello { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClientHello, + }; + unsafe { + instance.get(ClientHello::new) + } + } } impl ::protobuf::Clear for ClientHello { fn clear(&mut self) { - self.clear_build_info(); - self.clear_fingerprints_supported(); - self.clear_cryptosuites_supported(); - self.clear_powschemes_supported(); - self.clear_login_crypto_hello(); - self.clear_client_nonce(); - self.clear_padding(); - self.clear_feature_set(); + self.build_info.clear(); + self.fingerprints_supported.clear(); + self.cryptosuites_supported.clear(); + self.powschemes_supported.clear(); + self.login_crypto_hello.clear(); + self.client_nonce.clear(); + self.padding.clear(); + self.feature_set.clear(); self.unknown_fields.clear(); } } @@ -626,30 +568,27 @@ pub struct BuildInfo { platform: ::std::option::Option, version: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for BuildInfo {} +impl<'a> ::std::default::Default for &'a BuildInfo { + fn default() -> &'a BuildInfo { + ::default_instance() + } +} impl BuildInfo { pub fn new() -> BuildInfo { ::std::default::Default::default() } - pub fn default_instance() -> &'static BuildInfo { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const BuildInfo, - }; - unsafe { - instance.get(BuildInfo::new) - } - } - // required .Product product = 10; + + pub fn get_product(&self) -> Product { + self.product.unwrap_or(Product::PRODUCT_CLIENT) + } pub fn clear_product(&mut self) { self.product = ::std::option::Option::None; } @@ -663,20 +602,12 @@ impl BuildInfo { self.product = ::std::option::Option::Some(v); } - pub fn get_product(&self) -> Product { - self.product.unwrap_or(Product::PRODUCT_CLIENT) - } + // repeated .ProductFlags product_flags = 20; - fn get_product_for_reflect(&self) -> &::std::option::Option { - &self.product - } - fn mut_product_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.product + pub fn get_product_flags(&self) -> &[ProductFlags] { + &self.product_flags } - - // repeated .ProductFlags product_flags = 20; - pub fn clear_product_flags(&mut self) { self.product_flags.clear(); } @@ -696,20 +627,12 @@ impl BuildInfo { ::std::mem::replace(&mut self.product_flags, ::std::vec::Vec::new()) } - pub fn get_product_flags(&self) -> &[ProductFlags] { - &self.product_flags - } + // required .Platform platform = 30; - fn get_product_flags_for_reflect(&self) -> &::std::vec::Vec { - &self.product_flags - } - fn mut_product_flags_for_reflect(&mut self) -> &mut ::std::vec::Vec { - &mut self.product_flags + pub fn get_platform(&self) -> Platform { + self.platform.unwrap_or(Platform::PLATFORM_WIN32_X86) } - - // required .Platform platform = 30; - pub fn clear_platform(&mut self) { self.platform = ::std::option::Option::None; } @@ -723,20 +646,12 @@ impl BuildInfo { self.platform = ::std::option::Option::Some(v); } - pub fn get_platform(&self) -> Platform { - self.platform.unwrap_or(Platform::PLATFORM_WIN32_X86) - } + // required uint64 version = 40; - fn get_platform_for_reflect(&self) -> &::std::option::Option { - &self.platform - } - fn mut_platform_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.platform + pub fn get_version(&self) -> u64 { + self.version.unwrap_or(0) } - - // required uint64 version = 40; - pub fn clear_version(&mut self) { self.version = ::std::option::Option::None; } @@ -749,18 +664,6 @@ impl BuildInfo { pub fn set_version(&mut self, v: u64) { self.version = ::std::option::Option::Some(v); } - - pub fn get_version(&self) -> u64 { - self.version.unwrap_or(0) - } - - fn get_version_for_reflect(&self) -> &::std::option::Option { - &self.version - } - - fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.version - } } impl ::protobuf::Message for BuildInfo { @@ -782,21 +685,13 @@ impl ::protobuf::Message for BuildInfo { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.product = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.product, 10, &mut self.unknown_fields)? }, 20 => { - ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.product_flags)?; + ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.product_flags, 20, &mut self.unknown_fields)? }, 30 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.platform = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.platform, 30, &mut self.unknown_fields)? }, 40 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -863,27 +758,25 @@ impl ::protobuf::Message for BuildInfo { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for BuildInfo { fn new() -> BuildInfo { BuildInfo::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -893,23 +786,23 @@ impl ::protobuf::MessageStatic for BuildInfo { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "product", - BuildInfo::get_product_for_reflect, - BuildInfo::mut_product_for_reflect, + |m: &BuildInfo| { &m.product }, + |m: &mut BuildInfo| { &mut m.product }, )); fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "product_flags", - BuildInfo::get_product_flags_for_reflect, - BuildInfo::mut_product_flags_for_reflect, + |m: &BuildInfo| { &m.product_flags }, + |m: &mut BuildInfo| { &mut m.product_flags }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "platform", - BuildInfo::get_platform_for_reflect, - BuildInfo::mut_platform_for_reflect, + |m: &BuildInfo| { &m.platform }, + |m: &mut BuildInfo| { &mut m.platform }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( "version", - BuildInfo::get_version_for_reflect, - BuildInfo::mut_version_for_reflect, + |m: &BuildInfo| { &m.version }, + |m: &mut BuildInfo| { &mut m.version }, )); ::protobuf::reflect::MessageDescriptor::new::( "BuildInfo", @@ -919,14 +812,24 @@ impl ::protobuf::MessageStatic for BuildInfo { }) } } + + fn default_instance() -> &'static BuildInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const BuildInfo, + }; + unsafe { + instance.get(BuildInfo::new) + } + } } impl ::protobuf::Clear for BuildInfo { fn clear(&mut self) { - self.clear_product(); - self.clear_product_flags(); - self.clear_platform(); - self.clear_version(); + self.product = ::std::option::Option::None; + self.product_flags.clear(); + self.platform = ::std::option::Option::None; + self.version = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -948,30 +851,27 @@ pub struct LoginCryptoHelloUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoHelloUnion {} +impl<'a> ::std::default::Default for &'a LoginCryptoHelloUnion { + fn default() -> &'a LoginCryptoHelloUnion { + ::default_instance() + } +} impl LoginCryptoHelloUnion { pub fn new() -> LoginCryptoHelloUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoHelloUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoHelloUnion, - }; - unsafe { - instance.get(LoginCryptoHelloUnion::new) - } - } - // optional .LoginCryptoDiffieHellmanHello diffie_hellman = 10; + + pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanHello { + self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::default_instance()) + } pub fn clear_diffie_hellman(&mut self) { self.diffie_hellman.clear(); } @@ -998,18 +898,6 @@ impl LoginCryptoHelloUnion { pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanHello { self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::new()) } - - pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanHello { - self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::default_instance()) - } - - fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.diffie_hellman - } - - fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.diffie_hellman - } } impl ::protobuf::Message for LoginCryptoHelloUnion { @@ -1072,27 +960,25 @@ impl ::protobuf::Message for LoginCryptoHelloUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoHelloUnion { fn new() -> LoginCryptoHelloUnion { LoginCryptoHelloUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1102,8 +988,8 @@ impl ::protobuf::MessageStatic for LoginCryptoHelloUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoHelloUnion::get_diffie_hellman_for_reflect, - LoginCryptoHelloUnion::mut_diffie_hellman_for_reflect, + |m: &LoginCryptoHelloUnion| { &m.diffie_hellman }, + |m: &mut LoginCryptoHelloUnion| { &mut m.diffie_hellman }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoHelloUnion", @@ -1113,11 +999,21 @@ impl ::protobuf::MessageStatic for LoginCryptoHelloUnion { }) } } + + fn default_instance() -> &'static LoginCryptoHelloUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoHelloUnion, + }; + unsafe { + instance.get(LoginCryptoHelloUnion::new) + } + } } impl ::protobuf::Clear for LoginCryptoHelloUnion { fn clear(&mut self) { - self.clear_diffie_hellman(); + self.diffie_hellman.clear(); self.unknown_fields.clear(); } } @@ -1140,30 +1036,30 @@ pub struct LoginCryptoDiffieHellmanHello { gc: ::protobuf::SingularField<::std::vec::Vec>, server_keys_known: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoDiffieHellmanHello {} +impl<'a> ::std::default::Default for &'a LoginCryptoDiffieHellmanHello { + fn default() -> &'a LoginCryptoDiffieHellmanHello { + ::default_instance() + } +} impl LoginCryptoDiffieHellmanHello { pub fn new() -> LoginCryptoDiffieHellmanHello { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoDiffieHellmanHello { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoDiffieHellmanHello, - }; - unsafe { - instance.get(LoginCryptoDiffieHellmanHello::new) - } - } - // required bytes gc = 10; + + pub fn get_gc(&self) -> &[u8] { + match self.gc.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gc(&mut self) { self.gc.clear(); } @@ -1191,23 +1087,12 @@ impl LoginCryptoDiffieHellmanHello { self.gc.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gc(&self) -> &[u8] { - match self.gc.as_ref() { - Some(v) => &v, - None => &[], - } - } + // required uint32 server_keys_known = 20; - fn get_gc_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gc - } - fn mut_gc_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gc + pub fn get_server_keys_known(&self) -> u32 { + self.server_keys_known.unwrap_or(0) } - - // required uint32 server_keys_known = 20; - pub fn clear_server_keys_known(&mut self) { self.server_keys_known = ::std::option::Option::None; } @@ -1220,18 +1105,6 @@ impl LoginCryptoDiffieHellmanHello { pub fn set_server_keys_known(&mut self, v: u32) { self.server_keys_known = ::std::option::Option::Some(v); } - - pub fn get_server_keys_known(&self) -> u32 { - self.server_keys_known.unwrap_or(0) - } - - fn get_server_keys_known_for_reflect(&self) -> &::std::option::Option { - &self.server_keys_known - } - - fn mut_server_keys_known_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.server_keys_known - } } impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { @@ -1305,27 +1178,25 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanHello { fn new() -> LoginCryptoDiffieHellmanHello { LoginCryptoDiffieHellmanHello::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1335,13 +1206,13 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanHello { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gc", - LoginCryptoDiffieHellmanHello::get_gc_for_reflect, - LoginCryptoDiffieHellmanHello::mut_gc_for_reflect, + |m: &LoginCryptoDiffieHellmanHello| { &m.gc }, + |m: &mut LoginCryptoDiffieHellmanHello| { &mut m.gc }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "server_keys_known", - LoginCryptoDiffieHellmanHello::get_server_keys_known_for_reflect, - LoginCryptoDiffieHellmanHello::mut_server_keys_known_for_reflect, + |m: &LoginCryptoDiffieHellmanHello| { &m.server_keys_known }, + |m: &mut LoginCryptoDiffieHellmanHello| { &mut m.server_keys_known }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanHello", @@ -1351,12 +1222,22 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanHello { }) } } + + fn default_instance() -> &'static LoginCryptoDiffieHellmanHello { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoDiffieHellmanHello, + }; + unsafe { + instance.get(LoginCryptoDiffieHellmanHello::new) + } + } } impl ::protobuf::Clear for LoginCryptoDiffieHellmanHello { fn clear(&mut self) { - self.clear_gc(); - self.clear_server_keys_known(); + self.gc.clear(); + self.server_keys_known = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -1379,30 +1260,27 @@ pub struct FeatureSet { autoupdate2: ::std::option::Option, current_location: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FeatureSet {} +impl<'a> ::std::default::Default for &'a FeatureSet { + fn default() -> &'a FeatureSet { + ::default_instance() + } +} impl FeatureSet { pub fn new() -> FeatureSet { ::std::default::Default::default() } - pub fn default_instance() -> &'static FeatureSet { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FeatureSet, - }; - unsafe { - instance.get(FeatureSet::new) - } - } - // optional bool autoupdate2 = 1; + + pub fn get_autoupdate2(&self) -> bool { + self.autoupdate2.unwrap_or(false) + } pub fn clear_autoupdate2(&mut self) { self.autoupdate2 = ::std::option::Option::None; } @@ -1416,20 +1294,12 @@ impl FeatureSet { self.autoupdate2 = ::std::option::Option::Some(v); } - pub fn get_autoupdate2(&self) -> bool { - self.autoupdate2.unwrap_or(false) - } + // optional bool current_location = 2; - fn get_autoupdate2_for_reflect(&self) -> &::std::option::Option { - &self.autoupdate2 - } - fn mut_autoupdate2_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.autoupdate2 + pub fn get_current_location(&self) -> bool { + self.current_location.unwrap_or(false) } - - // optional bool current_location = 2; - pub fn clear_current_location(&mut self) { self.current_location = ::std::option::Option::None; } @@ -1442,18 +1312,6 @@ impl FeatureSet { pub fn set_current_location(&mut self, v: bool) { self.current_location = ::std::option::Option::Some(v); } - - pub fn get_current_location(&self) -> bool { - self.current_location.unwrap_or(false) - } - - fn get_current_location_for_reflect(&self) -> &::std::option::Option { - &self.current_location - } - - fn mut_current_location_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.current_location - } } impl ::protobuf::Message for FeatureSet { @@ -1525,27 +1383,25 @@ impl ::protobuf::Message for FeatureSet { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FeatureSet { fn new() -> FeatureSet { FeatureSet::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1555,13 +1411,13 @@ impl ::protobuf::MessageStatic for FeatureSet { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "autoupdate2", - FeatureSet::get_autoupdate2_for_reflect, - FeatureSet::mut_autoupdate2_for_reflect, + |m: &FeatureSet| { &m.autoupdate2 }, + |m: &mut FeatureSet| { &mut m.autoupdate2 }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "current_location", - FeatureSet::get_current_location_for_reflect, - FeatureSet::mut_current_location_for_reflect, + |m: &FeatureSet| { &m.current_location }, + |m: &mut FeatureSet| { &mut m.current_location }, )); ::protobuf::reflect::MessageDescriptor::new::( "FeatureSet", @@ -1571,12 +1427,22 @@ impl ::protobuf::MessageStatic for FeatureSet { }) } } + + fn default_instance() -> &'static FeatureSet { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FeatureSet, + }; + unsafe { + instance.get(FeatureSet::new) + } + } } impl ::protobuf::Clear for FeatureSet { fn clear(&mut self) { - self.clear_autoupdate2(); - self.clear_current_location(); + self.autoupdate2 = ::std::option::Option::None; + self.current_location = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -1600,30 +1466,27 @@ pub struct APResponseMessage { upgrade: ::protobuf::SingularPtrField, login_failed: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for APResponseMessage {} +impl<'a> ::std::default::Default for &'a APResponseMessage { + fn default() -> &'a APResponseMessage { + ::default_instance() + } +} impl APResponseMessage { pub fn new() -> APResponseMessage { ::std::default::Default::default() } - pub fn default_instance() -> &'static APResponseMessage { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const APResponseMessage, - }; - unsafe { - instance.get(APResponseMessage::new) - } - } - // optional .APChallenge challenge = 10; + + pub fn get_challenge(&self) -> &APChallenge { + self.challenge.as_ref().unwrap_or_else(|| APChallenge::default_instance()) + } pub fn clear_challenge(&mut self) { self.challenge.clear(); } @@ -1651,20 +1514,12 @@ impl APResponseMessage { self.challenge.take().unwrap_or_else(|| APChallenge::new()) } - pub fn get_challenge(&self) -> &APChallenge { - self.challenge.as_ref().unwrap_or_else(|| APChallenge::default_instance()) - } + // optional .UpgradeRequiredMessage upgrade = 20; - fn get_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.challenge - } - fn mut_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.challenge + pub fn get_upgrade(&self) -> &UpgradeRequiredMessage { + self.upgrade.as_ref().unwrap_or_else(|| UpgradeRequiredMessage::default_instance()) } - - // optional .UpgradeRequiredMessage upgrade = 20; - pub fn clear_upgrade(&mut self) { self.upgrade.clear(); } @@ -1692,20 +1547,12 @@ impl APResponseMessage { self.upgrade.take().unwrap_or_else(|| UpgradeRequiredMessage::new()) } - pub fn get_upgrade(&self) -> &UpgradeRequiredMessage { - self.upgrade.as_ref().unwrap_or_else(|| UpgradeRequiredMessage::default_instance()) - } + // optional .APLoginFailed login_failed = 30; - fn get_upgrade_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.upgrade - } - fn mut_upgrade_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.upgrade + pub fn get_login_failed(&self) -> &APLoginFailed { + self.login_failed.as_ref().unwrap_or_else(|| APLoginFailed::default_instance()) } - - // optional .APLoginFailed login_failed = 30; - pub fn clear_login_failed(&mut self) { self.login_failed.clear(); } @@ -1729,20 +1576,8 @@ impl APResponseMessage { } // Take field - pub fn take_login_failed(&mut self) -> APLoginFailed { - self.login_failed.take().unwrap_or_else(|| APLoginFailed::new()) - } - - pub fn get_login_failed(&self) -> &APLoginFailed { - self.login_failed.as_ref().unwrap_or_else(|| APLoginFailed::default_instance()) - } - - fn get_login_failed_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.login_failed - } - - fn mut_login_failed_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.login_failed + pub fn take_login_failed(&mut self) -> APLoginFailed { + self.login_failed.take().unwrap_or_else(|| APLoginFailed::new()) } } @@ -1840,27 +1675,25 @@ impl ::protobuf::Message for APResponseMessage { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for APResponseMessage { fn new() -> APResponseMessage { APResponseMessage::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1870,18 +1703,18 @@ impl ::protobuf::MessageStatic for APResponseMessage { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "challenge", - APResponseMessage::get_challenge_for_reflect, - APResponseMessage::mut_challenge_for_reflect, + |m: &APResponseMessage| { &m.challenge }, + |m: &mut APResponseMessage| { &mut m.challenge }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "upgrade", - APResponseMessage::get_upgrade_for_reflect, - APResponseMessage::mut_upgrade_for_reflect, + |m: &APResponseMessage| { &m.upgrade }, + |m: &mut APResponseMessage| { &mut m.upgrade }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_failed", - APResponseMessage::get_login_failed_for_reflect, - APResponseMessage::mut_login_failed_for_reflect, + |m: &APResponseMessage| { &m.login_failed }, + |m: &mut APResponseMessage| { &mut m.login_failed }, )); ::protobuf::reflect::MessageDescriptor::new::( "APResponseMessage", @@ -1891,13 +1724,23 @@ impl ::protobuf::MessageStatic for APResponseMessage { }) } } + + fn default_instance() -> &'static APResponseMessage { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const APResponseMessage, + }; + unsafe { + instance.get(APResponseMessage::new) + } + } } impl ::protobuf::Clear for APResponseMessage { fn clear(&mut self) { - self.clear_challenge(); - self.clear_upgrade(); - self.clear_login_failed(); + self.challenge.clear(); + self.upgrade.clear(); + self.login_failed.clear(); self.unknown_fields.clear(); } } @@ -1924,30 +1767,27 @@ pub struct APChallenge { server_nonce: ::protobuf::SingularField<::std::vec::Vec>, padding: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for APChallenge {} +impl<'a> ::std::default::Default for &'a APChallenge { + fn default() -> &'a APChallenge { + ::default_instance() + } +} impl APChallenge { pub fn new() -> APChallenge { ::std::default::Default::default() } - pub fn default_instance() -> &'static APChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const APChallenge, - }; - unsafe { - instance.get(APChallenge::new) - } - } - // required .LoginCryptoChallengeUnion login_crypto_challenge = 10; + + pub fn get_login_crypto_challenge(&self) -> &LoginCryptoChallengeUnion { + self.login_crypto_challenge.as_ref().unwrap_or_else(|| LoginCryptoChallengeUnion::default_instance()) + } pub fn clear_login_crypto_challenge(&mut self) { self.login_crypto_challenge.clear(); } @@ -1975,20 +1815,12 @@ impl APChallenge { self.login_crypto_challenge.take().unwrap_or_else(|| LoginCryptoChallengeUnion::new()) } - pub fn get_login_crypto_challenge(&self) -> &LoginCryptoChallengeUnion { - self.login_crypto_challenge.as_ref().unwrap_or_else(|| LoginCryptoChallengeUnion::default_instance()) - } + // required .FingerprintChallengeUnion fingerprint_challenge = 20; - fn get_login_crypto_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.login_crypto_challenge - } - fn mut_login_crypto_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.login_crypto_challenge + pub fn get_fingerprint_challenge(&self) -> &FingerprintChallengeUnion { + self.fingerprint_challenge.as_ref().unwrap_or_else(|| FingerprintChallengeUnion::default_instance()) } - - // required .FingerprintChallengeUnion fingerprint_challenge = 20; - pub fn clear_fingerprint_challenge(&mut self) { self.fingerprint_challenge.clear(); } @@ -2016,20 +1848,12 @@ impl APChallenge { self.fingerprint_challenge.take().unwrap_or_else(|| FingerprintChallengeUnion::new()) } - pub fn get_fingerprint_challenge(&self) -> &FingerprintChallengeUnion { - self.fingerprint_challenge.as_ref().unwrap_or_else(|| FingerprintChallengeUnion::default_instance()) - } + // required .PoWChallengeUnion pow_challenge = 30; - fn get_fingerprint_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.fingerprint_challenge - } - fn mut_fingerprint_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.fingerprint_challenge + pub fn get_pow_challenge(&self) -> &PoWChallengeUnion { + self.pow_challenge.as_ref().unwrap_or_else(|| PoWChallengeUnion::default_instance()) } - - // required .PoWChallengeUnion pow_challenge = 30; - pub fn clear_pow_challenge(&mut self) { self.pow_challenge.clear(); } @@ -2057,20 +1881,12 @@ impl APChallenge { self.pow_challenge.take().unwrap_or_else(|| PoWChallengeUnion::new()) } - pub fn get_pow_challenge(&self) -> &PoWChallengeUnion { - self.pow_challenge.as_ref().unwrap_or_else(|| PoWChallengeUnion::default_instance()) - } + // required .CryptoChallengeUnion crypto_challenge = 40; - fn get_pow_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.pow_challenge - } - fn mut_pow_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.pow_challenge + pub fn get_crypto_challenge(&self) -> &CryptoChallengeUnion { + self.crypto_challenge.as_ref().unwrap_or_else(|| CryptoChallengeUnion::default_instance()) } - - // required .CryptoChallengeUnion crypto_challenge = 40; - pub fn clear_crypto_challenge(&mut self) { self.crypto_challenge.clear(); } @@ -2098,20 +1914,15 @@ impl APChallenge { self.crypto_challenge.take().unwrap_or_else(|| CryptoChallengeUnion::new()) } - pub fn get_crypto_challenge(&self) -> &CryptoChallengeUnion { - self.crypto_challenge.as_ref().unwrap_or_else(|| CryptoChallengeUnion::default_instance()) - } + // required bytes server_nonce = 50; - fn get_crypto_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.crypto_challenge - } - fn mut_crypto_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.crypto_challenge + pub fn get_server_nonce(&self) -> &[u8] { + match self.server_nonce.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes server_nonce = 50; - pub fn clear_server_nonce(&mut self) { self.server_nonce.clear(); } @@ -2139,23 +1950,15 @@ impl APChallenge { self.server_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_server_nonce(&self) -> &[u8] { - match self.server_nonce.as_ref() { + // optional bytes padding = 60; + + + pub fn get_padding(&self) -> &[u8] { + match self.padding.as_ref() { Some(v) => &v, None => &[], } } - - fn get_server_nonce_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.server_nonce - } - - fn mut_server_nonce_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.server_nonce - } - - // optional bytes padding = 60; - pub fn clear_padding(&mut self) { self.padding.clear(); } @@ -2182,21 +1985,6 @@ impl APChallenge { pub fn take_padding(&mut self) -> ::std::vec::Vec { self.padding.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_padding(&self) -> &[u8] { - match self.padding.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_padding_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.padding - } - - fn mut_padding_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.padding - } } impl ::protobuf::Message for APChallenge { @@ -2343,27 +2131,25 @@ impl ::protobuf::Message for APChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for APChallenge { fn new() -> APChallenge { APChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2373,33 +2159,33 @@ impl ::protobuf::MessageStatic for APChallenge { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_challenge", - APChallenge::get_login_crypto_challenge_for_reflect, - APChallenge::mut_login_crypto_challenge_for_reflect, + |m: &APChallenge| { &m.login_crypto_challenge }, + |m: &mut APChallenge| { &mut m.login_crypto_challenge }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fingerprint_challenge", - APChallenge::get_fingerprint_challenge_for_reflect, - APChallenge::mut_fingerprint_challenge_for_reflect, + |m: &APChallenge| { &m.fingerprint_challenge }, + |m: &mut APChallenge| { &mut m.fingerprint_challenge }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "pow_challenge", - APChallenge::get_pow_challenge_for_reflect, - APChallenge::mut_pow_challenge_for_reflect, + |m: &APChallenge| { &m.pow_challenge }, + |m: &mut APChallenge| { &mut m.pow_challenge }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "crypto_challenge", - APChallenge::get_crypto_challenge_for_reflect, - APChallenge::mut_crypto_challenge_for_reflect, + |m: &APChallenge| { &m.crypto_challenge }, + |m: &mut APChallenge| { &mut m.crypto_challenge }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "server_nonce", - APChallenge::get_server_nonce_for_reflect, - APChallenge::mut_server_nonce_for_reflect, + |m: &APChallenge| { &m.server_nonce }, + |m: &mut APChallenge| { &mut m.server_nonce }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "padding", - APChallenge::get_padding_for_reflect, - APChallenge::mut_padding_for_reflect, + |m: &APChallenge| { &m.padding }, + |m: &mut APChallenge| { &mut m.padding }, )); ::protobuf::reflect::MessageDescriptor::new::( "APChallenge", @@ -2409,16 +2195,26 @@ impl ::protobuf::MessageStatic for APChallenge { }) } } + + fn default_instance() -> &'static APChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const APChallenge, + }; + unsafe { + instance.get(APChallenge::new) + } + } } impl ::protobuf::Clear for APChallenge { fn clear(&mut self) { - self.clear_login_crypto_challenge(); - self.clear_fingerprint_challenge(); - self.clear_pow_challenge(); - self.clear_crypto_challenge(); - self.clear_server_nonce(); - self.clear_padding(); + self.login_crypto_challenge.clear(); + self.fingerprint_challenge.clear(); + self.pow_challenge.clear(); + self.crypto_challenge.clear(); + self.server_nonce.clear(); + self.padding.clear(); self.unknown_fields.clear(); } } @@ -2440,30 +2236,27 @@ pub struct LoginCryptoChallengeUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoChallengeUnion {} +impl<'a> ::std::default::Default for &'a LoginCryptoChallengeUnion { + fn default() -> &'a LoginCryptoChallengeUnion { + ::default_instance() + } +} impl LoginCryptoChallengeUnion { pub fn new() -> LoginCryptoChallengeUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoChallengeUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoChallengeUnion, - }; - unsafe { - instance.get(LoginCryptoChallengeUnion::new) - } - } - // optional .LoginCryptoDiffieHellmanChallenge diffie_hellman = 10; + + pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanChallenge { + self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::default_instance()) + } pub fn clear_diffie_hellman(&mut self) { self.diffie_hellman.clear(); } @@ -2490,18 +2283,6 @@ impl LoginCryptoChallengeUnion { pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanChallenge { self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::new()) } - - pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanChallenge { - self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::default_instance()) - } - - fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.diffie_hellman - } - - fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.diffie_hellman - } } impl ::protobuf::Message for LoginCryptoChallengeUnion { @@ -2564,27 +2345,25 @@ impl ::protobuf::Message for LoginCryptoChallengeUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoChallengeUnion { fn new() -> LoginCryptoChallengeUnion { LoginCryptoChallengeUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2594,8 +2373,8 @@ impl ::protobuf::MessageStatic for LoginCryptoChallengeUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoChallengeUnion::get_diffie_hellman_for_reflect, - LoginCryptoChallengeUnion::mut_diffie_hellman_for_reflect, + |m: &LoginCryptoChallengeUnion| { &m.diffie_hellman }, + |m: &mut LoginCryptoChallengeUnion| { &mut m.diffie_hellman }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoChallengeUnion", @@ -2605,11 +2384,21 @@ impl ::protobuf::MessageStatic for LoginCryptoChallengeUnion { }) } } + + fn default_instance() -> &'static LoginCryptoChallengeUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoChallengeUnion, + }; + unsafe { + instance.get(LoginCryptoChallengeUnion::new) + } + } } impl ::protobuf::Clear for LoginCryptoChallengeUnion { fn clear(&mut self) { - self.clear_diffie_hellman(); + self.diffie_hellman.clear(); self.unknown_fields.clear(); } } @@ -2633,30 +2422,30 @@ pub struct LoginCryptoDiffieHellmanChallenge { server_signature_key: ::std::option::Option, gs_signature: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoDiffieHellmanChallenge {} +impl<'a> ::std::default::Default for &'a LoginCryptoDiffieHellmanChallenge { + fn default() -> &'a LoginCryptoDiffieHellmanChallenge { + ::default_instance() + } +} impl LoginCryptoDiffieHellmanChallenge { pub fn new() -> LoginCryptoDiffieHellmanChallenge { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoDiffieHellmanChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoDiffieHellmanChallenge, - }; - unsafe { - instance.get(LoginCryptoDiffieHellmanChallenge::new) - } - } - // required bytes gs = 10; + + pub fn get_gs(&self) -> &[u8] { + match self.gs.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gs(&mut self) { self.gs.clear(); } @@ -2684,23 +2473,12 @@ impl LoginCryptoDiffieHellmanChallenge { self.gs.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gs(&self) -> &[u8] { - match self.gs.as_ref() { - Some(v) => &v, - None => &[], - } - } + // required int32 server_signature_key = 20; - fn get_gs_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gs - } - fn mut_gs_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gs + pub fn get_server_signature_key(&self) -> i32 { + self.server_signature_key.unwrap_or(0) } - - // required int32 server_signature_key = 20; - pub fn clear_server_signature_key(&mut self) { self.server_signature_key = ::std::option::Option::None; } @@ -2714,20 +2492,15 @@ impl LoginCryptoDiffieHellmanChallenge { self.server_signature_key = ::std::option::Option::Some(v); } - pub fn get_server_signature_key(&self) -> i32 { - self.server_signature_key.unwrap_or(0) - } + // required bytes gs_signature = 30; - fn get_server_signature_key_for_reflect(&self) -> &::std::option::Option { - &self.server_signature_key - } - fn mut_server_signature_key_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.server_signature_key + pub fn get_gs_signature(&self) -> &[u8] { + match self.gs_signature.as_ref() { + Some(v) => &v, + None => &[], + } } - - // required bytes gs_signature = 30; - pub fn clear_gs_signature(&mut self) { self.gs_signature.clear(); } @@ -2754,21 +2527,6 @@ impl LoginCryptoDiffieHellmanChallenge { pub fn take_gs_signature(&mut self) -> ::std::vec::Vec { self.gs_signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_gs_signature(&self) -> &[u8] { - match self.gs_signature.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_gs_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gs_signature - } - - fn mut_gs_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gs_signature - } } impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { @@ -2854,27 +2612,25 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanChallenge { fn new() -> LoginCryptoDiffieHellmanChallenge { LoginCryptoDiffieHellmanChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2884,18 +2640,18 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanChallenge { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gs", - LoginCryptoDiffieHellmanChallenge::get_gs_for_reflect, - LoginCryptoDiffieHellmanChallenge::mut_gs_for_reflect, + |m: &LoginCryptoDiffieHellmanChallenge| { &m.gs }, + |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.gs }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "server_signature_key", - LoginCryptoDiffieHellmanChallenge::get_server_signature_key_for_reflect, - LoginCryptoDiffieHellmanChallenge::mut_server_signature_key_for_reflect, + |m: &LoginCryptoDiffieHellmanChallenge| { &m.server_signature_key }, + |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.server_signature_key }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gs_signature", - LoginCryptoDiffieHellmanChallenge::get_gs_signature_for_reflect, - LoginCryptoDiffieHellmanChallenge::mut_gs_signature_for_reflect, + |m: &LoginCryptoDiffieHellmanChallenge| { &m.gs_signature }, + |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.gs_signature }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanChallenge", @@ -2905,13 +2661,23 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanChallenge { }) } } + + fn default_instance() -> &'static LoginCryptoDiffieHellmanChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoDiffieHellmanChallenge, + }; + unsafe { + instance.get(LoginCryptoDiffieHellmanChallenge::new) + } + } } impl ::protobuf::Clear for LoginCryptoDiffieHellmanChallenge { fn clear(&mut self) { - self.clear_gs(); - self.clear_server_signature_key(); - self.clear_gs_signature(); + self.gs.clear(); + self.server_signature_key = ::std::option::Option::None; + self.gs_signature.clear(); self.unknown_fields.clear(); } } @@ -2934,30 +2700,27 @@ pub struct FingerprintChallengeUnion { grain: ::protobuf::SingularPtrField, hmac_ripemd: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintChallengeUnion {} +impl<'a> ::std::default::Default for &'a FingerprintChallengeUnion { + fn default() -> &'a FingerprintChallengeUnion { + ::default_instance() + } +} impl FingerprintChallengeUnion { pub fn new() -> FingerprintChallengeUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintChallengeUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintChallengeUnion, - }; - unsafe { - instance.get(FingerprintChallengeUnion::new) - } - } - // optional .FingerprintGrainChallenge grain = 10; + + pub fn get_grain(&self) -> &FingerprintGrainChallenge { + self.grain.as_ref().unwrap_or_else(|| FingerprintGrainChallenge::default_instance()) + } pub fn clear_grain(&mut self) { self.grain.clear(); } @@ -2985,20 +2748,12 @@ impl FingerprintChallengeUnion { self.grain.take().unwrap_or_else(|| FingerprintGrainChallenge::new()) } - pub fn get_grain(&self) -> &FingerprintGrainChallenge { - self.grain.as_ref().unwrap_or_else(|| FingerprintGrainChallenge::default_instance()) - } + // optional .FingerprintHmacRipemdChallenge hmac_ripemd = 20; - fn get_grain_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.grain - } - fn mut_grain_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.grain + pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdChallenge { + self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdChallenge::default_instance()) } - - // optional .FingerprintHmacRipemdChallenge hmac_ripemd = 20; - pub fn clear_hmac_ripemd(&mut self) { self.hmac_ripemd.clear(); } @@ -3015,27 +2770,15 @@ impl FingerprintChallengeUnion { // Mutable pointer to the field. // If field is not initialized, it is initialized with default value first. pub fn mut_hmac_ripemd(&mut self) -> &mut FingerprintHmacRipemdChallenge { - if self.hmac_ripemd.is_none() { - self.hmac_ripemd.set_default(); - } - self.hmac_ripemd.as_mut().unwrap() - } - - // Take field - pub fn take_hmac_ripemd(&mut self) -> FingerprintHmacRipemdChallenge { - self.hmac_ripemd.take().unwrap_or_else(|| FingerprintHmacRipemdChallenge::new()) - } - - pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdChallenge { - self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdChallenge::default_instance()) - } - - fn get_hmac_ripemd_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.hmac_ripemd + if self.hmac_ripemd.is_none() { + self.hmac_ripemd.set_default(); + } + self.hmac_ripemd.as_mut().unwrap() } - fn mut_hmac_ripemd_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.hmac_ripemd + // Take field + pub fn take_hmac_ripemd(&mut self) -> FingerprintHmacRipemdChallenge { + self.hmac_ripemd.take().unwrap_or_else(|| FingerprintHmacRipemdChallenge::new()) } } @@ -3116,27 +2859,25 @@ impl ::protobuf::Message for FingerprintChallengeUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintChallengeUnion { fn new() -> FingerprintChallengeUnion { FingerprintChallengeUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3146,13 +2887,13 @@ impl ::protobuf::MessageStatic for FingerprintChallengeUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "grain", - FingerprintChallengeUnion::get_grain_for_reflect, - FingerprintChallengeUnion::mut_grain_for_reflect, + |m: &FingerprintChallengeUnion| { &m.grain }, + |m: &mut FingerprintChallengeUnion| { &mut m.grain }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hmac_ripemd", - FingerprintChallengeUnion::get_hmac_ripemd_for_reflect, - FingerprintChallengeUnion::mut_hmac_ripemd_for_reflect, + |m: &FingerprintChallengeUnion| { &m.hmac_ripemd }, + |m: &mut FingerprintChallengeUnion| { &mut m.hmac_ripemd }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintChallengeUnion", @@ -3162,12 +2903,22 @@ impl ::protobuf::MessageStatic for FingerprintChallengeUnion { }) } } + + fn default_instance() -> &'static FingerprintChallengeUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintChallengeUnion, + }; + unsafe { + instance.get(FingerprintChallengeUnion::new) + } + } } impl ::protobuf::Clear for FingerprintChallengeUnion { fn clear(&mut self) { - self.clear_grain(); - self.clear_hmac_ripemd(); + self.grain.clear(); + self.hmac_ripemd.clear(); self.unknown_fields.clear(); } } @@ -3189,30 +2940,30 @@ pub struct FingerprintGrainChallenge { // message fields kek: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintGrainChallenge {} +impl<'a> ::std::default::Default for &'a FingerprintGrainChallenge { + fn default() -> &'a FingerprintGrainChallenge { + ::default_instance() + } +} impl FingerprintGrainChallenge { pub fn new() -> FingerprintGrainChallenge { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintGrainChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintGrainChallenge, - }; - unsafe { - instance.get(FingerprintGrainChallenge::new) - } - } - // required bytes kek = 10; + + pub fn get_kek(&self) -> &[u8] { + match self.kek.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_kek(&mut self) { self.kek.clear(); } @@ -3239,21 +2990,6 @@ impl FingerprintGrainChallenge { pub fn take_kek(&mut self) -> ::std::vec::Vec { self.kek.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_kek(&self) -> &[u8] { - match self.kek.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_kek_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.kek - } - - fn mut_kek_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.kek - } } impl ::protobuf::Message for FingerprintGrainChallenge { @@ -3311,27 +3047,25 @@ impl ::protobuf::Message for FingerprintGrainChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintGrainChallenge { fn new() -> FingerprintGrainChallenge { FingerprintGrainChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3341,8 +3075,8 @@ impl ::protobuf::MessageStatic for FingerprintGrainChallenge { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "kek", - FingerprintGrainChallenge::get_kek_for_reflect, - FingerprintGrainChallenge::mut_kek_for_reflect, + |m: &FingerprintGrainChallenge| { &m.kek }, + |m: &mut FingerprintGrainChallenge| { &mut m.kek }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintGrainChallenge", @@ -3352,11 +3086,21 @@ impl ::protobuf::MessageStatic for FingerprintGrainChallenge { }) } } + + fn default_instance() -> &'static FingerprintGrainChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintGrainChallenge, + }; + unsafe { + instance.get(FingerprintGrainChallenge::new) + } + } } impl ::protobuf::Clear for FingerprintGrainChallenge { fn clear(&mut self) { - self.clear_kek(); + self.kek.clear(); self.unknown_fields.clear(); } } @@ -3378,30 +3122,30 @@ pub struct FingerprintHmacRipemdChallenge { // message fields challenge: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for FingerprintHmacRipemdChallenge {} +impl<'a> ::std::default::Default for &'a FingerprintHmacRipemdChallenge { + fn default() -> &'a FingerprintHmacRipemdChallenge { + ::default_instance() + } +} impl FingerprintHmacRipemdChallenge { pub fn new() -> FingerprintHmacRipemdChallenge { ::std::default::Default::default() } - pub fn default_instance() -> &'static FingerprintHmacRipemdChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const FingerprintHmacRipemdChallenge, - }; - unsafe { - instance.get(FingerprintHmacRipemdChallenge::new) - } - } - // required bytes challenge = 10; + + pub fn get_challenge(&self) -> &[u8] { + match self.challenge.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_challenge(&mut self) { self.challenge.clear(); } @@ -3428,21 +3172,6 @@ impl FingerprintHmacRipemdChallenge { pub fn take_challenge(&mut self) -> ::std::vec::Vec { self.challenge.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_challenge(&self) -> &[u8] { - match self.challenge.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_challenge_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.challenge - } - - fn mut_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.challenge - } } impl ::protobuf::Message for FingerprintHmacRipemdChallenge { @@ -3500,27 +3229,25 @@ impl ::protobuf::Message for FingerprintHmacRipemdChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for FingerprintHmacRipemdChallenge { fn new() -> FingerprintHmacRipemdChallenge { FingerprintHmacRipemdChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3530,8 +3257,8 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdChallenge { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "challenge", - FingerprintHmacRipemdChallenge::get_challenge_for_reflect, - FingerprintHmacRipemdChallenge::mut_challenge_for_reflect, + |m: &FingerprintHmacRipemdChallenge| { &m.challenge }, + |m: &mut FingerprintHmacRipemdChallenge| { &mut m.challenge }, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintHmacRipemdChallenge", @@ -3541,11 +3268,21 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdChallenge { }) } } + + fn default_instance() -> &'static FingerprintHmacRipemdChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const FingerprintHmacRipemdChallenge, + }; + unsafe { + instance.get(FingerprintHmacRipemdChallenge::new) + } + } } impl ::protobuf::Clear for FingerprintHmacRipemdChallenge { fn clear(&mut self) { - self.clear_challenge(); + self.challenge.clear(); self.unknown_fields.clear(); } } @@ -3567,30 +3304,27 @@ pub struct PoWChallengeUnion { // message fields hash_cash: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PoWChallengeUnion {} +impl<'a> ::std::default::Default for &'a PoWChallengeUnion { + fn default() -> &'a PoWChallengeUnion { + ::default_instance() + } +} impl PoWChallengeUnion { pub fn new() -> PoWChallengeUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static PoWChallengeUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PoWChallengeUnion, - }; - unsafe { - instance.get(PoWChallengeUnion::new) - } - } - // optional .PoWHashCashChallenge hash_cash = 10; + + pub fn get_hash_cash(&self) -> &PoWHashCashChallenge { + self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashChallenge::default_instance()) + } pub fn clear_hash_cash(&mut self) { self.hash_cash.clear(); } @@ -3617,18 +3351,6 @@ impl PoWChallengeUnion { pub fn take_hash_cash(&mut self) -> PoWHashCashChallenge { self.hash_cash.take().unwrap_or_else(|| PoWHashCashChallenge::new()) } - - pub fn get_hash_cash(&self) -> &PoWHashCashChallenge { - self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashChallenge::default_instance()) - } - - fn get_hash_cash_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.hash_cash - } - - fn mut_hash_cash_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.hash_cash - } } impl ::protobuf::Message for PoWChallengeUnion { @@ -3691,27 +3413,25 @@ impl ::protobuf::Message for PoWChallengeUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PoWChallengeUnion { fn new() -> PoWChallengeUnion { PoWChallengeUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3721,8 +3441,8 @@ impl ::protobuf::MessageStatic for PoWChallengeUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hash_cash", - PoWChallengeUnion::get_hash_cash_for_reflect, - PoWChallengeUnion::mut_hash_cash_for_reflect, + |m: &PoWChallengeUnion| { &m.hash_cash }, + |m: &mut PoWChallengeUnion| { &mut m.hash_cash }, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWChallengeUnion", @@ -3732,11 +3452,21 @@ impl ::protobuf::MessageStatic for PoWChallengeUnion { }) } } + + fn default_instance() -> &'static PoWChallengeUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PoWChallengeUnion, + }; + unsafe { + instance.get(PoWChallengeUnion::new) + } + } } impl ::protobuf::Clear for PoWChallengeUnion { fn clear(&mut self) { - self.clear_hash_cash(); + self.hash_cash.clear(); self.unknown_fields.clear(); } } @@ -3760,30 +3490,30 @@ pub struct PoWHashCashChallenge { length: ::std::option::Option, target: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PoWHashCashChallenge {} +impl<'a> ::std::default::Default for &'a PoWHashCashChallenge { + fn default() -> &'a PoWHashCashChallenge { + ::default_instance() + } +} impl PoWHashCashChallenge { pub fn new() -> PoWHashCashChallenge { ::std::default::Default::default() } - pub fn default_instance() -> &'static PoWHashCashChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PoWHashCashChallenge, - }; - unsafe { - instance.get(PoWHashCashChallenge::new) - } - } - // optional bytes prefix = 10; + + pub fn get_prefix(&self) -> &[u8] { + match self.prefix.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_prefix(&mut self) { self.prefix.clear(); } @@ -3811,23 +3541,12 @@ impl PoWHashCashChallenge { self.prefix.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_prefix(&self) -> &[u8] { - match self.prefix.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional int32 length = 20; - fn get_prefix_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.prefix - } - fn mut_prefix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.prefix + pub fn get_length(&self) -> i32 { + self.length.unwrap_or(0) } - - // optional int32 length = 20; - pub fn clear_length(&mut self) { self.length = ::std::option::Option::None; } @@ -3841,20 +3560,12 @@ impl PoWHashCashChallenge { self.length = ::std::option::Option::Some(v); } - pub fn get_length(&self) -> i32 { - self.length.unwrap_or(0) - } + // optional int32 target = 30; - fn get_length_for_reflect(&self) -> &::std::option::Option { - &self.length - } - fn mut_length_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.length + pub fn get_target(&self) -> i32 { + self.target.unwrap_or(0) } - - // optional int32 target = 30; - pub fn clear_target(&mut self) { self.target = ::std::option::Option::None; } @@ -3867,18 +3578,6 @@ impl PoWHashCashChallenge { pub fn set_target(&mut self, v: i32) { self.target = ::std::option::Option::Some(v); } - - pub fn get_target(&self) -> i32 { - self.target.unwrap_or(0) - } - - fn get_target_for_reflect(&self) -> &::std::option::Option { - &self.target - } - - fn mut_target_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.target - } } impl ::protobuf::Message for PoWHashCashChallenge { @@ -3959,27 +3658,25 @@ impl ::protobuf::Message for PoWHashCashChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PoWHashCashChallenge { fn new() -> PoWHashCashChallenge { PoWHashCashChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3989,18 +3686,18 @@ impl ::protobuf::MessageStatic for PoWHashCashChallenge { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "prefix", - PoWHashCashChallenge::get_prefix_for_reflect, - PoWHashCashChallenge::mut_prefix_for_reflect, + |m: &PoWHashCashChallenge| { &m.prefix }, + |m: &mut PoWHashCashChallenge| { &mut m.prefix }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "length", - PoWHashCashChallenge::get_length_for_reflect, - PoWHashCashChallenge::mut_length_for_reflect, + |m: &PoWHashCashChallenge| { &m.length }, + |m: &mut PoWHashCashChallenge| { &mut m.length }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "target", - PoWHashCashChallenge::get_target_for_reflect, - PoWHashCashChallenge::mut_target_for_reflect, + |m: &PoWHashCashChallenge| { &m.target }, + |m: &mut PoWHashCashChallenge| { &mut m.target }, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWHashCashChallenge", @@ -4010,13 +3707,23 @@ impl ::protobuf::MessageStatic for PoWHashCashChallenge { }) } } + + fn default_instance() -> &'static PoWHashCashChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PoWHashCashChallenge, + }; + unsafe { + instance.get(PoWHashCashChallenge::new) + } + } } impl ::protobuf::Clear for PoWHashCashChallenge { fn clear(&mut self) { - self.clear_prefix(); - self.clear_length(); - self.clear_target(); + self.prefix.clear(); + self.length = ::std::option::Option::None; + self.target = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -4039,30 +3746,27 @@ pub struct CryptoChallengeUnion { shannon: ::protobuf::SingularPtrField, rc4_sha1_hmac: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoChallengeUnion {} +impl<'a> ::std::default::Default for &'a CryptoChallengeUnion { + fn default() -> &'a CryptoChallengeUnion { + ::default_instance() + } +} impl CryptoChallengeUnion { pub fn new() -> CryptoChallengeUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static CryptoChallengeUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoChallengeUnion, - }; - unsafe { - instance.get(CryptoChallengeUnion::new) - } - } - // optional .CryptoShannonChallenge shannon = 10; + + pub fn get_shannon(&self) -> &CryptoShannonChallenge { + self.shannon.as_ref().unwrap_or_else(|| CryptoShannonChallenge::default_instance()) + } pub fn clear_shannon(&mut self) { self.shannon.clear(); } @@ -4090,20 +3794,12 @@ impl CryptoChallengeUnion { self.shannon.take().unwrap_or_else(|| CryptoShannonChallenge::new()) } - pub fn get_shannon(&self) -> &CryptoShannonChallenge { - self.shannon.as_ref().unwrap_or_else(|| CryptoShannonChallenge::default_instance()) - } + // optional .CryptoRc4Sha1HmacChallenge rc4_sha1_hmac = 20; - fn get_shannon_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.shannon - } - fn mut_shannon_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.shannon + pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacChallenge { + self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::default_instance()) } - - // optional .CryptoRc4Sha1HmacChallenge rc4_sha1_hmac = 20; - pub fn clear_rc4_sha1_hmac(&mut self) { self.rc4_sha1_hmac.clear(); } @@ -4130,18 +3826,6 @@ impl CryptoChallengeUnion { pub fn take_rc4_sha1_hmac(&mut self) -> CryptoRc4Sha1HmacChallenge { self.rc4_sha1_hmac.take().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::new()) } - - pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacChallenge { - self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::default_instance()) - } - - fn get_rc4_sha1_hmac_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.rc4_sha1_hmac - } - - fn mut_rc4_sha1_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.rc4_sha1_hmac - } } impl ::protobuf::Message for CryptoChallengeUnion { @@ -4221,27 +3905,25 @@ impl ::protobuf::Message for CryptoChallengeUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoChallengeUnion { fn new() -> CryptoChallengeUnion { CryptoChallengeUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4251,13 +3933,13 @@ impl ::protobuf::MessageStatic for CryptoChallengeUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "shannon", - CryptoChallengeUnion::get_shannon_for_reflect, - CryptoChallengeUnion::mut_shannon_for_reflect, + |m: &CryptoChallengeUnion| { &m.shannon }, + |m: &mut CryptoChallengeUnion| { &mut m.shannon }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "rc4_sha1_hmac", - CryptoChallengeUnion::get_rc4_sha1_hmac_for_reflect, - CryptoChallengeUnion::mut_rc4_sha1_hmac_for_reflect, + |m: &CryptoChallengeUnion| { &m.rc4_sha1_hmac }, + |m: &mut CryptoChallengeUnion| { &mut m.rc4_sha1_hmac }, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoChallengeUnion", @@ -4267,12 +3949,22 @@ impl ::protobuf::MessageStatic for CryptoChallengeUnion { }) } } + + fn default_instance() -> &'static CryptoChallengeUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoChallengeUnion, + }; + unsafe { + instance.get(CryptoChallengeUnion::new) + } + } } impl ::protobuf::Clear for CryptoChallengeUnion { fn clear(&mut self) { - self.clear_shannon(); - self.clear_rc4_sha1_hmac(); + self.shannon.clear(); + self.rc4_sha1_hmac.clear(); self.unknown_fields.clear(); } } @@ -4292,27 +3984,20 @@ impl ::protobuf::reflect::ProtobufValue for CryptoChallengeUnion { #[derive(PartialEq,Clone,Default)] pub struct CryptoShannonChallenge { // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoShannonChallenge {} +impl<'a> ::std::default::Default for &'a CryptoShannonChallenge { + fn default() -> &'a CryptoShannonChallenge { + ::default_instance() + } +} impl CryptoShannonChallenge { pub fn new() -> CryptoShannonChallenge { ::std::default::Default::default() } - - pub fn default_instance() -> &'static CryptoShannonChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoShannonChallenge, - }; - unsafe { - instance.get(CryptoShannonChallenge::new) - } - } } impl ::protobuf::Message for CryptoShannonChallenge { @@ -4358,27 +4043,25 @@ impl ::protobuf::Message for CryptoShannonChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoShannonChallenge { fn new() -> CryptoShannonChallenge { CryptoShannonChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4394,6 +4077,16 @@ impl ::protobuf::MessageStatic for CryptoShannonChallenge { }) } } + + fn default_instance() -> &'static CryptoShannonChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoShannonChallenge, + }; + unsafe { + instance.get(CryptoShannonChallenge::new) + } + } } impl ::protobuf::Clear for CryptoShannonChallenge { @@ -4417,27 +4110,20 @@ impl ::protobuf::reflect::ProtobufValue for CryptoShannonChallenge { #[derive(PartialEq,Clone,Default)] pub struct CryptoRc4Sha1HmacChallenge { // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoRc4Sha1HmacChallenge {} +impl<'a> ::std::default::Default for &'a CryptoRc4Sha1HmacChallenge { + fn default() -> &'a CryptoRc4Sha1HmacChallenge { + ::default_instance() + } +} impl CryptoRc4Sha1HmacChallenge { pub fn new() -> CryptoRc4Sha1HmacChallenge { ::std::default::Default::default() } - - pub fn default_instance() -> &'static CryptoRc4Sha1HmacChallenge { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoRc4Sha1HmacChallenge, - }; - unsafe { - instance.get(CryptoRc4Sha1HmacChallenge::new) - } - } } impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge { @@ -4483,27 +4169,25 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacChallenge { fn new() -> CryptoRc4Sha1HmacChallenge { CryptoRc4Sha1HmacChallenge::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4519,6 +4203,16 @@ impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacChallenge { }) } } + + fn default_instance() -> &'static CryptoRc4Sha1HmacChallenge { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoRc4Sha1HmacChallenge, + }; + unsafe { + instance.get(CryptoRc4Sha1HmacChallenge::new) + } + } } impl ::protobuf::Clear for CryptoRc4Sha1HmacChallenge { @@ -4546,30 +4240,30 @@ pub struct UpgradeRequiredMessage { signature: ::protobuf::SingularField<::std::vec::Vec>, http_suffix: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for UpgradeRequiredMessage {} +impl<'a> ::std::default::Default for &'a UpgradeRequiredMessage { + fn default() -> &'a UpgradeRequiredMessage { + ::default_instance() + } +} impl UpgradeRequiredMessage { pub fn new() -> UpgradeRequiredMessage { ::std::default::Default::default() } - pub fn default_instance() -> &'static UpgradeRequiredMessage { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const UpgradeRequiredMessage, - }; - unsafe { - instance.get(UpgradeRequiredMessage::new) - } - } - // required bytes upgrade_signed_part = 10; + + pub fn get_upgrade_signed_part(&self) -> &[u8] { + match self.upgrade_signed_part.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_upgrade_signed_part(&mut self) { self.upgrade_signed_part.clear(); } @@ -4597,23 +4291,15 @@ impl UpgradeRequiredMessage { self.upgrade_signed_part.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_upgrade_signed_part(&self) -> &[u8] { - match self.upgrade_signed_part.as_ref() { + // required bytes signature = 20; + + + pub fn get_signature(&self) -> &[u8] { + match self.signature.as_ref() { Some(v) => &v, None => &[], } } - - fn get_upgrade_signed_part_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.upgrade_signed_part - } - - fn mut_upgrade_signed_part_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.upgrade_signed_part - } - - // required bytes signature = 20; - pub fn clear_signature(&mut self) { self.signature.clear(); } @@ -4641,23 +4327,15 @@ impl UpgradeRequiredMessage { self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_signature(&self) -> &[u8] { - match self.signature.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string http_suffix = 30; - fn get_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.signature - } - fn mut_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.signature + pub fn get_http_suffix(&self) -> &str { + match self.http_suffix.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string http_suffix = 30; - pub fn clear_http_suffix(&mut self) { self.http_suffix.clear(); } @@ -4684,21 +4362,6 @@ impl UpgradeRequiredMessage { pub fn take_http_suffix(&mut self) -> ::std::string::String { self.http_suffix.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_http_suffix(&self) -> &str { - match self.http_suffix.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_http_suffix_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.http_suffix - } - - fn mut_http_suffix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.http_suffix - } } impl ::protobuf::Message for UpgradeRequiredMessage { @@ -4777,27 +4440,25 @@ impl ::protobuf::Message for UpgradeRequiredMessage { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for UpgradeRequiredMessage { fn new() -> UpgradeRequiredMessage { UpgradeRequiredMessage::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4807,18 +4468,18 @@ impl ::protobuf::MessageStatic for UpgradeRequiredMessage { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "upgrade_signed_part", - UpgradeRequiredMessage::get_upgrade_signed_part_for_reflect, - UpgradeRequiredMessage::mut_upgrade_signed_part_for_reflect, + |m: &UpgradeRequiredMessage| { &m.upgrade_signed_part }, + |m: &mut UpgradeRequiredMessage| { &mut m.upgrade_signed_part }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "signature", - UpgradeRequiredMessage::get_signature_for_reflect, - UpgradeRequiredMessage::mut_signature_for_reflect, + |m: &UpgradeRequiredMessage| { &m.signature }, + |m: &mut UpgradeRequiredMessage| { &mut m.signature }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "http_suffix", - UpgradeRequiredMessage::get_http_suffix_for_reflect, - UpgradeRequiredMessage::mut_http_suffix_for_reflect, + |m: &UpgradeRequiredMessage| { &m.http_suffix }, + |m: &mut UpgradeRequiredMessage| { &mut m.http_suffix }, )); ::protobuf::reflect::MessageDescriptor::new::( "UpgradeRequiredMessage", @@ -4828,13 +4489,23 @@ impl ::protobuf::MessageStatic for UpgradeRequiredMessage { }) } } + + fn default_instance() -> &'static UpgradeRequiredMessage { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const UpgradeRequiredMessage, + }; + unsafe { + instance.get(UpgradeRequiredMessage::new) + } + } } impl ::protobuf::Clear for UpgradeRequiredMessage { fn clear(&mut self) { - self.clear_upgrade_signed_part(); - self.clear_signature(); - self.clear_http_suffix(); + self.upgrade_signed_part.clear(); + self.signature.clear(); + self.http_suffix.clear(); self.unknown_fields.clear(); } } @@ -4859,30 +4530,27 @@ pub struct APLoginFailed { expiry: ::std::option::Option, error_description: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for APLoginFailed {} +impl<'a> ::std::default::Default for &'a APLoginFailed { + fn default() -> &'a APLoginFailed { + ::default_instance() + } +} impl APLoginFailed { pub fn new() -> APLoginFailed { ::std::default::Default::default() } - pub fn default_instance() -> &'static APLoginFailed { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const APLoginFailed, - }; - unsafe { - instance.get(APLoginFailed::new) - } - } - // required .ErrorCode error_code = 10; + + pub fn get_error_code(&self) -> ErrorCode { + self.error_code.unwrap_or(ErrorCode::ProtocolError) + } pub fn clear_error_code(&mut self) { self.error_code = ::std::option::Option::None; } @@ -4896,20 +4564,12 @@ impl APLoginFailed { self.error_code = ::std::option::Option::Some(v); } - pub fn get_error_code(&self) -> ErrorCode { - self.error_code.unwrap_or(ErrorCode::ProtocolError) - } + // optional int32 retry_delay = 20; - fn get_error_code_for_reflect(&self) -> &::std::option::Option { - &self.error_code - } - fn mut_error_code_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.error_code + pub fn get_retry_delay(&self) -> i32 { + self.retry_delay.unwrap_or(0) } - - // optional int32 retry_delay = 20; - pub fn clear_retry_delay(&mut self) { self.retry_delay = ::std::option::Option::None; } @@ -4923,20 +4583,12 @@ impl APLoginFailed { self.retry_delay = ::std::option::Option::Some(v); } - pub fn get_retry_delay(&self) -> i32 { - self.retry_delay.unwrap_or(0) - } + // optional int32 expiry = 30; - fn get_retry_delay_for_reflect(&self) -> &::std::option::Option { - &self.retry_delay - } - fn mut_retry_delay_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.retry_delay + pub fn get_expiry(&self) -> i32 { + self.expiry.unwrap_or(0) } - - // optional int32 expiry = 30; - pub fn clear_expiry(&mut self) { self.expiry = ::std::option::Option::None; } @@ -4950,20 +4602,15 @@ impl APLoginFailed { self.expiry = ::std::option::Option::Some(v); } - pub fn get_expiry(&self) -> i32 { - self.expiry.unwrap_or(0) - } + // optional string error_description = 40; - fn get_expiry_for_reflect(&self) -> &::std::option::Option { - &self.expiry - } - fn mut_expiry_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.expiry + pub fn get_error_description(&self) -> &str { + match self.error_description.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string error_description = 40; - pub fn clear_error_description(&mut self) { self.error_description.clear(); } @@ -4990,21 +4637,6 @@ impl APLoginFailed { pub fn take_error_description(&mut self) -> ::std::string::String { self.error_description.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_error_description(&self) -> &str { - match self.error_description.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_error_description_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.error_description - } - - fn mut_error_description_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.error_description - } } impl ::protobuf::Message for APLoginFailed { @@ -5020,11 +4652,7 @@ impl ::protobuf::Message for APLoginFailed { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.error_code = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.error_code, 10, &mut self.unknown_fields)? }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -5101,27 +4729,25 @@ impl ::protobuf::Message for APLoginFailed { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for APLoginFailed { fn new() -> APLoginFailed { APLoginFailed::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5131,23 +4757,23 @@ impl ::protobuf::MessageStatic for APLoginFailed { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "error_code", - APLoginFailed::get_error_code_for_reflect, - APLoginFailed::mut_error_code_for_reflect, + |m: &APLoginFailed| { &m.error_code }, + |m: &mut APLoginFailed| { &mut m.error_code }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "retry_delay", - APLoginFailed::get_retry_delay_for_reflect, - APLoginFailed::mut_retry_delay_for_reflect, + |m: &APLoginFailed| { &m.retry_delay }, + |m: &mut APLoginFailed| { &mut m.retry_delay }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "expiry", - APLoginFailed::get_expiry_for_reflect, - APLoginFailed::mut_expiry_for_reflect, + |m: &APLoginFailed| { &m.expiry }, + |m: &mut APLoginFailed| { &mut m.expiry }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "error_description", - APLoginFailed::get_error_description_for_reflect, - APLoginFailed::mut_error_description_for_reflect, + |m: &APLoginFailed| { &m.error_description }, + |m: &mut APLoginFailed| { &mut m.error_description }, )); ::protobuf::reflect::MessageDescriptor::new::( "APLoginFailed", @@ -5157,14 +4783,24 @@ impl ::protobuf::MessageStatic for APLoginFailed { }) } } + + fn default_instance() -> &'static APLoginFailed { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const APLoginFailed, + }; + unsafe { + instance.get(APLoginFailed::new) + } + } } impl ::protobuf::Clear for APLoginFailed { fn clear(&mut self) { - self.clear_error_code(); - self.clear_retry_delay(); - self.clear_expiry(); - self.clear_error_description(); + self.error_code = ::std::option::Option::None; + self.retry_delay = ::std::option::Option::None; + self.expiry = ::std::option::Option::None; + self.error_description.clear(); self.unknown_fields.clear(); } } @@ -5188,30 +4824,27 @@ pub struct ClientResponsePlaintext { pow_response: ::protobuf::SingularPtrField, crypto_response: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ClientResponsePlaintext {} +impl<'a> ::std::default::Default for &'a ClientResponsePlaintext { + fn default() -> &'a ClientResponsePlaintext { + ::default_instance() + } +} impl ClientResponsePlaintext { pub fn new() -> ClientResponsePlaintext { ::std::default::Default::default() } - pub fn default_instance() -> &'static ClientResponsePlaintext { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ClientResponsePlaintext, - }; - unsafe { - instance.get(ClientResponsePlaintext::new) - } - } - // required .LoginCryptoResponseUnion login_crypto_response = 10; + + pub fn get_login_crypto_response(&self) -> &LoginCryptoResponseUnion { + self.login_crypto_response.as_ref().unwrap_or_else(|| LoginCryptoResponseUnion::default_instance()) + } pub fn clear_login_crypto_response(&mut self) { self.login_crypto_response.clear(); } @@ -5239,20 +4872,12 @@ impl ClientResponsePlaintext { self.login_crypto_response.take().unwrap_or_else(|| LoginCryptoResponseUnion::new()) } - pub fn get_login_crypto_response(&self) -> &LoginCryptoResponseUnion { - self.login_crypto_response.as_ref().unwrap_or_else(|| LoginCryptoResponseUnion::default_instance()) - } + // required .PoWResponseUnion pow_response = 20; - fn get_login_crypto_response_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.login_crypto_response - } - fn mut_login_crypto_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.login_crypto_response + pub fn get_pow_response(&self) -> &PoWResponseUnion { + self.pow_response.as_ref().unwrap_or_else(|| PoWResponseUnion::default_instance()) } - - // required .PoWResponseUnion pow_response = 20; - pub fn clear_pow_response(&mut self) { self.pow_response.clear(); } @@ -5280,20 +4905,12 @@ impl ClientResponsePlaintext { self.pow_response.take().unwrap_or_else(|| PoWResponseUnion::new()) } - pub fn get_pow_response(&self) -> &PoWResponseUnion { - self.pow_response.as_ref().unwrap_or_else(|| PoWResponseUnion::default_instance()) - } + // required .CryptoResponseUnion crypto_response = 30; - fn get_pow_response_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.pow_response - } - fn mut_pow_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.pow_response + pub fn get_crypto_response(&self) -> &CryptoResponseUnion { + self.crypto_response.as_ref().unwrap_or_else(|| CryptoResponseUnion::default_instance()) } - - // required .CryptoResponseUnion crypto_response = 30; - pub fn clear_crypto_response(&mut self) { self.crypto_response.clear(); } @@ -5320,18 +4937,6 @@ impl ClientResponsePlaintext { pub fn take_crypto_response(&mut self) -> CryptoResponseUnion { self.crypto_response.take().unwrap_or_else(|| CryptoResponseUnion::new()) } - - pub fn get_crypto_response(&self) -> &CryptoResponseUnion { - self.crypto_response.as_ref().unwrap_or_else(|| CryptoResponseUnion::default_instance()) - } - - fn get_crypto_response_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.crypto_response - } - - fn mut_crypto_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.crypto_response - } } impl ::protobuf::Message for ClientResponsePlaintext { @@ -5437,27 +5042,25 @@ impl ::protobuf::Message for ClientResponsePlaintext { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ClientResponsePlaintext { fn new() -> ClientResponsePlaintext { ClientResponsePlaintext::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5467,18 +5070,18 @@ impl ::protobuf::MessageStatic for ClientResponsePlaintext { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_response", - ClientResponsePlaintext::get_login_crypto_response_for_reflect, - ClientResponsePlaintext::mut_login_crypto_response_for_reflect, + |m: &ClientResponsePlaintext| { &m.login_crypto_response }, + |m: &mut ClientResponsePlaintext| { &mut m.login_crypto_response }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "pow_response", - ClientResponsePlaintext::get_pow_response_for_reflect, - ClientResponsePlaintext::mut_pow_response_for_reflect, + |m: &ClientResponsePlaintext| { &m.pow_response }, + |m: &mut ClientResponsePlaintext| { &mut m.pow_response }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "crypto_response", - ClientResponsePlaintext::get_crypto_response_for_reflect, - ClientResponsePlaintext::mut_crypto_response_for_reflect, + |m: &ClientResponsePlaintext| { &m.crypto_response }, + |m: &mut ClientResponsePlaintext| { &mut m.crypto_response }, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientResponsePlaintext", @@ -5488,13 +5091,23 @@ impl ::protobuf::MessageStatic for ClientResponsePlaintext { }) } } + + fn default_instance() -> &'static ClientResponsePlaintext { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ClientResponsePlaintext, + }; + unsafe { + instance.get(ClientResponsePlaintext::new) + } + } } impl ::protobuf::Clear for ClientResponsePlaintext { fn clear(&mut self) { - self.clear_login_crypto_response(); - self.clear_pow_response(); - self.clear_crypto_response(); + self.login_crypto_response.clear(); + self.pow_response.clear(); + self.crypto_response.clear(); self.unknown_fields.clear(); } } @@ -5516,30 +5129,27 @@ pub struct LoginCryptoResponseUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoResponseUnion {} +impl<'a> ::std::default::Default for &'a LoginCryptoResponseUnion { + fn default() -> &'a LoginCryptoResponseUnion { + ::default_instance() + } +} impl LoginCryptoResponseUnion { pub fn new() -> LoginCryptoResponseUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoResponseUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoResponseUnion, - }; - unsafe { - instance.get(LoginCryptoResponseUnion::new) - } - } - // optional .LoginCryptoDiffieHellmanResponse diffie_hellman = 10; + + pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanResponse { + self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::default_instance()) + } pub fn clear_diffie_hellman(&mut self) { self.diffie_hellman.clear(); } @@ -5566,18 +5176,6 @@ impl LoginCryptoResponseUnion { pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanResponse { self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::new()) } - - pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanResponse { - self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::default_instance()) - } - - fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.diffie_hellman - } - - fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.diffie_hellman - } } impl ::protobuf::Message for LoginCryptoResponseUnion { @@ -5640,27 +5238,25 @@ impl ::protobuf::Message for LoginCryptoResponseUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoResponseUnion { fn new() -> LoginCryptoResponseUnion { LoginCryptoResponseUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5670,8 +5266,8 @@ impl ::protobuf::MessageStatic for LoginCryptoResponseUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoResponseUnion::get_diffie_hellman_for_reflect, - LoginCryptoResponseUnion::mut_diffie_hellman_for_reflect, + |m: &LoginCryptoResponseUnion| { &m.diffie_hellman }, + |m: &mut LoginCryptoResponseUnion| { &mut m.diffie_hellman }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoResponseUnion", @@ -5681,11 +5277,21 @@ impl ::protobuf::MessageStatic for LoginCryptoResponseUnion { }) } } + + fn default_instance() -> &'static LoginCryptoResponseUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoResponseUnion, + }; + unsafe { + instance.get(LoginCryptoResponseUnion::new) + } + } } impl ::protobuf::Clear for LoginCryptoResponseUnion { fn clear(&mut self) { - self.clear_diffie_hellman(); + self.diffie_hellman.clear(); self.unknown_fields.clear(); } } @@ -5707,30 +5313,30 @@ pub struct LoginCryptoDiffieHellmanResponse { // message fields hmac: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for LoginCryptoDiffieHellmanResponse {} +impl<'a> ::std::default::Default for &'a LoginCryptoDiffieHellmanResponse { + fn default() -> &'a LoginCryptoDiffieHellmanResponse { + ::default_instance() + } +} impl LoginCryptoDiffieHellmanResponse { pub fn new() -> LoginCryptoDiffieHellmanResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static LoginCryptoDiffieHellmanResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const LoginCryptoDiffieHellmanResponse, - }; - unsafe { - instance.get(LoginCryptoDiffieHellmanResponse::new) - } - } - // required bytes hmac = 10; + + pub fn get_hmac(&self) -> &[u8] { + match self.hmac.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_hmac(&mut self) { self.hmac.clear(); } @@ -5757,21 +5363,6 @@ impl LoginCryptoDiffieHellmanResponse { pub fn take_hmac(&mut self) -> ::std::vec::Vec { self.hmac.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_hmac(&self) -> &[u8] { - match self.hmac.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_hmac_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.hmac - } - - fn mut_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.hmac - } } impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { @@ -5829,27 +5420,25 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanResponse { fn new() -> LoginCryptoDiffieHellmanResponse { LoginCryptoDiffieHellmanResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5859,8 +5448,8 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hmac", - LoginCryptoDiffieHellmanResponse::get_hmac_for_reflect, - LoginCryptoDiffieHellmanResponse::mut_hmac_for_reflect, + |m: &LoginCryptoDiffieHellmanResponse| { &m.hmac }, + |m: &mut LoginCryptoDiffieHellmanResponse| { &mut m.hmac }, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanResponse", @@ -5870,11 +5459,21 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanResponse { }) } } + + fn default_instance() -> &'static LoginCryptoDiffieHellmanResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const LoginCryptoDiffieHellmanResponse, + }; + unsafe { + instance.get(LoginCryptoDiffieHellmanResponse::new) + } + } } impl ::protobuf::Clear for LoginCryptoDiffieHellmanResponse { fn clear(&mut self) { - self.clear_hmac(); + self.hmac.clear(); self.unknown_fields.clear(); } } @@ -5896,30 +5495,27 @@ pub struct PoWResponseUnion { // message fields hash_cash: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PoWResponseUnion {} +impl<'a> ::std::default::Default for &'a PoWResponseUnion { + fn default() -> &'a PoWResponseUnion { + ::default_instance() + } +} impl PoWResponseUnion { pub fn new() -> PoWResponseUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static PoWResponseUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PoWResponseUnion, - }; - unsafe { - instance.get(PoWResponseUnion::new) - } - } - // optional .PoWHashCashResponse hash_cash = 10; + + pub fn get_hash_cash(&self) -> &PoWHashCashResponse { + self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashResponse::default_instance()) + } pub fn clear_hash_cash(&mut self) { self.hash_cash.clear(); } @@ -5946,18 +5542,6 @@ impl PoWResponseUnion { pub fn take_hash_cash(&mut self) -> PoWHashCashResponse { self.hash_cash.take().unwrap_or_else(|| PoWHashCashResponse::new()) } - - pub fn get_hash_cash(&self) -> &PoWHashCashResponse { - self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashResponse::default_instance()) - } - - fn get_hash_cash_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.hash_cash - } - - fn mut_hash_cash_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.hash_cash - } } impl ::protobuf::Message for PoWResponseUnion { @@ -6020,27 +5604,25 @@ impl ::protobuf::Message for PoWResponseUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PoWResponseUnion { fn new() -> PoWResponseUnion { PoWResponseUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6050,8 +5632,8 @@ impl ::protobuf::MessageStatic for PoWResponseUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hash_cash", - PoWResponseUnion::get_hash_cash_for_reflect, - PoWResponseUnion::mut_hash_cash_for_reflect, + |m: &PoWResponseUnion| { &m.hash_cash }, + |m: &mut PoWResponseUnion| { &mut m.hash_cash }, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWResponseUnion", @@ -6061,11 +5643,21 @@ impl ::protobuf::MessageStatic for PoWResponseUnion { }) } } + + fn default_instance() -> &'static PoWResponseUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PoWResponseUnion, + }; + unsafe { + instance.get(PoWResponseUnion::new) + } + } } impl ::protobuf::Clear for PoWResponseUnion { fn clear(&mut self) { - self.clear_hash_cash(); + self.hash_cash.clear(); self.unknown_fields.clear(); } } @@ -6087,30 +5679,30 @@ pub struct PoWHashCashResponse { // message fields hash_suffix: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for PoWHashCashResponse {} +impl<'a> ::std::default::Default for &'a PoWHashCashResponse { + fn default() -> &'a PoWHashCashResponse { + ::default_instance() + } +} impl PoWHashCashResponse { pub fn new() -> PoWHashCashResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static PoWHashCashResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PoWHashCashResponse, - }; - unsafe { - instance.get(PoWHashCashResponse::new) - } - } - // required bytes hash_suffix = 10; + + pub fn get_hash_suffix(&self) -> &[u8] { + match self.hash_suffix.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_hash_suffix(&mut self) { self.hash_suffix.clear(); } @@ -6137,21 +5729,6 @@ impl PoWHashCashResponse { pub fn take_hash_suffix(&mut self) -> ::std::vec::Vec { self.hash_suffix.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_hash_suffix(&self) -> &[u8] { - match self.hash_suffix.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_hash_suffix_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.hash_suffix - } - - fn mut_hash_suffix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.hash_suffix - } } impl ::protobuf::Message for PoWHashCashResponse { @@ -6209,27 +5786,25 @@ impl ::protobuf::Message for PoWHashCashResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for PoWHashCashResponse { fn new() -> PoWHashCashResponse { PoWHashCashResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6239,8 +5814,8 @@ impl ::protobuf::MessageStatic for PoWHashCashResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hash_suffix", - PoWHashCashResponse::get_hash_suffix_for_reflect, - PoWHashCashResponse::mut_hash_suffix_for_reflect, + |m: &PoWHashCashResponse| { &m.hash_suffix }, + |m: &mut PoWHashCashResponse| { &mut m.hash_suffix }, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWHashCashResponse", @@ -6250,11 +5825,21 @@ impl ::protobuf::MessageStatic for PoWHashCashResponse { }) } } + + fn default_instance() -> &'static PoWHashCashResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PoWHashCashResponse, + }; + unsafe { + instance.get(PoWHashCashResponse::new) + } + } } impl ::protobuf::Clear for PoWHashCashResponse { fn clear(&mut self) { - self.clear_hash_suffix(); + self.hash_suffix.clear(); self.unknown_fields.clear(); } } @@ -6277,30 +5862,27 @@ pub struct CryptoResponseUnion { shannon: ::protobuf::SingularPtrField, rc4_sha1_hmac: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoResponseUnion {} +impl<'a> ::std::default::Default for &'a CryptoResponseUnion { + fn default() -> &'a CryptoResponseUnion { + ::default_instance() + } +} impl CryptoResponseUnion { pub fn new() -> CryptoResponseUnion { ::std::default::Default::default() } - pub fn default_instance() -> &'static CryptoResponseUnion { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoResponseUnion, - }; - unsafe { - instance.get(CryptoResponseUnion::new) - } - } - // optional .CryptoShannonResponse shannon = 10; + + pub fn get_shannon(&self) -> &CryptoShannonResponse { + self.shannon.as_ref().unwrap_or_else(|| CryptoShannonResponse::default_instance()) + } pub fn clear_shannon(&mut self) { self.shannon.clear(); } @@ -6328,20 +5910,12 @@ impl CryptoResponseUnion { self.shannon.take().unwrap_or_else(|| CryptoShannonResponse::new()) } - pub fn get_shannon(&self) -> &CryptoShannonResponse { - self.shannon.as_ref().unwrap_or_else(|| CryptoShannonResponse::default_instance()) - } + // optional .CryptoRc4Sha1HmacResponse rc4_sha1_hmac = 20; - fn get_shannon_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.shannon - } - fn mut_shannon_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.shannon + pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacResponse { + self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::default_instance()) } - - // optional .CryptoRc4Sha1HmacResponse rc4_sha1_hmac = 20; - pub fn clear_rc4_sha1_hmac(&mut self) { self.rc4_sha1_hmac.clear(); } @@ -6368,18 +5942,6 @@ impl CryptoResponseUnion { pub fn take_rc4_sha1_hmac(&mut self) -> CryptoRc4Sha1HmacResponse { self.rc4_sha1_hmac.take().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::new()) } - - pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacResponse { - self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::default_instance()) - } - - fn get_rc4_sha1_hmac_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.rc4_sha1_hmac - } - - fn mut_rc4_sha1_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.rc4_sha1_hmac - } } impl ::protobuf::Message for CryptoResponseUnion { @@ -6459,27 +6021,25 @@ impl ::protobuf::Message for CryptoResponseUnion { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoResponseUnion { fn new() -> CryptoResponseUnion { CryptoResponseUnion::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6489,13 +6049,13 @@ impl ::protobuf::MessageStatic for CryptoResponseUnion { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "shannon", - CryptoResponseUnion::get_shannon_for_reflect, - CryptoResponseUnion::mut_shannon_for_reflect, + |m: &CryptoResponseUnion| { &m.shannon }, + |m: &mut CryptoResponseUnion| { &mut m.shannon }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "rc4_sha1_hmac", - CryptoResponseUnion::get_rc4_sha1_hmac_for_reflect, - CryptoResponseUnion::mut_rc4_sha1_hmac_for_reflect, + |m: &CryptoResponseUnion| { &m.rc4_sha1_hmac }, + |m: &mut CryptoResponseUnion| { &mut m.rc4_sha1_hmac }, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoResponseUnion", @@ -6505,12 +6065,22 @@ impl ::protobuf::MessageStatic for CryptoResponseUnion { }) } } + + fn default_instance() -> &'static CryptoResponseUnion { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoResponseUnion, + }; + unsafe { + instance.get(CryptoResponseUnion::new) + } + } } impl ::protobuf::Clear for CryptoResponseUnion { fn clear(&mut self) { - self.clear_shannon(); - self.clear_rc4_sha1_hmac(); + self.shannon.clear(); + self.rc4_sha1_hmac.clear(); self.unknown_fields.clear(); } } @@ -6532,30 +6102,27 @@ pub struct CryptoShannonResponse { // message fields dummy: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoShannonResponse {} +impl<'a> ::std::default::Default for &'a CryptoShannonResponse { + fn default() -> &'a CryptoShannonResponse { + ::default_instance() + } +} impl CryptoShannonResponse { pub fn new() -> CryptoShannonResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static CryptoShannonResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoShannonResponse, - }; - unsafe { - instance.get(CryptoShannonResponse::new) - } - } - // optional int32 dummy = 1; + + pub fn get_dummy(&self) -> i32 { + self.dummy.unwrap_or(0) + } pub fn clear_dummy(&mut self) { self.dummy = ::std::option::Option::None; } @@ -6568,18 +6135,6 @@ impl CryptoShannonResponse { pub fn set_dummy(&mut self, v: i32) { self.dummy = ::std::option::Option::Some(v); } - - pub fn get_dummy(&self) -> i32 { - self.dummy.unwrap_or(0) - } - - fn get_dummy_for_reflect(&self) -> &::std::option::Option { - &self.dummy - } - - fn mut_dummy_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.dummy - } } impl ::protobuf::Message for CryptoShannonResponse { @@ -6638,27 +6193,25 @@ impl ::protobuf::Message for CryptoShannonResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoShannonResponse { fn new() -> CryptoShannonResponse { CryptoShannonResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6668,8 +6221,8 @@ impl ::protobuf::MessageStatic for CryptoShannonResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "dummy", - CryptoShannonResponse::get_dummy_for_reflect, - CryptoShannonResponse::mut_dummy_for_reflect, + |m: &CryptoShannonResponse| { &m.dummy }, + |m: &mut CryptoShannonResponse| { &mut m.dummy }, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoShannonResponse", @@ -6679,11 +6232,21 @@ impl ::protobuf::MessageStatic for CryptoShannonResponse { }) } } + + fn default_instance() -> &'static CryptoShannonResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoShannonResponse, + }; + unsafe { + instance.get(CryptoShannonResponse::new) + } + } } impl ::protobuf::Clear for CryptoShannonResponse { fn clear(&mut self) { - self.clear_dummy(); + self.dummy = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -6705,30 +6268,27 @@ pub struct CryptoRc4Sha1HmacResponse { // message fields dummy: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for CryptoRc4Sha1HmacResponse {} +impl<'a> ::std::default::Default for &'a CryptoRc4Sha1HmacResponse { + fn default() -> &'a CryptoRc4Sha1HmacResponse { + ::default_instance() + } +} impl CryptoRc4Sha1HmacResponse { pub fn new() -> CryptoRc4Sha1HmacResponse { ::std::default::Default::default() } - pub fn default_instance() -> &'static CryptoRc4Sha1HmacResponse { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const CryptoRc4Sha1HmacResponse, - }; - unsafe { - instance.get(CryptoRc4Sha1HmacResponse::new) - } - } - // optional int32 dummy = 1; + + pub fn get_dummy(&self) -> i32 { + self.dummy.unwrap_or(0) + } pub fn clear_dummy(&mut self) { self.dummy = ::std::option::Option::None; } @@ -6741,18 +6301,6 @@ impl CryptoRc4Sha1HmacResponse { pub fn set_dummy(&mut self, v: i32) { self.dummy = ::std::option::Option::Some(v); } - - pub fn get_dummy(&self) -> i32 { - self.dummy.unwrap_or(0) - } - - fn get_dummy_for_reflect(&self) -> &::std::option::Option { - &self.dummy - } - - fn mut_dummy_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.dummy - } } impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { @@ -6811,27 +6359,25 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacResponse { fn new() -> CryptoRc4Sha1HmacResponse { CryptoRc4Sha1HmacResponse::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6841,8 +6387,8 @@ impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacResponse { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "dummy", - CryptoRc4Sha1HmacResponse::get_dummy_for_reflect, - CryptoRc4Sha1HmacResponse::mut_dummy_for_reflect, + |m: &CryptoRc4Sha1HmacResponse| { &m.dummy }, + |m: &mut CryptoRc4Sha1HmacResponse| { &mut m.dummy }, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoRc4Sha1HmacResponse", @@ -6852,11 +6398,21 @@ impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacResponse { }) } } + + fn default_instance() -> &'static CryptoRc4Sha1HmacResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const CryptoRc4Sha1HmacResponse, + }; + unsafe { + instance.get(CryptoRc4Sha1HmacResponse::new) + } + } } impl ::protobuf::Clear for CryptoRc4Sha1HmacResponse { fn clear(&mut self) { - self.clear_dummy(); + self.dummy = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -6909,7 +6465,7 @@ impl ::protobuf::ProtobufEnum for Product { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -6925,6 +6481,12 @@ impl ::protobuf::ProtobufEnum for Product { impl ::std::marker::Copy for Product { } +impl ::std::default::Default for Product { + fn default() -> Self { + Product::PRODUCT_CLIENT + } +} + impl ::protobuf::reflect::ProtobufValue for Product { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -6958,7 +6520,7 @@ impl ::protobuf::ProtobufEnum for ProductFlags { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -6974,6 +6536,12 @@ impl ::protobuf::ProtobufEnum for ProductFlags { impl ::std::marker::Copy for ProductFlags { } +impl ::std::default::Default for ProductFlags { + fn default() -> Self { + ProductFlags::PRODUCT_FLAG_NONE + } +} + impl ::protobuf::reflect::ProtobufValue for ProductFlags { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7073,7 +6641,7 @@ impl ::protobuf::ProtobufEnum for Platform { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -7089,6 +6657,12 @@ impl ::protobuf::ProtobufEnum for Platform { impl ::std::marker::Copy for Platform { } +impl ::std::default::Default for Platform { + fn default() -> Self { + Platform::PLATFORM_WIN32_X86 + } +} + impl ::protobuf::reflect::ProtobufValue for Platform { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7122,7 +6696,7 @@ impl ::protobuf::ProtobufEnum for Fingerprint { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -7138,6 +6712,12 @@ impl ::protobuf::ProtobufEnum for Fingerprint { impl ::std::marker::Copy for Fingerprint { } +impl ::std::default::Default for Fingerprint { + fn default() -> Self { + Fingerprint::FINGERPRINT_GRAIN + } +} + impl ::protobuf::reflect::ProtobufValue for Fingerprint { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7171,7 +6751,7 @@ impl ::protobuf::ProtobufEnum for Cryptosuite { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -7187,6 +6767,12 @@ impl ::protobuf::ProtobufEnum for Cryptosuite { impl ::std::marker::Copy for Cryptosuite { } +impl ::std::default::Default for Cryptosuite { + fn default() -> Self { + Cryptosuite::CRYPTO_SUITE_SHANNON + } +} + impl ::protobuf::reflect::ProtobufValue for Cryptosuite { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7217,7 +6803,7 @@ impl ::protobuf::ProtobufEnum for Powscheme { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -7233,6 +6819,12 @@ impl ::protobuf::ProtobufEnum for Powscheme { impl ::std::marker::Copy for Powscheme { } +impl ::std::default::Default for Powscheme { + fn default() -> Self { + Powscheme::POW_HASH_CASH + } +} + impl ::protobuf::reflect::ProtobufValue for Powscheme { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7293,7 +6885,7 @@ impl ::protobuf::ProtobufEnum for ErrorCode { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -7309,6 +6901,12 @@ impl ::protobuf::ProtobufEnum for ErrorCode { impl ::std::marker::Copy for ErrorCode { } +impl ::std::default::Default for ErrorCode { + fn default() -> Self { + ErrorCode::ProtocolError + } +} + impl ::protobuf::reflect::ProtobufValue for ErrorCode { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -7316,436 +6914,97 @@ impl ::protobuf::reflect::ProtobufValue for ErrorCode { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x11keyexchange.proto\"\xb2\x03\n\x0bClientHello\x12)\n\nbuild_info\ - \x18\n\x20\x02(\x0b2\n.BuildInfoR\tbuildInfo\x12C\n\x16fingerprints_supp\ - orted\x18\x14\x20\x03(\x0e2\x0c.FingerprintR\x15fingerprintsSupported\ - \x12C\n\x16cryptosuites_supported\x18\x1e\x20\x03(\x0e2\x0c.CryptosuiteR\ - \x15cryptosuitesSupported\x12=\n\x14powschemes_supported\x18(\x20\x03(\ - \x0e2\n.PowschemeR\x13powschemesSupported\x12D\n\x12login_crypto_hello\ - \x182\x20\x02(\x0b2\x16.LoginCryptoHelloUnionR\x10loginCryptoHello\x12!\ - \n\x0cclient_nonce\x18<\x20\x02(\x0cR\x0bclientNonce\x12\x18\n\x07paddin\ - g\x18F\x20\x01(\x0cR\x07padding\x12,\n\x0bfeature_set\x18P\x20\x01(\x0b2\ - \x0b.FeatureSetR\nfeatureSet\"\xa4\x01\n\tBuildInfo\x12\"\n\x07product\ - \x18\n\x20\x02(\x0e2\x08.ProductR\x07product\x122\n\rproduct_flags\x18\ - \x14\x20\x03(\x0e2\r.ProductFlagsR\x0cproductFlags\x12%\n\x08platform\ - \x18\x1e\x20\x02(\x0e2\t.PlatformR\x08platform\x12\x18\n\x07version\x18(\ - \x20\x02(\x04R\x07version\"^\n\x15LoginCryptoHelloUnion\x12E\n\x0ediffie\ - _hellman\x18\n\x20\x01(\x0b2\x1e.LoginCryptoDiffieHellmanHelloR\rdiffieH\ - ellman\"[\n\x1dLoginCryptoDiffieHellmanHello\x12\x0e\n\x02gc\x18\n\x20\ - \x02(\x0cR\x02gc\x12*\n\x11server_keys_known\x18\x14\x20\x02(\rR\x0fserv\ - erKeysKnown\"Y\n\nFeatureSet\x12\x20\n\x0bautoupdate2\x18\x01\x20\x01(\ - \x08R\x0bautoupdate2\x12)\n\x10current_location\x18\x02\x20\x01(\x08R\ - \x0fcurrentLocation\"\xa5\x01\n\x11APResponseMessage\x12*\n\tchallenge\ - \x18\n\x20\x01(\x0b2\x0c.APChallengeR\tchallenge\x121\n\x07upgrade\x18\ - \x14\x20\x01(\x0b2\x17.UpgradeRequiredMessageR\x07upgrade\x121\n\x0clogi\ - n_failed\x18\x1e\x20\x01(\x0b2\x0e.APLoginFailedR\x0bloginFailed\"\xe8\ - \x02\n\x0bAPChallenge\x12P\n\x16login_crypto_challenge\x18\n\x20\x02(\ - \x0b2\x1a.LoginCryptoChallengeUnionR\x14loginCryptoChallenge\x12O\n\x15f\ - ingerprint_challenge\x18\x14\x20\x02(\x0b2\x1a.FingerprintChallengeUnion\ - R\x14fingerprintChallenge\x127\n\rpow_challenge\x18\x1e\x20\x02(\x0b2\ - \x12.PoWChallengeUnionR\x0cpowChallenge\x12@\n\x10crypto_challenge\x18(\ - \x20\x02(\x0b2\x15.CryptoChallengeUnionR\x0fcryptoChallenge\x12!\n\x0cse\ - rver_nonce\x182\x20\x02(\x0cR\x0bserverNonce\x12\x18\n\x07padding\x18<\ - \x20\x01(\x0cR\x07padding\"f\n\x19LoginCryptoChallengeUnion\x12I\n\x0edi\ - ffie_hellman\x18\n\x20\x01(\x0b2\".LoginCryptoDiffieHellmanChallengeR\rd\ - iffieHellman\"\x88\x01\n!LoginCryptoDiffieHellmanChallenge\x12\x0e\n\x02\ - gs\x18\n\x20\x02(\x0cR\x02gs\x120\n\x14server_signature_key\x18\x14\x20\ - \x02(\x05R\x12serverSignatureKey\x12!\n\x0cgs_signature\x18\x1e\x20\x02(\ - \x0cR\x0bgsSignature\"\x8f\x01\n\x19FingerprintChallengeUnion\x120\n\x05\ - grain\x18\n\x20\x01(\x0b2\x1a.FingerprintGrainChallengeR\x05grain\x12@\n\ - \x0bhmac_ripemd\x18\x14\x20\x01(\x0b2\x1f.FingerprintHmacRipemdChallenge\ - R\nhmacRipemd\"-\n\x19FingerprintGrainChallenge\x12\x10\n\x03kek\x18\n\ - \x20\x02(\x0cR\x03kek\">\n\x1eFingerprintHmacRipemdChallenge\x12\x1c\n\t\ - challenge\x18\n\x20\x02(\x0cR\tchallenge\"G\n\x11PoWChallengeUnion\x122\ - \n\thash_cash\x18\n\x20\x01(\x0b2\x15.PoWHashCashChallengeR\x08hashCash\ - \"^\n\x14PoWHashCashChallenge\x12\x16\n\x06prefix\x18\n\x20\x01(\x0cR\ - \x06prefix\x12\x16\n\x06length\x18\x14\x20\x01(\x05R\x06length\x12\x16\n\ - \x06target\x18\x1e\x20\x01(\x05R\x06target\"\x8a\x01\n\x14CryptoChalleng\ - eUnion\x121\n\x07shannon\x18\n\x20\x01(\x0b2\x17.CryptoShannonChallengeR\ - \x07shannon\x12?\n\rrc4_sha1_hmac\x18\x14\x20\x01(\x0b2\x1b.CryptoRc4Sha\ - 1HmacChallengeR\x0brc4Sha1Hmac\"\x18\n\x16CryptoShannonChallenge\"\x1c\n\ - \x1aCryptoRc4Sha1HmacChallenge\"\x87\x01\n\x16UpgradeRequiredMessage\x12\ - .\n\x13upgrade_signed_part\x18\n\x20\x02(\x0cR\x11upgradeSignedPart\x12\ - \x1c\n\tsignature\x18\x14\x20\x02(\x0cR\tsignature\x12\x1f\n\x0bhttp_suf\ - fix\x18\x1e\x20\x01(\tR\nhttpSuffix\"\xa0\x01\n\rAPLoginFailed\x12)\n\ne\ - rror_code\x18\n\x20\x02(\x0e2\n.ErrorCodeR\terrorCode\x12\x1f\n\x0bretry\ - _delay\x18\x14\x20\x01(\x05R\nretryDelay\x12\x16\n\x06expiry\x18\x1e\x20\ - \x01(\x05R\x06expiry\x12+\n\x11error_description\x18(\x20\x01(\tR\x10err\ - orDescription\"\xdd\x01\n\x17ClientResponsePlaintext\x12M\n\x15login_cry\ - pto_response\x18\n\x20\x02(\x0b2\x19.LoginCryptoResponseUnionR\x13loginC\ - ryptoResponse\x124\n\x0cpow_response\x18\x14\x20\x02(\x0b2\x11.PoWRespon\ - seUnionR\x0bpowResponse\x12=\n\x0fcrypto_response\x18\x1e\x20\x02(\x0b2\ - \x14.CryptoResponseUnionR\x0ecryptoResponse\"d\n\x18LoginCryptoResponseU\ - nion\x12H\n\x0ediffie_hellman\x18\n\x20\x01(\x0b2!.LoginCryptoDiffieHell\ - manResponseR\rdiffieHellman\"6\n\x20LoginCryptoDiffieHellmanResponse\x12\ - \x12\n\x04hmac\x18\n\x20\x02(\x0cR\x04hmac\"E\n\x10PoWResponseUnion\x121\ - \n\thash_cash\x18\n\x20\x01(\x0b2\x14.PoWHashCashResponseR\x08hashCash\"\ - 6\n\x13PoWHashCashResponse\x12\x1f\n\x0bhash_suffix\x18\n\x20\x02(\x0cR\ - \nhashSuffix\"\x87\x01\n\x13CryptoResponseUnion\x120\n\x07shannon\x18\n\ - \x20\x01(\x0b2\x16.CryptoShannonResponseR\x07shannon\x12>\n\rrc4_sha1_hm\ - ac\x18\x14\x20\x01(\x0b2\x1a.CryptoRc4Sha1HmacResponseR\x0brc4Sha1Hmac\"\ - -\n\x15CryptoShannonResponse\x12\x14\n\x05dummy\x18\x01\x20\x01(\x05R\ - \x05dummy\"1\n\x19CryptoRc4Sha1HmacResponse\x12\x14\n\x05dummy\x18\x01\ - \x20\x01(\x05R\x05dummy*\x7f\n\x07Product\x12\x12\n\x0ePRODUCT_CLIENT\ - \x10\0\x12\x16\n\x12PRODUCT_LIBSPOTIFY\x10\x01\x12\x12\n\x0ePRODUCT_MOBI\ - LE\x10\x02\x12\x13\n\x0fPRODUCT_PARTNER\x10\x03\x12\x1f\n\x1bPRODUCT_LIB\ - SPOTIFY_EMBEDDED\x10\x05*A\n\x0cProductFlags\x12\x15\n\x11PRODUCT_FLAG_N\ - ONE\x10\0\x12\x1a\n\x16PRODUCT_FLAG_DEV_BUILD\x10\x01*\xdc\x04\n\x08Plat\ - form\x12\x16\n\x12PLATFORM_WIN32_X86\x10\0\x12\x14\n\x10PLATFORM_OSX_X86\ - \x10\x01\x12\x16\n\x12PLATFORM_LINUX_X86\x10\x02\x12\x17\n\x13PLATFORM_I\ - PHONE_ARM\x10\x03\x12\x14\n\x10PLATFORM_S60_ARM\x10\x04\x12\x14\n\x10PLA\ - TFORM_OSX_PPC\x10\x05\x12\x18\n\x14PLATFORM_ANDROID_ARM\x10\x06\x12\x1b\ - \n\x17PLATFORM_WINDOWS_CE_ARM\x10\x07\x12\x19\n\x15PLATFORM_LINUX_X86_64\ - \x10\x08\x12\x17\n\x13PLATFORM_OSX_X86_64\x10\t\x12\x15\n\x11PLATFORM_PA\ - LM_ARM\x10\n\x12\x15\n\x11PLATFORM_LINUX_SH\x10\x0b\x12\x18\n\x14PLATFOR\ - M_FREEBSD_X86\x10\x0c\x12\x1b\n\x17PLATFORM_FREEBSD_X86_64\x10\r\x12\x1b\ - \n\x17PLATFORM_BLACKBERRY_ARM\x10\x0e\x12\x12\n\x0ePLATFORM_SONOS\x10\ - \x0f\x12\x17\n\x13PLATFORM_LINUX_MIPS\x10\x10\x12\x16\n\x12PLATFORM_LINU\ - X_ARM\x10\x11\x12\x19\n\x15PLATFORM_LOGITECH_ARM\x10\x12\x12\x1b\n\x17PL\ - ATFORM_LINUX_BLACKFIN\x10\x13\x12\x14\n\x10PLATFORM_WP7_ARM\x10\x14\x12\ - \x16\n\x12PLATFORM_ONKYO_ARM\x10\x15\x12\x17\n\x13PLATFORM_QNXNTO_ARM\ - \x10\x16\x12\x14\n\x10PLATFORM_BCO_ARM\x10\x17*A\n\x0bFingerprint\x12\ - \x15\n\x11FINGERPRINT_GRAIN\x10\0\x12\x1b\n\x17FINGERPRINT_HMAC_RIPEMD\ - \x10\x01*G\n\x0bCryptosuite\x12\x18\n\x14CRYPTO_SUITE_SHANNON\x10\0\x12\ - \x1e\n\x1aCRYPTO_SUITE_RC4_SHA1_HMAC\x10\x01*\x1e\n\tPowscheme\x12\x11\n\ - \rPOW_HASH_CASH\x10\0*\x89\x02\n\tErrorCode\x12\x11\n\rProtocolError\x10\ - \0\x12\x10\n\x0cTryAnotherAP\x10\x02\x12\x13\n\x0fBadConnectionId\x10\ - \x05\x12\x15\n\x11TravelRestriction\x10\t\x12\x1a\n\x16PremiumAccountReq\ - uired\x10\x0b\x12\x12\n\x0eBadCredentials\x10\x0c\x12\x1f\n\x1bCouldNotV\ - alidateCredentials\x10\r\x12\x11\n\rAccountExists\x10\x0e\x12\x1d\n\x19E\ - xtraVerificationRequired\x10\x0f\x12\x11\n\rInvalidAppKey\x10\x10\x12\ - \x15\n\x11ApplicationBanned\x10\x11J\xbd6\n\x07\x12\x05\0\0\xe2\x01\x01\ - \n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x0b\x01\n\ - \n\n\x03\x04\0\x01\x12\x03\x02\x08\x13\n\x0b\n\x04\x04\0\x02\0\x12\x03\ - \x03\x04(\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x04\x0c\n\x0c\n\x05\ - \x04\0\x02\0\x06\x12\x03\x03\r\x16\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\ - \x03\x17!\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03$'\n\x0b\n\x04\x04\0\ - \x02\x01\x12\x03\x04\x047\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x04\x04\ - \x0c\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x04\r\x18\n\x0c\n\x05\x04\0\ - \x02\x01\x01\x12\x03\x04\x19/\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x042\ - 6\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x047\n\x0c\n\x05\x04\0\x02\x02\ - \x04\x12\x03\x05\x04\x0c\n\x0c\n\x05\x04\0\x02\x02\x06\x12\x03\x05\r\x18\ - \n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x19/\n\x0c\n\x05\x04\0\x02\ - \x02\x03\x12\x03\x0526\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x043\n\x0c\ - \n\x05\x04\0\x02\x03\x04\x12\x03\x06\x04\x0c\n\x0c\n\x05\x04\0\x02\x03\ - \x06\x12\x03\x06\r\x16\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06\x17+\n\ - \x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x06.2\n\x0b\n\x04\x04\0\x02\x04\x12\ - \x03\x07\x04=\n\x0c\n\x05\x04\0\x02\x04\x04\x12\x03\x07\x04\x0c\n\x0c\n\ - \x05\x04\0\x02\x04\x06\x12\x03\x07\r\"\n\x0c\n\x05\x04\0\x02\x04\x01\x12\ - \x03\x07#5\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x078<\n\x0b\n\x04\x04\0\ - \x02\x05\x12\x03\x08\x04'\n\x0c\n\x05\x04\0\x02\x05\x04\x12\x03\x08\x04\ - \x0c\n\x0c\n\x05\x04\0\x02\x05\x05\x12\x03\x08\r\x12\n\x0c\n\x05\x04\0\ - \x02\x05\x01\x12\x03\x08\x13\x1f\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\ - \x08\"&\n\x0b\n\x04\x04\0\x02\x06\x12\x03\t\x04\"\n\x0c\n\x05\x04\0\x02\ - \x06\x04\x12\x03\t\x04\x0c\n\x0c\n\x05\x04\0\x02\x06\x05\x12\x03\t\r\x12\ - \n\x0c\n\x05\x04\0\x02\x06\x01\x12\x03\t\x13\x1a\n\x0c\n\x05\x04\0\x02\ - \x06\x03\x12\x03\t\x1d!\n\x0b\n\x04\x04\0\x02\x07\x12\x03\n\x04+\n\x0c\n\ - \x05\x04\0\x02\x07\x04\x12\x03\n\x04\x0c\n\x0c\n\x05\x04\0\x02\x07\x06\ - \x12\x03\n\r\x17\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x03\n\x18#\n\x0c\n\ - \x05\x04\0\x02\x07\x03\x12\x03\n&*\n\n\n\x02\x04\x01\x12\x04\x0e\0\x13\ - \x01\n\n\n\x03\x04\x01\x01\x12\x03\x0e\x08\x11\n\x0b\n\x04\x04\x01\x02\0\ - \x12\x03\x0f\x04#\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x0f\x04\x0c\n\ - \x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0f\r\x14\n\x0c\n\x05\x04\x01\x02\0\ - \x01\x12\x03\x0f\x15\x1c\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0f\x1f\"\ - \n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x10\x04/\n\x0c\n\x05\x04\x01\x02\ - \x01\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03\x10\ - \r\x19\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x10\x1a'\n\x0c\n\x05\x04\ - \x01\x02\x01\x03\x12\x03\x10*.\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x11\ - \x04&\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03\x11\x04\x0c\n\x0c\n\x05\ - \x04\x01\x02\x02\x06\x12\x03\x11\r\x15\n\x0c\n\x05\x04\x01\x02\x02\x01\ - \x12\x03\x11\x16\x1e\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x11!%\n\x0b\ - \n\x04\x04\x01\x02\x03\x12\x03\x12\x04#\n\x0c\n\x05\x04\x01\x02\x03\x04\ - \x12\x03\x12\x04\x0c\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\x12\r\x13\n\ - \x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x12\x14\x1b\n\x0c\n\x05\x04\x01\ - \x02\x03\x03\x12\x03\x12\x1e\"\n\n\n\x02\x05\0\x12\x04\x15\0\x1b\x01\n\n\ - \n\x03\x05\0\x01\x12\x03\x15\x05\x0c\n\x0b\n\x04\x05\0\x02\0\x12\x03\x16\ - \x04\x19\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x16\x04\x12\n\x0c\n\x05\x05\ - \0\x02\0\x02\x12\x03\x16\x15\x18\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x17\ - \x04\x1c\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x17\x04\x16\n\x0c\n\x05\ - \x05\0\x02\x01\x02\x12\x03\x17\x18\x1b\n\x0b\n\x04\x05\0\x02\x02\x12\x03\ - \x18\x04\x19\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x18\x04\x12\n\x0c\n\ - \x05\x05\0\x02\x02\x02\x12\x03\x18\x15\x18\n\x0b\n\x04\x05\0\x02\x03\x12\ - \x03\x19\x04\x1a\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x19\x04\x13\n\x0c\ - \n\x05\x05\0\x02\x03\x02\x12\x03\x19\x16\x19\n\x0b\n\x04\x05\0\x02\x04\ - \x12\x03\x1a\x04&\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x1a\x04\x1f\n\ - \x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x1a\"%\n\n\n\x02\x05\x01\x12\x04\ - \x1d\0\x20\x01\n\n\n\x03\x05\x01\x01\x12\x03\x1d\x05\x11\n\x0b\n\x04\x05\ - \x01\x02\0\x12\x03\x1e\x04\x1c\n\x0c\n\x05\x05\x01\x02\0\x01\x12\x03\x1e\ - \x04\x15\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03\x1e\x18\x1b\n\x0b\n\x04\ - \x05\x01\x02\x01\x12\x03\x1f\x04!\n\x0c\n\x05\x05\x01\x02\x01\x01\x12\ - \x03\x1f\x04\x1a\n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03\x1f\x1d\x20\n\n\ - \n\x02\x05\x02\x12\x04\"\0;\x01\n\n\n\x03\x05\x02\x01\x12\x03\"\x05\r\n\ - \x0b\n\x04\x05\x02\x02\0\x12\x03#\x04\x1d\n\x0c\n\x05\x05\x02\x02\0\x01\ - \x12\x03#\x04\x16\n\x0c\n\x05\x05\x02\x02\0\x02\x12\x03#\x19\x1c\n\x0b\n\ - \x04\x05\x02\x02\x01\x12\x03$\x04\x1b\n\x0c\n\x05\x05\x02\x02\x01\x01\ - \x12\x03$\x04\x14\n\x0c\n\x05\x05\x02\x02\x01\x02\x12\x03$\x17\x1a\n\x0b\ - \n\x04\x05\x02\x02\x02\x12\x03%\x04\x1d\n\x0c\n\x05\x05\x02\x02\x02\x01\ - \x12\x03%\x04\x16\n\x0c\n\x05\x05\x02\x02\x02\x02\x12\x03%\x19\x1c\n\x0b\ - \n\x04\x05\x02\x02\x03\x12\x03&\x04\x1e\n\x0c\n\x05\x05\x02\x02\x03\x01\ - \x12\x03&\x04\x17\n\x0c\n\x05\x05\x02\x02\x03\x02\x12\x03&\x1a\x1d\n\x0b\ - \n\x04\x05\x02\x02\x04\x12\x03'\x04\x1b\n\x0c\n\x05\x05\x02\x02\x04\x01\ - \x12\x03'\x04\x14\n\x0c\n\x05\x05\x02\x02\x04\x02\x12\x03'\x17\x1a\n\x0b\ - \n\x04\x05\x02\x02\x05\x12\x03(\x04\x1b\n\x0c\n\x05\x05\x02\x02\x05\x01\ - \x12\x03(\x04\x14\n\x0c\n\x05\x05\x02\x02\x05\x02\x12\x03(\x17\x1a\n\x0b\ - \n\x04\x05\x02\x02\x06\x12\x03)\x04\x1f\n\x0c\n\x05\x05\x02\x02\x06\x01\ - \x12\x03)\x04\x18\n\x0c\n\x05\x05\x02\x02\x06\x02\x12\x03)\x1b\x1e\n\x0b\ - \n\x04\x05\x02\x02\x07\x12\x03*\x04\"\n\x0c\n\x05\x05\x02\x02\x07\x01\ - \x12\x03*\x04\x1b\n\x0c\n\x05\x05\x02\x02\x07\x02\x12\x03*\x1e!\n\x0b\n\ - \x04\x05\x02\x02\x08\x12\x03+\x04\x20\n\x0c\n\x05\x05\x02\x02\x08\x01\ - \x12\x03+\x04\x19\n\x0c\n\x05\x05\x02\x02\x08\x02\x12\x03+\x1c\x1f\n\x0b\ - \n\x04\x05\x02\x02\t\x12\x03,\x04\x1e\n\x0c\n\x05\x05\x02\x02\t\x01\x12\ - \x03,\x04\x17\n\x0c\n\x05\x05\x02\x02\t\x02\x12\x03,\x1a\x1d\n\x0b\n\x04\ - \x05\x02\x02\n\x12\x03-\x04\x1c\n\x0c\n\x05\x05\x02\x02\n\x01\x12\x03-\ - \x04\x15\n\x0c\n\x05\x05\x02\x02\n\x02\x12\x03-\x18\x1b\n\x0b\n\x04\x05\ - \x02\x02\x0b\x12\x03.\x04\x1c\n\x0c\n\x05\x05\x02\x02\x0b\x01\x12\x03.\ - \x04\x15\n\x0c\n\x05\x05\x02\x02\x0b\x02\x12\x03.\x18\x1b\n\x0b\n\x04\ - \x05\x02\x02\x0c\x12\x03/\x04\x1f\n\x0c\n\x05\x05\x02\x02\x0c\x01\x12\ - \x03/\x04\x18\n\x0c\n\x05\x05\x02\x02\x0c\x02\x12\x03/\x1b\x1e\n\x0b\n\ - \x04\x05\x02\x02\r\x12\x030\x04\"\n\x0c\n\x05\x05\x02\x02\r\x01\x12\x030\ - \x04\x1b\n\x0c\n\x05\x05\x02\x02\r\x02\x12\x030\x1e!\n\x0b\n\x04\x05\x02\ - \x02\x0e\x12\x031\x04\"\n\x0c\n\x05\x05\x02\x02\x0e\x01\x12\x031\x04\x1b\ - \n\x0c\n\x05\x05\x02\x02\x0e\x02\x12\x031\x1e!\n\x0b\n\x04\x05\x02\x02\ - \x0f\x12\x032\x04\x19\n\x0c\n\x05\x05\x02\x02\x0f\x01\x12\x032\x04\x12\n\ - \x0c\n\x05\x05\x02\x02\x0f\x02\x12\x032\x15\x18\n\x0b\n\x04\x05\x02\x02\ - \x10\x12\x033\x04\x1f\n\x0c\n\x05\x05\x02\x02\x10\x01\x12\x033\x04\x17\n\ - \x0c\n\x05\x05\x02\x02\x10\x02\x12\x033\x1a\x1e\n\x0b\n\x04\x05\x02\x02\ - \x11\x12\x034\x04\x1e\n\x0c\n\x05\x05\x02\x02\x11\x01\x12\x034\x04\x16\n\ - \x0c\n\x05\x05\x02\x02\x11\x02\x12\x034\x19\x1d\n\x0b\n\x04\x05\x02\x02\ - \x12\x12\x035\x04!\n\x0c\n\x05\x05\x02\x02\x12\x01\x12\x035\x04\x19\n\ - \x0c\n\x05\x05\x02\x02\x12\x02\x12\x035\x1c\x20\n\x0b\n\x04\x05\x02\x02\ - \x13\x12\x036\x04#\n\x0c\n\x05\x05\x02\x02\x13\x01\x12\x036\x04\x1b\n\ - \x0c\n\x05\x05\x02\x02\x13\x02\x12\x036\x1e\"\n\x0b\n\x04\x05\x02\x02\ - \x14\x12\x037\x04\x1c\n\x0c\n\x05\x05\x02\x02\x14\x01\x12\x037\x04\x14\n\ - \x0c\n\x05\x05\x02\x02\x14\x02\x12\x037\x17\x1b\n\x0b\n\x04\x05\x02\x02\ - \x15\x12\x038\x04\x1e\n\x0c\n\x05\x05\x02\x02\x15\x01\x12\x038\x04\x16\n\ - \x0c\n\x05\x05\x02\x02\x15\x02\x12\x038\x19\x1d\n\x0b\n\x04\x05\x02\x02\ - \x16\x12\x039\x04\x1f\n\x0c\n\x05\x05\x02\x02\x16\x01\x12\x039\x04\x17\n\ - \x0c\n\x05\x05\x02\x02\x16\x02\x12\x039\x1a\x1e\n\x0b\n\x04\x05\x02\x02\ - \x17\x12\x03:\x04\x1c\n\x0c\n\x05\x05\x02\x02\x17\x01\x12\x03:\x04\x14\n\ - \x0c\n\x05\x05\x02\x02\x17\x02\x12\x03:\x17\x1b\n\n\n\x02\x05\x03\x12\ - \x04=\0@\x01\n\n\n\x03\x05\x03\x01\x12\x03=\x05\x10\n\x0b\n\x04\x05\x03\ - \x02\0\x12\x03>\x04\x1c\n\x0c\n\x05\x05\x03\x02\0\x01\x12\x03>\x04\x15\n\ - \x0c\n\x05\x05\x03\x02\0\x02\x12\x03>\x18\x1b\n\x0b\n\x04\x05\x03\x02\ - \x01\x12\x03?\x04\"\n\x0c\n\x05\x05\x03\x02\x01\x01\x12\x03?\x04\x1b\n\ - \x0c\n\x05\x05\x03\x02\x01\x02\x12\x03?\x1e!\n\n\n\x02\x05\x04\x12\x04B\ - \0E\x01\n\n\n\x03\x05\x04\x01\x12\x03B\x05\x10\n\x0b\n\x04\x05\x04\x02\0\ - \x12\x03C\x04\x1f\n\x0c\n\x05\x05\x04\x02\0\x01\x12\x03C\x04\x18\n\x0c\n\ - \x05\x05\x04\x02\0\x02\x12\x03C\x1b\x1e\n\x0b\n\x04\x05\x04\x02\x01\x12\ - \x03D\x04%\n\x0c\n\x05\x05\x04\x02\x01\x01\x12\x03D\x04\x1e\n\x0c\n\x05\ - \x05\x04\x02\x01\x02\x12\x03D!$\n\n\n\x02\x05\x05\x12\x04G\0I\x01\n\n\n\ - \x03\x05\x05\x01\x12\x03G\x05\x0e\n\x0b\n\x04\x05\x05\x02\0\x12\x03H\x04\ - \x18\n\x0c\n\x05\x05\x05\x02\0\x01\x12\x03H\x04\x11\n\x0c\n\x05\x05\x05\ - \x02\0\x02\x12\x03H\x14\x17\n\n\n\x02\x04\x02\x12\x04L\0N\x01\n\n\n\x03\ - \x04\x02\x01\x12\x03L\x08\x1d\n\x0b\n\x04\x04\x02\x02\0\x12\x03M\x04@\n\ - \x0c\n\x05\x04\x02\x02\0\x04\x12\x03M\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\ - \x06\x12\x03M\r*\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03M+9\n\x0c\n\x05\ - \x04\x02\x02\0\x03\x12\x03M\n\n\n\x02\x04\n\x12\x04|\0~\x01\n\n\n\x03\ - \x04\n\x01\x12\x03|\x08!\n\x0b\n\x04\x04\n\x02\0\x12\x03}\x04\x1d\n\x0c\ - \n\x05\x04\n\x02\0\x04\x12\x03}\x04\x0c\n\x0c\n\x05\x04\n\x02\0\x05\x12\ - \x03}\r\x12\n\x0c\n\x05\x04\n\x02\0\x01\x12\x03}\x13\x16\n\x0c\n\x05\x04\ - \n\x02\0\x03\x12\x03}\x19\x1c\n\x0c\n\x02\x04\x0b\x12\x06\x81\x01\0\x83\ - \x01\x01\n\x0b\n\x03\x04\x0b\x01\x12\x04\x81\x01\x08&\n\x0c\n\x04\x04\ - \x0b\x02\0\x12\x04\x82\x01\x04#\n\r\n\x05\x04\x0b\x02\0\x04\x12\x04\x82\ - \x01\x04\x0c\n\r\n\x05\x04\x0b\x02\0\x05\x12\x04\x82\x01\r\x12\n\r\n\x05\ - \x04\x0b\x02\0\x01\x12\x04\x82\x01\x13\x1c\n\r\n\x05\x04\x0b\x02\0\x03\ - \x12\x04\x82\x01\x1f\"\n\x0c\n\x02\x04\x0c\x12\x06\x86\x01\0\x88\x01\x01\ - \n\x0b\n\x03\x04\x0c\x01\x12\x04\x86\x01\x08\x19\n\x0c\n\x04\x04\x0c\x02\ - \0\x12\x04\x87\x01\x042\n\r\n\x05\x04\x0c\x02\0\x04\x12\x04\x87\x01\x04\ - \x0c\n\r\n\x05\x04\x0c\x02\0\x06\x12\x04\x87\x01\r!\n\r\n\x05\x04\x0c\ - \x02\0\x01\x12\x04\x87\x01\"+\n\r\n\x05\x04\x0c\x02\0\x03\x12\x04\x87\ - \x01.1\n\x0c\n\x02\x04\r\x12\x06\x8a\x01\0\x8e\x01\x01\n\x0b\n\x03\x04\r\ - \x01\x12\x04\x8a\x01\x08\x1c\n\x0c\n\x04\x04\r\x02\0\x12\x04\x8b\x01\x04\ - \x20\n\r\n\x05\x04\r\x02\0\x04\x12\x04\x8b\x01\x04\x0c\n\r\n\x05\x04\r\ - \x02\0\x05\x12\x04\x8b\x01\r\x12\n\r\n\x05\x04\r\x02\0\x01\x12\x04\x8b\ - \x01\x13\x19\n\r\n\x05\x04\r\x02\0\x03\x12\x04\x8b\x01\x1c\x1f\n\x0c\n\ - \x04\x04\r\x02\x01\x12\x04\x8c\x01\x04!\n\r\n\x05\x04\r\x02\x01\x04\x12\ - \x04\x8c\x01\x04\x0c\n\r\n\x05\x04\r\x02\x01\x05\x12\x04\x8c\x01\r\x12\n\ - \r\n\x05\x04\r\x02\x01\x01\x12\x04\x8c\x01\x13\x19\n\r\n\x05\x04\r\x02\ - \x01\x03\x12\x04\x8c\x01\x1c\x20\n\x0c\n\x04\x04\r\x02\x02\x12\x04\x8d\ - \x01\x04!\n\r\n\x05\x04\r\x02\x02\x04\x12\x04\x8d\x01\x04\x0c\n\r\n\x05\ - \x04\r\x02\x02\x05\x12\x04\x8d\x01\r\x12\n\r\n\x05\x04\r\x02\x02\x01\x12\ - \x04\x8d\x01\x13\x19\n\r\n\x05\x04\r\x02\x02\x03\x12\x04\x8d\x01\x1c\x20\ - \n\x0c\n\x02\x04\x0e\x12\x06\x91\x01\0\x94\x01\x01\n\x0b\n\x03\x04\x0e\ - \x01\x12\x04\x91\x01\x08\x1c\n\x0c\n\x04\x04\x0e\x02\0\x12\x04\x92\x01\ - \x042\n\r\n\x05\x04\x0e\x02\0\x04\x12\x04\x92\x01\x04\x0c\n\r\n\x05\x04\ - \x0e\x02\0\x06\x12\x04\x92\x01\r#\n\r\n\x05\x04\x0e\x02\0\x01\x12\x04\ - \x92\x01$+\n\r\n\x05\x04\x0e\x02\0\x03\x12\x04\x92\x01.1\n\x0c\n\x04\x04\ - \x0e\x02\x01\x12\x04\x93\x01\x04=\n\r\n\x05\x04\x0e\x02\x01\x04\x12\x04\ - \x93\x01\x04\x0c\n\r\n\x05\x04\x0e\x02\x01\x06\x12\x04\x93\x01\r'\n\r\n\ - \x05\x04\x0e\x02\x01\x01\x12\x04\x93\x01(5\n\r\n\x05\x04\x0e\x02\x01\x03\ - \x12\x04\x93\x018<\n\x0c\n\x02\x04\x0f\x12\x06\x97\x01\0\x98\x01\x01\n\ - \x0b\n\x03\x04\x0f\x01\x12\x04\x97\x01\x08\x1e\n\x0c\n\x02\x04\x10\x12\ - \x06\x9b\x01\0\x9c\x01\x01\n\x0b\n\x03\x04\x10\x01\x12\x04\x9b\x01\x08\"\ - \n\x0c\n\x02\x04\x11\x12\x06\x9f\x01\0\xa3\x01\x01\n\x0b\n\x03\x04\x11\ - \x01\x12\x04\x9f\x01\x08\x1e\n\x0c\n\x04\x04\x11\x02\0\x12\x04\xa0\x01\ - \x04-\n\r\n\x05\x04\x11\x02\0\x04\x12\x04\xa0\x01\x04\x0c\n\r\n\x05\x04\ - \x11\x02\0\x05\x12\x04\xa0\x01\r\x12\n\r\n\x05\x04\x11\x02\0\x01\x12\x04\ - \xa0\x01\x13&\n\r\n\x05\x04\x11\x02\0\x03\x12\x04\xa0\x01),\n\x0c\n\x04\ - \x04\x11\x02\x01\x12\x04\xa1\x01\x04$\n\r\n\x05\x04\x11\x02\x01\x04\x12\ - \x04\xa1\x01\x04\x0c\n\r\n\x05\x04\x11\x02\x01\x05\x12\x04\xa1\x01\r\x12\ - \n\r\n\x05\x04\x11\x02\x01\x01\x12\x04\xa1\x01\x13\x1c\n\r\n\x05\x04\x11\ - \x02\x01\x03\x12\x04\xa1\x01\x1f#\n\x0c\n\x04\x04\x11\x02\x02\x12\x04\ - \xa2\x01\x04'\n\r\n\x05\x04\x11\x02\x02\x04\x12\x04\xa2\x01\x04\x0c\n\r\ - \n\x05\x04\x11\x02\x02\x05\x12\x04\xa2\x01\r\x13\n\r\n\x05\x04\x11\x02\ - \x02\x01\x12\x04\xa2\x01\x14\x1f\n\r\n\x05\x04\x11\x02\x02\x03\x12\x04\ - \xa2\x01\"&\n\x0c\n\x02\x04\x12\x12\x06\xa5\x01\0\xaa\x01\x01\n\x0b\n\ - \x03\x04\x12\x01\x12\x04\xa5\x01\x08\x15\n\x0c\n\x04\x04\x12\x02\0\x12\ - \x04\xa6\x01\x04(\n\r\n\x05\x04\x12\x02\0\x04\x12\x04\xa6\x01\x04\x0c\n\ - \r\n\x05\x04\x12\x02\0\x06\x12\x04\xa6\x01\r\x16\n\r\n\x05\x04\x12\x02\0\ - \x01\x12\x04\xa6\x01\x17!\n\r\n\x05\x04\x12\x02\0\x03\x12\x04\xa6\x01$'\ - \n\x0c\n\x04\x04\x12\x02\x01\x12\x04\xa7\x01\x04&\n\r\n\x05\x04\x12\x02\ - \x01\x04\x12\x04\xa7\x01\x04\x0c\n\r\n\x05\x04\x12\x02\x01\x05\x12\x04\ - \xa7\x01\r\x12\n\r\n\x05\x04\x12\x02\x01\x01\x12\x04\xa7\x01\x13\x1e\n\r\ - \n\x05\x04\x12\x02\x01\x03\x12\x04\xa7\x01!%\n\x0c\n\x04\x04\x12\x02\x02\ - \x12\x04\xa8\x01\x04!\n\r\n\x05\x04\x12\x02\x02\x04\x12\x04\xa8\x01\x04\ - \x0c\n\r\n\x05\x04\x12\x02\x02\x05\x12\x04\xa8\x01\r\x12\n\r\n\x05\x04\ - \x12\x02\x02\x01\x12\x04\xa8\x01\x13\x19\n\r\n\x05\x04\x12\x02\x02\x03\ - \x12\x04\xa8\x01\x1c\x20\n\x0c\n\x04\x04\x12\x02\x03\x12\x04\xa9\x01\x04\ - -\n\r\n\x05\x04\x12\x02\x03\x04\x12\x04\xa9\x01\x04\x0c\n\r\n\x05\x04\ - \x12\x02\x03\x05\x12\x04\xa9\x01\r\x13\n\r\n\x05\x04\x12\x02\x03\x01\x12\ - \x04\xa9\x01\x14%\n\r\n\x05\x04\x12\x02\x03\x03\x12\x04\xa9\x01(,\n\x0c\ - \n\x02\x05\x06\x12\x06\xac\x01\0\xb8\x01\x01\n\x0b\n\x03\x05\x06\x01\x12\ - \x04\xac\x01\x05\x0e\n\x0c\n\x04\x05\x06\x02\0\x12\x04\xad\x01\x04\x18\n\ - \r\n\x05\x05\x06\x02\0\x01\x12\x04\xad\x01\x04\x11\n\r\n\x05\x05\x06\x02\ - \0\x02\x12\x04\xad\x01\x14\x17\n\x0c\n\x04\x05\x06\x02\x01\x12\x04\xae\ - \x01\x04\x17\n\r\n\x05\x05\x06\x02\x01\x01\x12\x04\xae\x01\x04\x10\n\r\n\ - \x05\x05\x06\x02\x01\x02\x12\x04\xae\x01\x13\x16\n\x0c\n\x04\x05\x06\x02\ - \x02\x12\x04\xaf\x01\x04\x1a\n\r\n\x05\x05\x06\x02\x02\x01\x12\x04\xaf\ - \x01\x04\x13\n\r\n\x05\x05\x06\x02\x02\x02\x12\x04\xaf\x01\x16\x19\n\x0c\ - \n\x04\x05\x06\x02\x03\x12\x04\xb0\x01\x04\x1c\n\r\n\x05\x05\x06\x02\x03\ - \x01\x12\x04\xb0\x01\x04\x15\n\r\n\x05\x05\x06\x02\x03\x02\x12\x04\xb0\ - \x01\x18\x1b\n\x0c\n\x04\x05\x06\x02\x04\x12\x04\xb1\x01\x04!\n\r\n\x05\ - \x05\x06\x02\x04\x01\x12\x04\xb1\x01\x04\x1a\n\r\n\x05\x05\x06\x02\x04\ - \x02\x12\x04\xb1\x01\x1d\x20\n\x0c\n\x04\x05\x06\x02\x05\x12\x04\xb2\x01\ - \x04\x19\n\r\n\x05\x05\x06\x02\x05\x01\x12\x04\xb2\x01\x04\x12\n\r\n\x05\ - \x05\x06\x02\x05\x02\x12\x04\xb2\x01\x15\x18\n\x0c\n\x04\x05\x06\x02\x06\ - \x12\x04\xb3\x01\x04&\n\r\n\x05\x05\x06\x02\x06\x01\x12\x04\xb3\x01\x04\ - \x1f\n\r\n\x05\x05\x06\x02\x06\x02\x12\x04\xb3\x01\"%\n\x0c\n\x04\x05\ - \x06\x02\x07\x12\x04\xb4\x01\x04\x18\n\r\n\x05\x05\x06\x02\x07\x01\x12\ - \x04\xb4\x01\x04\x11\n\r\n\x05\x05\x06\x02\x07\x02\x12\x04\xb4\x01\x14\ - \x17\n\x0c\n\x04\x05\x06\x02\x08\x12\x04\xb5\x01\x04$\n\r\n\x05\x05\x06\ - \x02\x08\x01\x12\x04\xb5\x01\x04\x1d\n\r\n\x05\x05\x06\x02\x08\x02\x12\ - \x04\xb5\x01\x20#\n\x0c\n\x04\x05\x06\x02\t\x12\x04\xb6\x01\x04\x19\n\r\ - \n\x05\x05\x06\x02\t\x01\x12\x04\xb6\x01\x04\x11\n\r\n\x05\x05\x06\x02\t\ - \x02\x12\x04\xb6\x01\x14\x18\n\x0c\n\x04\x05\x06\x02\n\x12\x04\xb7\x01\ - \x04\x1d\n\r\n\x05\x05\x06\x02\n\x01\x12\x04\xb7\x01\x04\x15\n\r\n\x05\ - \x05\x06\x02\n\x02\x12\x04\xb7\x01\x18\x1c\n\x0c\n\x02\x04\x13\x12\x06\ - \xba\x01\0\xbe\x01\x01\n\x0b\n\x03\x04\x13\x01\x12\x04\xba\x01\x08\x1f\n\ - \x0c\n\x04\x04\x13\x02\0\x12\x04\xbb\x01\x04B\n\r\n\x05\x04\x13\x02\0\ - \x04\x12\x04\xbb\x01\x04\x0c\n\r\n\x05\x04\x13\x02\0\x06\x12\x04\xbb\x01\ - \r%\n\r\n\x05\x04\x13\x02\0\x01\x12\x04\xbb\x01&;\n\r\n\x05\x04\x13\x02\ - \0\x03\x12\x04\xbb\x01>A\n\x0c\n\x04\x04\x13\x02\x01\x12\x04\xbc\x01\x04\ - 2\n\r\n\x05\x04\x13\x02\x01\x04\x12\x04\xbc\x01\x04\x0c\n\r\n\x05\x04\ - \x13\x02\x01\x06\x12\x04\xbc\x01\r\x1d\n\r\n\x05\x04\x13\x02\x01\x01\x12\ - \x04\xbc\x01\x1e*\n\r\n\x05\x04\x13\x02\x01\x03\x12\x04\xbc\x01-1\n\x0c\ - \n\x04\x04\x13\x02\x02\x12\x04\xbd\x01\x048\n\r\n\x05\x04\x13\x02\x02\ - \x04\x12\x04\xbd\x01\x04\x0c\n\r\n\x05\x04\x13\x02\x02\x06\x12\x04\xbd\ - \x01\r\x20\n\r\n\x05\x04\x13\x02\x02\x01\x12\x04\xbd\x01!0\n\r\n\x05\x04\ - \x13\x02\x02\x03\x12\x04\xbd\x0137\n\x0c\n\x02\x04\x14\x12\x06\xc1\x01\0\ - \xc3\x01\x01\n\x0b\n\x03\x04\x14\x01\x12\x04\xc1\x01\x08\x20\n\x0c\n\x04\ - \x04\x14\x02\0\x12\x04\xc2\x01\x04C\n\r\n\x05\x04\x14\x02\0\x04\x12\x04\ - \xc2\x01\x04\x0c\n\r\n\x05\x04\x14\x02\0\x06\x12\x04\xc2\x01\r-\n\r\n\ - \x05\x04\x14\x02\0\x01\x12\x04\xc2\x01.<\n\r\n\x05\x04\x14\x02\0\x03\x12\ - \x04\xc2\x01?B\n\x0c\n\x02\x04\x15\x12\x06\xc6\x01\0\xc8\x01\x01\n\x0b\n\ - \x03\x04\x15\x01\x12\x04\xc6\x01\x08(\n\x0c\n\x04\x04\x15\x02\0\x12\x04\ - \xc7\x01\x04\x1e\n\r\n\x05\x04\x15\x02\0\x04\x12\x04\xc7\x01\x04\x0c\n\r\ - \n\x05\x04\x15\x02\0\x05\x12\x04\xc7\x01\r\x12\n\r\n\x05\x04\x15\x02\0\ - \x01\x12\x04\xc7\x01\x13\x17\n\r\n\x05\x04\x15\x02\0\x03\x12\x04\xc7\x01\ - \x1a\x1d\n\x0c\n\x02\x04\x16\x12\x06\xcb\x01\0\xcd\x01\x01\n\x0b\n\x03\ - \x04\x16\x01\x12\x04\xcb\x01\x08\x18\n\x0c\n\x04\x04\x16\x02\0\x12\x04\ - \xcc\x01\x041\n\r\n\x05\x04\x16\x02\0\x04\x12\x04\xcc\x01\x04\x0c\n\r\n\ - \x05\x04\x16\x02\0\x06\x12\x04\xcc\x01\r\x20\n\r\n\x05\x04\x16\x02\0\x01\ - \x12\x04\xcc\x01!*\n\r\n\x05\x04\x16\x02\0\x03\x12\x04\xcc\x01-0\n\x0c\n\ - \x02\x04\x17\x12\x06\xd0\x01\0\xd2\x01\x01\n\x0b\n\x03\x04\x17\x01\x12\ - \x04\xd0\x01\x08\x1b\n\x0c\n\x04\x04\x17\x02\0\x12\x04\xd1\x01\x04%\n\r\ - \n\x05\x04\x17\x02\0\x04\x12\x04\xd1\x01\x04\x0c\n\r\n\x05\x04\x17\x02\0\ - \x05\x12\x04\xd1\x01\r\x12\n\r\n\x05\x04\x17\x02\0\x01\x12\x04\xd1\x01\ - \x13\x1e\n\r\n\x05\x04\x17\x02\0\x03\x12\x04\xd1\x01!$\n\x0c\n\x02\x04\ - \x18\x12\x06\xd5\x01\0\xd8\x01\x01\n\x0b\n\x03\x04\x18\x01\x12\x04\xd5\ - \x01\x08\x1b\n\x0c\n\x04\x04\x18\x02\0\x12\x04\xd6\x01\x041\n\r\n\x05\ - \x04\x18\x02\0\x04\x12\x04\xd6\x01\x04\x0c\n\r\n\x05\x04\x18\x02\0\x06\ - \x12\x04\xd6\x01\r\"\n\r\n\x05\x04\x18\x02\0\x01\x12\x04\xd6\x01#*\n\r\n\ - \x05\x04\x18\x02\0\x03\x12\x04\xd6\x01-0\n\x0c\n\x04\x04\x18\x02\x01\x12\ - \x04\xd7\x01\x04<\n\r\n\x05\x04\x18\x02\x01\x04\x12\x04\xd7\x01\x04\x0c\ - \n\r\n\x05\x04\x18\x02\x01\x06\x12\x04\xd7\x01\r&\n\r\n\x05\x04\x18\x02\ - \x01\x01\x12\x04\xd7\x01'4\n\r\n\x05\x04\x18\x02\x01\x03\x12\x04\xd7\x01\ - 7;\n\x0c\n\x02\x04\x19\x12\x06\xdb\x01\0\xdd\x01\x01\n\x0b\n\x03\x04\x19\ - \x01\x12\x04\xdb\x01\x08\x1d\n\x0c\n\x04\x04\x19\x02\0\x12\x04\xdc\x01\ - \x04\x1f\n\r\n\x05\x04\x19\x02\0\x04\x12\x04\xdc\x01\x04\x0c\n\r\n\x05\ - \x04\x19\x02\0\x05\x12\x04\xdc\x01\r\x12\n\r\n\x05\x04\x19\x02\0\x01\x12\ - \x04\xdc\x01\x13\x18\n\r\n\x05\x04\x19\x02\0\x03\x12\x04\xdc\x01\x1b\x1e\ - \n\x0c\n\x02\x04\x1a\x12\x06\xe0\x01\0\xe2\x01\x01\n\x0b\n\x03\x04\x1a\ - \x01\x12\x04\xe0\x01\x08!\n\x0c\n\x04\x04\x1a\x02\0\x12\x04\xe1\x01\x04\ - \x1f\n\r\n\x05\x04\x1a\x02\0\x04\x12\x04\xe1\x01\x04\x0c\n\r\n\x05\x04\ - \x1a\x02\0\x05\x12\x04\xe1\x01\r\x12\n\r\n\x05\x04\x1a\x02\0\x01\x12\x04\ - \xe1\x01\x13\x18\n\r\n\x05\x04\x1a\x02\0\x03\x12\x04\xe1\x01\x1b\x1e\ + \n\x11keyexchange.proto\x12\0\"\xc2\x02\n\x0bClientHello\x12\x20\n\nbuil\ + d_info\x18\n\x20\x02(\x0b2\n.BuildInfoB\0\x12.\n\x16fingerprints_support\ + ed\x18\x14\x20\x03(\x0e2\x0c.FingerprintB\0\x12.\n\x16cryptosuites_suppo\ + rted\x18\x1e\x20\x03(\x0e2\x0c.CryptosuiteB\0\x12*\n\x14powschemes_suppo\ + rted\x18(\x20\x03(\x0e2\n.PowschemeB\0\x124\n\x12login_crypto_hello\x182\ + \x20\x02(\x0b2\x16.LoginCryptoHelloUnionB\0\x12\x16\n\x0cclient_nonce\ + \x18<\x20\x02(\x0cB\0\x12\x11\n\x07padding\x18F\x20\x01(\x0cB\0\x12\"\n\ + \x0bfeature_set\x18P\x20\x01(\x0b2\x0b.FeatureSetB\0:\0\"\x84\x01\n\tBui\ + ldInfo\x12\x1b\n\x07product\x18\n\x20\x02(\x0e2\x08.ProductB\0\x12&\n\rp\ + roduct_flags\x18\x14\x20\x03(\x0e2\r.ProductFlagsB\0\x12\x1d\n\x08platfo\ + rm\x18\x1e\x20\x02(\x0e2\t.PlatformB\0\x12\x11\n\x07version\x18(\x20\x02\ + (\x04B\0:\0\"S\n\x15LoginCryptoHelloUnion\x128\n\x0ediffie_hellman\x18\n\ + \x20\x01(\x0b2\x1e.LoginCryptoDiffieHellmanHelloB\0:\0\"L\n\x1dLoginCryp\ + toDiffieHellmanHello\x12\x0c\n\x02gc\x18\n\x20\x02(\x0cB\0\x12\x1b\n\x11\ + server_keys_known\x18\x14\x20\x02(\rB\0:\0\"A\n\nFeatureSet\x12\x15\n\ + \x0bautoupdate2\x18\x01\x20\x01(\x08B\0\x12\x1a\n\x10current_location\ + \x18\x02\x20\x01(\x08B\0:\0\"\x8c\x01\n\x11APResponseMessage\x12!\n\tcha\ + llenge\x18\n\x20\x01(\x0b2\x0c.APChallengeB\0\x12*\n\x07upgrade\x18\x14\ + \x20\x01(\x0b2\x17.UpgradeRequiredMessageB\0\x12&\n\x0clogin_failed\x18\ + \x1e\x20\x01(\x0b2\x0e.APLoginFailedB\0:\0\"\x95\x02\n\x0bAPChallenge\ + \x12<\n\x16login_crypto_challenge\x18\n\x20\x02(\x0b2\x1a.LoginCryptoCha\ + llengeUnionB\0\x12;\n\x15fingerprint_challenge\x18\x14\x20\x02(\x0b2\x1a\ + .FingerprintChallengeUnionB\0\x12+\n\rpow_challenge\x18\x1e\x20\x02(\x0b\ + 2\x12.PoWChallengeUnionB\0\x121\n\x10crypto_challenge\x18(\x20\x02(\x0b2\ + \x15.CryptoChallengeUnionB\0\x12\x16\n\x0cserver_nonce\x182\x20\x02(\x0c\ + B\0\x12\x11\n\x07padding\x18<\x20\x01(\x0cB\0:\0\"[\n\x19LoginCryptoChal\ + lengeUnion\x12<\n\x0ediffie_hellman\x18\n\x20\x01(\x0b2\".LoginCryptoDif\ + fieHellmanChallengeB\0:\0\"k\n!LoginCryptoDiffieHellmanChallenge\x12\x0c\ + \n\x02gs\x18\n\x20\x02(\x0cB\0\x12\x1e\n\x14server_signature_key\x18\x14\ + \x20\x02(\x05B\0\x12\x16\n\x0cgs_signature\x18\x1e\x20\x02(\x0cB\0:\0\"\ + \x82\x01\n\x19FingerprintChallengeUnion\x12+\n\x05grain\x18\n\x20\x01(\ + \x0b2\x1a.FingerprintGrainChallengeB\0\x126\n\x0bhmac_ripemd\x18\x14\x20\ + \x01(\x0b2\x1f.FingerprintHmacRipemdChallengeB\0:\0\",\n\x19FingerprintG\ + rainChallenge\x12\r\n\x03kek\x18\n\x20\x02(\x0cB\0:\0\"7\n\x1eFingerprin\ + tHmacRipemdChallenge\x12\x13\n\tchallenge\x18\n\x20\x02(\x0cB\0:\0\"A\n\ + \x11PoWChallengeUnion\x12*\n\thash_cash\x18\n\x20\x01(\x0b2\x15.PoWHashC\ + ashChallengeB\0:\0\"N\n\x14PoWHashCashChallenge\x12\x10\n\x06prefix\x18\ + \n\x20\x01(\x0cB\0\x12\x10\n\x06length\x18\x14\x20\x01(\x05B\0\x12\x10\n\ + \x06target\x18\x1e\x20\x01(\x05B\0:\0\"z\n\x14CryptoChallengeUnion\x12*\ + \n\x07shannon\x18\n\x20\x01(\x0b2\x17.CryptoShannonChallengeB\0\x124\n\r\ + rc4_sha1_hmac\x18\x14\x20\x01(\x0b2\x1b.CryptoRc4Sha1HmacChallengeB\0:\0\ + \"\x1a\n\x16CryptoShannonChallenge:\0\"\x1e\n\x1aCryptoRc4Sha1HmacChalle\ + nge:\0\"e\n\x16UpgradeRequiredMessage\x12\x1d\n\x13upgrade_signed_part\ + \x18\n\x20\x02(\x0cB\0\x12\x13\n\tsignature\x18\x14\x20\x02(\x0cB\0\x12\ + \x15\n\x0bhttp_suffix\x18\x1e\x20\x01(\tB\0:\0\"y\n\rAPLoginFailed\x12\ + \x20\n\nerror_code\x18\n\x20\x02(\x0e2\n.ErrorCodeB\0\x12\x15\n\x0bretry\ + _delay\x18\x14\x20\x01(\x05B\0\x12\x10\n\x06expiry\x18\x1e\x20\x01(\x05B\ + \0\x12\x1b\n\x11error_description\x18(\x20\x01(\tB\0:\0\"\xb3\x01\n\x17C\ + lientResponsePlaintext\x12:\n\x15login_crypto_response\x18\n\x20\x02(\ + \x0b2\x19.LoginCryptoResponseUnionB\0\x12)\n\x0cpow_response\x18\x14\x20\ + \x02(\x0b2\x11.PoWResponseUnionB\0\x12/\n\x0fcrypto_response\x18\x1e\x20\ + \x02(\x0b2\x14.CryptoResponseUnionB\0:\0\"Y\n\x18LoginCryptoResponseUnio\ + n\x12;\n\x0ediffie_hellman\x18\n\x20\x01(\x0b2!.LoginCryptoDiffieHellman\ + ResponseB\0:\0\"4\n\x20LoginCryptoDiffieHellmanResponse\x12\x0e\n\x04hma\ + c\x18\n\x20\x02(\x0cB\0:\0\"?\n\x10PoWResponseUnion\x12)\n\thash_cash\ + \x18\n\x20\x01(\x0b2\x14.PoWHashCashResponseB\0:\0\".\n\x13PoWHashCashRe\ + sponse\x12\x15\n\x0bhash_suffix\x18\n\x20\x02(\x0cB\0:\0\"w\n\x13CryptoR\ + esponseUnion\x12)\n\x07shannon\x18\n\x20\x01(\x0b2\x16.CryptoShannonResp\ + onseB\0\x123\n\rrc4_sha1_hmac\x18\x14\x20\x01(\x0b2\x1a.CryptoRc4Sha1Hma\ + cResponseB\0:\0\"*\n\x15CryptoShannonResponse\x12\x0f\n\x05dummy\x18\x01\ + \x20\x01(\x05B\0:\0\".\n\x19CryptoRc4Sha1HmacResponse\x12\x0f\n\x05dummy\ + \x18\x01\x20\x01(\x05B\0:\0*\x81\x01\n\x07Product\x12\x12\n\x0ePRODUCT_C\ + LIENT\x10\0\x12\x16\n\x12PRODUCT_LIBSPOTIFY\x10\x01\x12\x12\n\x0ePRODUCT\ + _MOBILE\x10\x02\x12\x13\n\x0fPRODUCT_PARTNER\x10\x03\x12\x1f\n\x1bPRODUC\ + T_LIBSPOTIFY_EMBEDDED\x10\x05\x1a\0*C\n\x0cProductFlags\x12\x15\n\x11PRO\ + DUCT_FLAG_NONE\x10\0\x12\x1a\n\x16PRODUCT_FLAG_DEV_BUILD\x10\x01\x1a\0*\ + \xde\x04\n\x08Platform\x12\x16\n\x12PLATFORM_WIN32_X86\x10\0\x12\x14\n\ + \x10PLATFORM_OSX_X86\x10\x01\x12\x16\n\x12PLATFORM_LINUX_X86\x10\x02\x12\ + \x17\n\x13PLATFORM_IPHONE_ARM\x10\x03\x12\x14\n\x10PLATFORM_S60_ARM\x10\ + \x04\x12\x14\n\x10PLATFORM_OSX_PPC\x10\x05\x12\x18\n\x14PLATFORM_ANDROID\ + _ARM\x10\x06\x12\x1b\n\x17PLATFORM_WINDOWS_CE_ARM\x10\x07\x12\x19\n\x15P\ + LATFORM_LINUX_X86_64\x10\x08\x12\x17\n\x13PLATFORM_OSX_X86_64\x10\t\x12\ + \x15\n\x11PLATFORM_PALM_ARM\x10\n\x12\x15\n\x11PLATFORM_LINUX_SH\x10\x0b\ + \x12\x18\n\x14PLATFORM_FREEBSD_X86\x10\x0c\x12\x1b\n\x17PLATFORM_FREEBSD\ + _X86_64\x10\r\x12\x1b\n\x17PLATFORM_BLACKBERRY_ARM\x10\x0e\x12\x12\n\x0e\ + PLATFORM_SONOS\x10\x0f\x12\x17\n\x13PLATFORM_LINUX_MIPS\x10\x10\x12\x16\ + \n\x12PLATFORM_LINUX_ARM\x10\x11\x12\x19\n\x15PLATFORM_LOGITECH_ARM\x10\ + \x12\x12\x1b\n\x17PLATFORM_LINUX_BLACKFIN\x10\x13\x12\x14\n\x10PLATFORM_\ + WP7_ARM\x10\x14\x12\x16\n\x12PLATFORM_ONKYO_ARM\x10\x15\x12\x17\n\x13PLA\ + TFORM_QNXNTO_ARM\x10\x16\x12\x14\n\x10PLATFORM_BCO_ARM\x10\x17\x1a\0*C\n\ + \x0bFingerprint\x12\x15\n\x11FINGERPRINT_GRAIN\x10\0\x12\x1b\n\x17FINGER\ + PRINT_HMAC_RIPEMD\x10\x01\x1a\0*I\n\x0bCryptosuite\x12\x18\n\x14CRYPTO_S\ + UITE_SHANNON\x10\0\x12\x1e\n\x1aCRYPTO_SUITE_RC4_SHA1_HMAC\x10\x01\x1a\0\ + *\x20\n\tPowscheme\x12\x11\n\rPOW_HASH_CASH\x10\0\x1a\0*\x8b\x02\n\tErro\ + rCode\x12\x11\n\rProtocolError\x10\0\x12\x10\n\x0cTryAnotherAP\x10\x02\ + \x12\x13\n\x0fBadConnectionId\x10\x05\x12\x15\n\x11TravelRestriction\x10\ + \t\x12\x1a\n\x16PremiumAccountRequired\x10\x0b\x12\x12\n\x0eBadCredentia\ + ls\x10\x0c\x12\x1f\n\x1bCouldNotValidateCredentials\x10\r\x12\x11\n\rAcc\ + ountExists\x10\x0e\x12\x1d\n\x19ExtraVerificationRequired\x10\x0f\x12\ + \x11\n\rInvalidAppKey\x10\x10\x12\x15\n\x11ApplicationBanned\x10\x11\x1a\ + \0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/protocol/src/mercury.rs b/protocol/src/mercury.rs index d80222c7..0913c5c7 100644 --- a/protocol/src/mercury.rs +++ b/protocol/src/mercury.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,39 +17,41 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `mercury.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct MercuryMultiGetRequest { // message fields request: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for MercuryMultiGetRequest {} +impl<'a> ::std::default::Default for &'a MercuryMultiGetRequest { + fn default() -> &'a MercuryMultiGetRequest { + ::default_instance() + } +} impl MercuryMultiGetRequest { pub fn new() -> MercuryMultiGetRequest { ::std::default::Default::default() } - pub fn default_instance() -> &'static MercuryMultiGetRequest { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const MercuryMultiGetRequest, - }; - unsafe { - instance.get(MercuryMultiGetRequest::new) - } - } - // repeated .MercuryRequest request = 1; + + pub fn get_request(&self) -> &[MercuryRequest] { + &self.request + } pub fn clear_request(&mut self) { self.request.clear(); } @@ -68,18 +70,6 @@ impl MercuryMultiGetRequest { pub fn take_request(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.request, ::protobuf::RepeatedField::new()) } - - pub fn get_request(&self) -> &[MercuryRequest] { - &self.request - } - - fn get_request_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.request - } - - fn mut_request_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.request - } } impl ::protobuf::Message for MercuryMultiGetRequest { @@ -142,27 +132,25 @@ impl ::protobuf::Message for MercuryMultiGetRequest { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for MercuryMultiGetRequest { fn new() -> MercuryMultiGetRequest { MercuryMultiGetRequest::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -172,8 +160,8 @@ impl ::protobuf::MessageStatic for MercuryMultiGetRequest { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "request", - MercuryMultiGetRequest::get_request_for_reflect, - MercuryMultiGetRequest::mut_request_for_reflect, + |m: &MercuryMultiGetRequest| { &m.request }, + |m: &mut MercuryMultiGetRequest| { &mut m.request }, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryMultiGetRequest", @@ -183,11 +171,21 @@ impl ::protobuf::MessageStatic for MercuryMultiGetRequest { }) } } + + fn default_instance() -> &'static MercuryMultiGetRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MercuryMultiGetRequest, + }; + unsafe { + instance.get(MercuryMultiGetRequest::new) + } + } } impl ::protobuf::Clear for MercuryMultiGetRequest { fn clear(&mut self) { - self.clear_request(); + self.request.clear(); self.unknown_fields.clear(); } } @@ -209,30 +207,27 @@ pub struct MercuryMultiGetReply { // message fields reply: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for MercuryMultiGetReply {} +impl<'a> ::std::default::Default for &'a MercuryMultiGetReply { + fn default() -> &'a MercuryMultiGetReply { + ::default_instance() + } +} impl MercuryMultiGetReply { pub fn new() -> MercuryMultiGetReply { ::std::default::Default::default() } - pub fn default_instance() -> &'static MercuryMultiGetReply { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const MercuryMultiGetReply, - }; - unsafe { - instance.get(MercuryMultiGetReply::new) - } - } - // repeated .MercuryReply reply = 1; + + pub fn get_reply(&self) -> &[MercuryReply] { + &self.reply + } pub fn clear_reply(&mut self) { self.reply.clear(); } @@ -251,18 +246,6 @@ impl MercuryMultiGetReply { pub fn take_reply(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.reply, ::protobuf::RepeatedField::new()) } - - pub fn get_reply(&self) -> &[MercuryReply] { - &self.reply - } - - fn get_reply_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.reply - } - - fn mut_reply_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.reply - } } impl ::protobuf::Message for MercuryMultiGetReply { @@ -325,27 +308,25 @@ impl ::protobuf::Message for MercuryMultiGetReply { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for MercuryMultiGetReply { fn new() -> MercuryMultiGetReply { MercuryMultiGetReply::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -355,8 +336,8 @@ impl ::protobuf::MessageStatic for MercuryMultiGetReply { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "reply", - MercuryMultiGetReply::get_reply_for_reflect, - MercuryMultiGetReply::mut_reply_for_reflect, + |m: &MercuryMultiGetReply| { &m.reply }, + |m: &mut MercuryMultiGetReply| { &mut m.reply }, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryMultiGetReply", @@ -366,11 +347,21 @@ impl ::protobuf::MessageStatic for MercuryMultiGetReply { }) } } + + fn default_instance() -> &'static MercuryMultiGetReply { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MercuryMultiGetReply, + }; + unsafe { + instance.get(MercuryMultiGetReply::new) + } + } } impl ::protobuf::Clear for MercuryMultiGetReply { fn clear(&mut self) { - self.clear_reply(); + self.reply.clear(); self.unknown_fields.clear(); } } @@ -395,30 +386,30 @@ pub struct MercuryRequest { body: ::protobuf::SingularField<::std::vec::Vec>, etag: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for MercuryRequest {} +impl<'a> ::std::default::Default for &'a MercuryRequest { + fn default() -> &'a MercuryRequest { + ::default_instance() + } +} impl MercuryRequest { pub fn new() -> MercuryRequest { ::std::default::Default::default() } - pub fn default_instance() -> &'static MercuryRequest { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const MercuryRequest, - }; - unsafe { - instance.get(MercuryRequest::new) - } - } - // optional string uri = 1; + + pub fn get_uri(&self) -> &str { + match self.uri.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_uri(&mut self) { self.uri.clear(); } @@ -446,23 +437,15 @@ impl MercuryRequest { self.uri.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_uri(&self) -> &str { - match self.uri.as_ref() { + // optional string content_type = 2; + + + pub fn get_content_type(&self) -> &str { + match self.content_type.as_ref() { Some(v) => &v, None => "", } } - - fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.uri - } - - fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.uri - } - - // optional string content_type = 2; - pub fn clear_content_type(&mut self) { self.content_type.clear(); } @@ -490,23 +473,15 @@ impl MercuryRequest { self.content_type.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_content_type(&self) -> &str { - match self.content_type.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bytes body = 3; - fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.content_type - } - fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.content_type + pub fn get_body(&self) -> &[u8] { + match self.body.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes body = 3; - pub fn clear_body(&mut self) { self.body.clear(); } @@ -534,23 +509,15 @@ impl MercuryRequest { self.body.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_body(&self) -> &[u8] { - match self.body.as_ref() { + // optional bytes etag = 4; + + + pub fn get_etag(&self) -> &[u8] { + match self.etag.as_ref() { Some(v) => &v, None => &[], } } - - fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.body - } - - fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.body - } - - // optional bytes etag = 4; - pub fn clear_etag(&mut self) { self.etag.clear(); } @@ -577,21 +544,6 @@ impl MercuryRequest { pub fn take_etag(&mut self) -> ::std::vec::Vec { self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_etag(&self) -> &[u8] { - match self.etag.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.etag - } - - fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.etag - } } impl ::protobuf::Message for MercuryRequest { @@ -673,27 +625,25 @@ impl ::protobuf::Message for MercuryRequest { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for MercuryRequest { fn new() -> MercuryRequest { MercuryRequest::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -703,23 +653,23 @@ impl ::protobuf::MessageStatic for MercuryRequest { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - MercuryRequest::get_uri_for_reflect, - MercuryRequest::mut_uri_for_reflect, + |m: &MercuryRequest| { &m.uri }, + |m: &mut MercuryRequest| { &mut m.uri }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - MercuryRequest::get_content_type_for_reflect, - MercuryRequest::mut_content_type_for_reflect, + |m: &MercuryRequest| { &m.content_type }, + |m: &mut MercuryRequest| { &mut m.content_type }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "body", - MercuryRequest::get_body_for_reflect, - MercuryRequest::mut_body_for_reflect, + |m: &MercuryRequest| { &m.body }, + |m: &mut MercuryRequest| { &mut m.body }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "etag", - MercuryRequest::get_etag_for_reflect, - MercuryRequest::mut_etag_for_reflect, + |m: &MercuryRequest| { &m.etag }, + |m: &mut MercuryRequest| { &mut m.etag }, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryRequest", @@ -729,14 +679,24 @@ impl ::protobuf::MessageStatic for MercuryRequest { }) } } + + fn default_instance() -> &'static MercuryRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MercuryRequest, + }; + unsafe { + instance.get(MercuryRequest::new) + } + } } impl ::protobuf::Clear for MercuryRequest { fn clear(&mut self) { - self.clear_uri(); - self.clear_content_type(); - self.clear_body(); - self.clear_etag(); + self.uri.clear(); + self.content_type.clear(); + self.body.clear(); + self.etag.clear(); self.unknown_fields.clear(); } } @@ -764,30 +724,27 @@ pub struct MercuryReply { content_type: ::protobuf::SingularField<::std::string::String>, body: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for MercuryReply {} +impl<'a> ::std::default::Default for &'a MercuryReply { + fn default() -> &'a MercuryReply { + ::default_instance() + } +} impl MercuryReply { pub fn new() -> MercuryReply { ::std::default::Default::default() } - pub fn default_instance() -> &'static MercuryReply { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const MercuryReply, - }; - unsafe { - instance.get(MercuryReply::new) - } - } - // optional sint32 status_code = 1; + + pub fn get_status_code(&self) -> i32 { + self.status_code.unwrap_or(0) + } pub fn clear_status_code(&mut self) { self.status_code = ::std::option::Option::None; } @@ -801,20 +758,15 @@ impl MercuryReply { self.status_code = ::std::option::Option::Some(v); } - pub fn get_status_code(&self) -> i32 { - self.status_code.unwrap_or(0) - } + // optional string status_message = 2; - fn get_status_code_for_reflect(&self) -> &::std::option::Option { - &self.status_code - } - fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.status_code + pub fn get_status_message(&self) -> &str { + match self.status_message.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string status_message = 2; - pub fn clear_status_message(&mut self) { self.status_message.clear(); } @@ -842,23 +794,12 @@ impl MercuryReply { self.status_message.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_status_message(&self) -> &str { - match self.status_message.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .MercuryReply.CachePolicy cache_policy = 3; - fn get_status_message_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.status_message - } - fn mut_status_message_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.status_message + pub fn get_cache_policy(&self) -> MercuryReply_CachePolicy { + self.cache_policy.unwrap_or(MercuryReply_CachePolicy::CACHE_NO) } - - // optional .MercuryReply.CachePolicy cache_policy = 3; - pub fn clear_cache_policy(&mut self) { self.cache_policy = ::std::option::Option::None; } @@ -872,20 +813,12 @@ impl MercuryReply { self.cache_policy = ::std::option::Option::Some(v); } - pub fn get_cache_policy(&self) -> MercuryReply_CachePolicy { - self.cache_policy.unwrap_or(MercuryReply_CachePolicy::CACHE_NO) - } + // optional sint32 ttl = 4; - fn get_cache_policy_for_reflect(&self) -> &::std::option::Option { - &self.cache_policy - } - fn mut_cache_policy_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.cache_policy + pub fn get_ttl(&self) -> i32 { + self.ttl.unwrap_or(0) } - - // optional sint32 ttl = 4; - pub fn clear_ttl(&mut self) { self.ttl = ::std::option::Option::None; } @@ -899,20 +832,15 @@ impl MercuryReply { self.ttl = ::std::option::Option::Some(v); } - pub fn get_ttl(&self) -> i32 { - self.ttl.unwrap_or(0) - } + // optional bytes etag = 5; - fn get_ttl_for_reflect(&self) -> &::std::option::Option { - &self.ttl - } - fn mut_ttl_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.ttl + pub fn get_etag(&self) -> &[u8] { + match self.etag.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes etag = 5; - pub fn clear_etag(&mut self) { self.etag.clear(); } @@ -940,23 +868,15 @@ impl MercuryReply { self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_etag(&self) -> &[u8] { - match self.etag.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string content_type = 6; - fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.etag - } - fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.etag + pub fn get_content_type(&self) -> &str { + match self.content_type.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string content_type = 6; - pub fn clear_content_type(&mut self) { self.content_type.clear(); } @@ -984,23 +904,15 @@ impl MercuryReply { self.content_type.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_content_type(&self) -> &str { - match self.content_type.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bytes body = 7; - fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.content_type - } - fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.content_type + pub fn get_body(&self) -> &[u8] { + match self.body.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes body = 7; - pub fn clear_body(&mut self) { self.body.clear(); } @@ -1027,21 +939,6 @@ impl MercuryReply { pub fn take_body(&mut self) -> ::std::vec::Vec { self.body.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_body(&self) -> &[u8] { - match self.body.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.body - } - - fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.body - } } impl ::protobuf::Message for MercuryReply { @@ -1064,11 +961,7 @@ impl ::protobuf::Message for MercuryReply { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.status_message)?; }, 3 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.cache_policy = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.cache_policy, 3, &mut self.unknown_fields)? }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -1162,27 +1055,25 @@ impl ::protobuf::Message for MercuryReply { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for MercuryReply { fn new() -> MercuryReply { MercuryReply::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1192,38 +1083,38 @@ impl ::protobuf::MessageStatic for MercuryReply { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "status_code", - MercuryReply::get_status_code_for_reflect, - MercuryReply::mut_status_code_for_reflect, + |m: &MercuryReply| { &m.status_code }, + |m: &mut MercuryReply| { &mut m.status_code }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "status_message", - MercuryReply::get_status_message_for_reflect, - MercuryReply::mut_status_message_for_reflect, + |m: &MercuryReply| { &m.status_message }, + |m: &mut MercuryReply| { &mut m.status_message }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cache_policy", - MercuryReply::get_cache_policy_for_reflect, - MercuryReply::mut_cache_policy_for_reflect, + |m: &MercuryReply| { &m.cache_policy }, + |m: &mut MercuryReply| { &mut m.cache_policy }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "ttl", - MercuryReply::get_ttl_for_reflect, - MercuryReply::mut_ttl_for_reflect, + |m: &MercuryReply| { &m.ttl }, + |m: &mut MercuryReply| { &mut m.ttl }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "etag", - MercuryReply::get_etag_for_reflect, - MercuryReply::mut_etag_for_reflect, + |m: &MercuryReply| { &m.etag }, + |m: &mut MercuryReply| { &mut m.etag }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - MercuryReply::get_content_type_for_reflect, - MercuryReply::mut_content_type_for_reflect, + |m: &MercuryReply| { &m.content_type }, + |m: &mut MercuryReply| { &mut m.content_type }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "body", - MercuryReply::get_body_for_reflect, - MercuryReply::mut_body_for_reflect, + |m: &MercuryReply| { &m.body }, + |m: &mut MercuryReply| { &mut m.body }, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryReply", @@ -1233,17 +1124,27 @@ impl ::protobuf::MessageStatic for MercuryReply { }) } } + + fn default_instance() -> &'static MercuryReply { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const MercuryReply, + }; + unsafe { + instance.get(MercuryReply::new) + } + } } impl ::protobuf::Clear for MercuryReply { fn clear(&mut self) { - self.clear_status_code(); - self.clear_status_message(); - self.clear_cache_policy(); - self.clear_ttl(); - self.clear_etag(); - self.clear_content_type(); - self.clear_body(); + self.status_code = ::std::option::Option::None; + self.status_message.clear(); + self.cache_policy = ::std::option::Option::None; + self.ttl = ::std::option::Option::None; + self.etag.clear(); + self.content_type.clear(); + self.body.clear(); self.unknown_fields.clear(); } } @@ -1290,7 +1191,7 @@ impl ::protobuf::ProtobufEnum for MercuryReply_CachePolicy { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -1306,6 +1207,13 @@ impl ::protobuf::ProtobufEnum for MercuryReply_CachePolicy { impl ::std::marker::Copy for MercuryReply_CachePolicy { } +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for MercuryReply_CachePolicy { + fn default() -> Self { + MercuryReply_CachePolicy::CACHE_NO + } +} + impl ::protobuf::reflect::ProtobufValue for MercuryReply_CachePolicy { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -1321,30 +1229,30 @@ pub struct Header { status_code: ::std::option::Option, user_fields: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Header {} +impl<'a> ::std::default::Default for &'a Header { + fn default() -> &'a Header { +
::default_instance() + } +} impl Header { pub fn new() -> Header { ::std::default::Default::default() } - pub fn default_instance() -> &'static Header { - static mut instance: ::protobuf::lazy::Lazy
= ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Header, - }; - unsafe { - instance.get(Header::new) - } - } - // optional string uri = 1; + + pub fn get_uri(&self) -> &str { + match self.uri.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_uri(&mut self) { self.uri.clear(); } @@ -1372,23 +1280,15 @@ impl Header { self.uri.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_uri(&self) -> &str { - match self.uri.as_ref() { + // optional string content_type = 2; + + + pub fn get_content_type(&self) -> &str { + match self.content_type.as_ref() { Some(v) => &v, None => "", } } - - fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.uri - } - - fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.uri - } - - // optional string content_type = 2; - pub fn clear_content_type(&mut self) { self.content_type.clear(); } @@ -1416,23 +1316,15 @@ impl Header { self.content_type.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_content_type(&self) -> &str { - match self.content_type.as_ref() { + // optional string method = 3; + + + pub fn get_method(&self) -> &str { + match self.method.as_ref() { Some(v) => &v, None => "", } } - - fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.content_type - } - - fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.content_type - } - - // optional string method = 3; - pub fn clear_method(&mut self) { self.method.clear(); } @@ -1460,23 +1352,12 @@ impl Header { self.method.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_method(&self) -> &str { - match self.method.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional sint32 status_code = 4; - fn get_method_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.method - } - fn mut_method_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.method + pub fn get_status_code(&self) -> i32 { + self.status_code.unwrap_or(0) } - - // optional sint32 status_code = 4; - pub fn clear_status_code(&mut self) { self.status_code = ::std::option::Option::None; } @@ -1490,20 +1371,12 @@ impl Header { self.status_code = ::std::option::Option::Some(v); } - pub fn get_status_code(&self) -> i32 { - self.status_code.unwrap_or(0) - } + // repeated .UserField user_fields = 6; - fn get_status_code_for_reflect(&self) -> &::std::option::Option { - &self.status_code - } - fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.status_code + pub fn get_user_fields(&self) -> &[UserField] { + &self.user_fields } - - // repeated .UserField user_fields = 6; - pub fn clear_user_fields(&mut self) { self.user_fields.clear(); } @@ -1522,18 +1395,6 @@ impl Header { pub fn take_user_fields(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.user_fields, ::protobuf::RepeatedField::new()) } - - pub fn get_user_fields(&self) -> &[UserField] { - &self.user_fields - } - - fn get_user_fields_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.user_fields - } - - fn mut_user_fields_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.user_fields - } } impl ::protobuf::Message for Header { @@ -1636,27 +1497,25 @@ impl ::protobuf::Message for Header { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Header { fn new() -> Header { Header::new() } - fn descriptor_static(_: ::std::option::Option
) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1666,28 +1525,28 @@ impl ::protobuf::MessageStatic for Header { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - Header::get_uri_for_reflect, - Header::mut_uri_for_reflect, + |m: &Header| { &m.uri }, + |m: &mut Header| { &mut m.uri }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - Header::get_content_type_for_reflect, - Header::mut_content_type_for_reflect, + |m: &Header| { &m.content_type }, + |m: &mut Header| { &mut m.content_type }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "method", - Header::get_method_for_reflect, - Header::mut_method_for_reflect, + |m: &Header| { &m.method }, + |m: &mut Header| { &mut m.method }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "status_code", - Header::get_status_code_for_reflect, - Header::mut_status_code_for_reflect, + |m: &Header| { &m.status_code }, + |m: &mut Header| { &mut m.status_code }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "user_fields", - Header::get_user_fields_for_reflect, - Header::mut_user_fields_for_reflect, + |m: &Header| { &m.user_fields }, + |m: &mut Header| { &mut m.user_fields }, )); ::protobuf::reflect::MessageDescriptor::new::
( "Header", @@ -1697,15 +1556,25 @@ impl ::protobuf::MessageStatic for Header { }) } } + + fn default_instance() -> &'static Header { + static mut instance: ::protobuf::lazy::Lazy
= ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Header, + }; + unsafe { + instance.get(Header::new) + } + } } impl ::protobuf::Clear for Header { fn clear(&mut self) { - self.clear_uri(); - self.clear_content_type(); - self.clear_method(); - self.clear_status_code(); - self.clear_user_fields(); + self.uri.clear(); + self.content_type.clear(); + self.method.clear(); + self.status_code = ::std::option::Option::None; + self.user_fields.clear(); self.unknown_fields.clear(); } } @@ -1728,30 +1597,30 @@ pub struct UserField { key: ::protobuf::SingularField<::std::string::String>, value: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for UserField {} +impl<'a> ::std::default::Default for &'a UserField { + fn default() -> &'a UserField { + ::default_instance() + } +} impl UserField { pub fn new() -> UserField { ::std::default::Default::default() } - pub fn default_instance() -> &'static UserField { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const UserField, - }; - unsafe { - instance.get(UserField::new) - } - } - // optional string key = 1; + + pub fn get_key(&self) -> &str { + match self.key.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_key(&mut self) { self.key.clear(); } @@ -1779,23 +1648,15 @@ impl UserField { self.key.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_key(&self) -> &str { - match self.key.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bytes value = 2; - fn get_key_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.key - } - fn mut_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.key + pub fn get_value(&self) -> &[u8] { + match self.value.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes value = 2; - pub fn clear_value(&mut self) { self.value.clear(); } @@ -1822,21 +1683,6 @@ impl UserField { pub fn take_value(&mut self) -> ::std::vec::Vec { self.value.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_value(&self) -> &[u8] { - match self.value.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_value_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.value - } - - fn mut_value_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.value - } } impl ::protobuf::Message for UserField { @@ -1900,27 +1746,25 @@ impl ::protobuf::Message for UserField { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for UserField { fn new() -> UserField { UserField::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1930,13 +1774,13 @@ impl ::protobuf::MessageStatic for UserField { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "key", - UserField::get_key_for_reflect, - UserField::mut_key_for_reflect, + |m: &UserField| { &m.key }, + |m: &mut UserField| { &mut m.key }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "value", - UserField::get_value_for_reflect, - UserField::mut_value_for_reflect, + |m: &UserField| { &m.value }, + |m: &mut UserField| { &mut m.value }, )); ::protobuf::reflect::MessageDescriptor::new::( "UserField", @@ -1946,12 +1790,22 @@ impl ::protobuf::MessageStatic for UserField { }) } } + + fn default_instance() -> &'static UserField { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const UserField, + }; + unsafe { + instance.get(UserField::new) + } + } } impl ::protobuf::Clear for UserField { fn clear(&mut self) { - self.clear_key(); - self.clear_value(); + self.key.clear(); + self.value.clear(); self.unknown_fields.clear(); } } @@ -1969,110 +1823,24 @@ impl ::protobuf::reflect::ProtobufValue for UserField { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\rmercury.proto\"C\n\x16MercuryMultiGetRequest\x12)\n\x07request\x18\ - \x01\x20\x03(\x0b2\x0f.MercuryRequestR\x07request\";\n\x14MercuryMultiGe\ - tReply\x12#\n\x05reply\x18\x01\x20\x03(\x0b2\r.MercuryReplyR\x05reply\"m\ - \n\x0eMercuryRequest\x12\x10\n\x03uri\x18\x01\x20\x01(\tR\x03uri\x12!\n\ - \x0ccontent_type\x18\x02\x20\x01(\tR\x0bcontentType\x12\x12\n\x04body\ - \x18\x03\x20\x01(\x0cR\x04body\x12\x12\n\x04etag\x18\x04\x20\x01(\x0cR\ - \x04etag\"\xb3\x02\n\x0cMercuryReply\x12\x1f\n\x0bstatus_code\x18\x01\ - \x20\x01(\x11R\nstatusCode\x12%\n\x0estatus_message\x18\x02\x20\x01(\tR\ - \rstatusMessage\x12<\n\x0ccache_policy\x18\x03\x20\x01(\x0e2\x19.Mercury\ - Reply.CachePolicyR\x0bcachePolicy\x12\x10\n\x03ttl\x18\x04\x20\x01(\x11R\ - \x03ttl\x12\x12\n\x04etag\x18\x05\x20\x01(\x0cR\x04etag\x12!\n\x0cconten\ - t_type\x18\x06\x20\x01(\tR\x0bcontentType\x12\x12\n\x04body\x18\x07\x20\ - \x01(\x0cR\x04body\"@\n\x0bCachePolicy\x12\x0c\n\x08CACHE_NO\x10\x01\x12\ - \x11\n\rCACHE_PRIVATE\x10\x02\x12\x10\n\x0cCACHE_PUBLIC\x10\x03\"\xa3\ - \x01\n\x06Header\x12\x10\n\x03uri\x18\x01\x20\x01(\tR\x03uri\x12!\n\x0cc\ - ontent_type\x18\x02\x20\x01(\tR\x0bcontentType\x12\x16\n\x06method\x18\ - \x03\x20\x01(\tR\x06method\x12\x1f\n\x0bstatus_code\x18\x04\x20\x01(\x11\ - R\nstatusCode\x12+\n\x0buser_fields\x18\x06\x20\x03(\x0b2\n.UserFieldR\n\ - userFields\"3\n\tUserField\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\ - \x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05valueJ\xaf\r\n\x06\x12\x04\ - \0\0,\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\ - \x04\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x1e\n\x0b\n\x04\x04\0\x02\0\ - \x12\x03\x03\x04*\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x04\x0c\n\x0c\ - \n\x05\x04\0\x02\0\x06\x12\x03\x03\r\x1b\n\x0c\n\x05\x04\0\x02\0\x01\x12\ - \x03\x03\x1c#\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03&)\n\n\n\x02\x04\ - \x01\x12\x04\x06\0\x08\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x1c\n\ - \x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04&\n\x0c\n\x05\x04\x01\x02\0\x04\ - \x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x07\r\x19\n\ - \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x1a\x1f\n\x0c\n\x05\x04\x01\x02\ - \0\x03\x12\x03\x07\"%\n\n\n\x02\x04\x02\x12\x04\n\0\x0f\x01\n\n\n\x03\ - \x04\x02\x01\x12\x03\n\x08\x16\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0b\x04\ - \x1e\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\x0b\x04\x0c\n\x0c\n\x05\x04\ - \x02\x02\0\x05\x12\x03\x0b\r\x13\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\ - \x0b\x14\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0b\x1a\x1d\n\x0b\n\ - \x04\x04\x02\x02\x01\x12\x03\x0c\x04'\n\x0c\n\x05\x04\x02\x02\x01\x04\ - \x12\x03\x0c\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0c\r\x13\n\ - \x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x0c\x14\x20\n\x0c\n\x05\x04\x02\ - \x02\x01\x03\x12\x03\x0c#&\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\r\x04\x1e\ - \n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\x04\x02\ - \x02\x02\x05\x12\x03\r\r\x12\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\r\ - \x13\x17\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\r\x1a\x1d\n\x0b\n\x04\ - \x04\x02\x02\x03\x12\x03\x0e\x04\x1e\n\x0c\n\x05\x04\x02\x02\x03\x04\x12\ - \x03\x0e\x04\x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03\x0e\r\x12\n\x0c\ - \n\x05\x04\x02\x02\x03\x01\x12\x03\x0e\x13\x17\n\x0c\n\x05\x04\x02\x02\ - \x03\x03\x12\x03\x0e\x1a\x1d\n\n\n\x02\x04\x03\x12\x04\x11\0\x1e\x01\n\n\ - \n\x03\x04\x03\x01\x12\x03\x11\x08\x14\n\x0b\n\x04\x04\x03\x02\0\x12\x03\ - \x12\x04&\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03\x12\x04\x0c\n\x0c\n\x05\ - \x04\x03\x02\0\x05\x12\x03\x12\r\x13\n\x0c\n\x05\x04\x03\x02\0\x01\x12\ - \x03\x12\x14\x1f\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\"%\n\x0b\n\ - \x04\x04\x03\x02\x01\x12\x03\x13\x04)\n\x0c\n\x05\x04\x03\x02\x01\x04\ - \x12\x03\x13\x04\x0c\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03\x13\r\x13\n\ - \x0c\n\x05\x04\x03\x02\x01\x01\x12\x03\x13\x14\"\n\x0c\n\x05\x04\x03\x02\ - \x01\x03\x12\x03\x13%(\n\x0b\n\x04\x04\x03\x02\x02\x12\x03\x14\x04,\n\ - \x0c\n\x05\x04\x03\x02\x02\x04\x12\x03\x14\x04\x0c\n\x0c\n\x05\x04\x03\ - \x02\x02\x06\x12\x03\x14\r\x18\n\x0c\n\x05\x04\x03\x02\x02\x01\x12\x03\ - \x14\x19%\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03\x14(+\n\x0c\n\x04\x04\ - \x03\x04\0\x12\x04\x15\x04\x19\x05\n\x0c\n\x05\x04\x03\x04\0\x01\x12\x03\ - \x15\t\x14\n\r\n\x06\x04\x03\x04\0\x02\0\x12\x03\x16\x08\x17\n\x0e\n\x07\ - \x04\x03\x04\0\x02\0\x01\x12\x03\x16\x08\x10\n\x0e\n\x07\x04\x03\x04\0\ - \x02\0\x02\x12\x03\x16\x13\x16\n\r\n\x06\x04\x03\x04\0\x02\x01\x12\x03\ - \x17\x08\x1c\n\x0e\n\x07\x04\x03\x04\0\x02\x01\x01\x12\x03\x17\x08\x15\n\ - \x0e\n\x07\x04\x03\x04\0\x02\x01\x02\x12\x03\x17\x18\x1b\n\r\n\x06\x04\ - \x03\x04\0\x02\x02\x12\x03\x18\x08\x1b\n\x0e\n\x07\x04\x03\x04\0\x02\x02\ - \x01\x12\x03\x18\x08\x14\n\x0e\n\x07\x04\x03\x04\0\x02\x02\x02\x12\x03\ - \x18\x17\x1a\n\x0b\n\x04\x04\x03\x02\x03\x12\x03\x1a\x04\x1e\n\x0c\n\x05\ - \x04\x03\x02\x03\x04\x12\x03\x1a\x04\x0c\n\x0c\n\x05\x04\x03\x02\x03\x05\ - \x12\x03\x1a\r\x13\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03\x1a\x14\x17\n\ - \x0c\n\x05\x04\x03\x02\x03\x03\x12\x03\x1a\x1a\x1d\n\x0b\n\x04\x04\x03\ - \x02\x04\x12\x03\x1b\x04\x1e\n\x0c\n\x05\x04\x03\x02\x04\x04\x12\x03\x1b\ - \x04\x0c\n\x0c\n\x05\x04\x03\x02\x04\x05\x12\x03\x1b\r\x12\n\x0c\n\x05\ - \x04\x03\x02\x04\x01\x12\x03\x1b\x13\x17\n\x0c\n\x05\x04\x03\x02\x04\x03\ - \x12\x03\x1b\x1a\x1d\n\x0b\n\x04\x04\x03\x02\x05\x12\x03\x1c\x04'\n\x0c\ - \n\x05\x04\x03\x02\x05\x04\x12\x03\x1c\x04\x0c\n\x0c\n\x05\x04\x03\x02\ - \x05\x05\x12\x03\x1c\r\x13\n\x0c\n\x05\x04\x03\x02\x05\x01\x12\x03\x1c\ - \x14\x20\n\x0c\n\x05\x04\x03\x02\x05\x03\x12\x03\x1c#&\n\x0b\n\x04\x04\ - \x03\x02\x06\x12\x03\x1d\x04\x1e\n\x0c\n\x05\x04\x03\x02\x06\x04\x12\x03\ - \x1d\x04\x0c\n\x0c\n\x05\x04\x03\x02\x06\x05\x12\x03\x1d\r\x12\n\x0c\n\ - \x05\x04\x03\x02\x06\x01\x12\x03\x1d\x13\x17\n\x0c\n\x05\x04\x03\x02\x06\ - \x03\x12\x03\x1d\x1a\x1d\n\n\n\x02\x04\x04\x12\x04!\0'\x01\n\n\n\x03\x04\ - \x04\x01\x12\x03!\x08\x0e\n\x0b\n\x04\x04\x04\x02\0\x12\x03\"\x04\x1f\n\ - \x0c\n\x05\x04\x04\x02\0\x04\x12\x03\"\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\ - \x05\x12\x03\"\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03\"\x14\x17\n\ - \x0c\n\x05\x04\x04\x02\0\x03\x12\x03\"\x1a\x1e\n\x0b\n\x04\x04\x04\x02\ - \x01\x12\x03#\x04(\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03#\x04\x0c\n\ - \x0c\n\x05\x04\x04\x02\x01\x05\x12\x03#\r\x13\n\x0c\n\x05\x04\x04\x02\ - \x01\x01\x12\x03#\x14\x20\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03##'\n\ - \x0b\n\x04\x04\x04\x02\x02\x12\x03$\x04\"\n\x0c\n\x05\x04\x04\x02\x02\ - \x04\x12\x03$\x04\x0c\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03$\r\x13\n\ - \x0c\n\x05\x04\x04\x02\x02\x01\x12\x03$\x14\x1a\n\x0c\n\x05\x04\x04\x02\ - \x02\x03\x12\x03$\x1d!\n\x0b\n\x04\x04\x04\x02\x03\x12\x03%\x04'\n\x0c\n\ - \x05\x04\x04\x02\x03\x04\x12\x03%\x04\x0c\n\x0c\n\x05\x04\x04\x02\x03\ - \x05\x12\x03%\r\x13\n\x0c\n\x05\x04\x04\x02\x03\x01\x12\x03%\x14\x1f\n\ - \x0c\n\x05\x04\x04\x02\x03\x03\x12\x03%\"&\n\x0b\n\x04\x04\x04\x02\x04\ - \x12\x03&\x04*\n\x0c\n\x05\x04\x04\x02\x04\x04\x12\x03&\x04\x0c\n\x0c\n\ - \x05\x04\x04\x02\x04\x06\x12\x03&\r\x16\n\x0c\n\x05\x04\x04\x02\x04\x01\ - \x12\x03&\x17\"\n\x0c\n\x05\x04\x04\x02\x04\x03\x12\x03&%)\n\n\n\x02\x04\ - \x05\x12\x04)\0,\x01\n\n\n\x03\x04\x05\x01\x12\x03)\x08\x11\n\x0b\n\x04\ - \x04\x05\x02\0\x12\x03*\x04\x1f\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03*\ - \x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03*\r\x13\n\x0c\n\x05\x04\ - \x05\x02\0\x01\x12\x03*\x14\x17\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03*\ - \x1a\x1e\n\x0b\n\x04\x04\x05\x02\x01\x12\x03+\x04\x20\n\x0c\n\x05\x04\ - \x05\x02\x01\x04\x12\x03+\x04\x0c\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\ - \x03+\r\x12\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x03+\x13\x18\n\x0c\n\x05\ - \x04\x05\x02\x01\x03\x12\x03+\x1b\x1f\ + \n\rmercury.proto\x12\0\">\n\x16MercuryMultiGetRequest\x12\"\n\x07reques\ + t\x18\x01\x20\x03(\x0b2\x0f.MercuryRequestB\0:\0\"8\n\x14MercuryMultiGet\ + Reply\x12\x1e\n\x05reply\x18\x01\x20\x03(\x0b2\r.MercuryReplyB\0:\0\"Y\n\ + \x0eMercuryRequest\x12\r\n\x03uri\x18\x01\x20\x01(\tB\0\x12\x16\n\x0ccon\ + tent_type\x18\x02\x20\x01(\tB\0\x12\x0e\n\x04body\x18\x03\x20\x01(\x0cB\ + \0\x12\x0e\n\x04etag\x18\x04\x20\x01(\x0cB\0:\0\"\xff\x01\n\x0cMercuryRe\ + ply\x12\x15\n\x0bstatus_code\x18\x01\x20\x01(\x11B\0\x12\x18\n\x0estatus\ + _message\x18\x02\x20\x01(\tB\0\x121\n\x0ccache_policy\x18\x03\x20\x01(\ + \x0e2\x19.MercuryReply.CachePolicyB\0\x12\r\n\x03ttl\x18\x04\x20\x01(\ + \x11B\0\x12\x0e\n\x04etag\x18\x05\x20\x01(\x0cB\0\x12\x16\n\x0ccontent_t\ + ype\x18\x06\x20\x01(\tB\0\x12\x0e\n\x04body\x18\x07\x20\x01(\x0cB\0\"B\n\ + \x0bCachePolicy\x12\x0c\n\x08CACHE_NO\x10\x01\x12\x11\n\rCACHE_PRIVATE\ + \x10\x02\x12\x10\n\x0cCACHE_PUBLIC\x10\x03\x1a\0:\0\"}\n\x06Header\x12\r\ + \n\x03uri\x18\x01\x20\x01(\tB\0\x12\x16\n\x0ccontent_type\x18\x02\x20\ + \x01(\tB\0\x12\x10\n\x06method\x18\x03\x20\x01(\tB\0\x12\x15\n\x0bstatus\ + _code\x18\x04\x20\x01(\x11B\0\x12!\n\x0buser_fields\x18\x06\x20\x03(\x0b\ + 2\n.UserFieldB\0:\0\"-\n\tUserField\x12\r\n\x03key\x18\x01\x20\x01(\tB\0\ + \x12\x0f\n\x05value\x18\x02\x20\x01(\x0cB\0:\0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/protocol/src/metadata.rs b/protocol/src/metadata.rs index ca98bf49..7cfa964d 100644 --- a/protocol/src/metadata.rs +++ b/protocol/src/metadata.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,40 +17,45 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `metadata.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct TopTracks { // message fields country: ::protobuf::SingularField<::std::string::String>, track: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for TopTracks {} +impl<'a> ::std::default::Default for &'a TopTracks { + fn default() -> &'a TopTracks { + ::default_instance() + } +} impl TopTracks { pub fn new() -> TopTracks { ::std::default::Default::default() } - pub fn default_instance() -> &'static TopTracks { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const TopTracks, - }; - unsafe { - instance.get(TopTracks::new) - } - } - // optional string country = 1; + + pub fn get_country(&self) -> &str { + match self.country.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_country(&mut self) { self.country.clear(); } @@ -78,23 +83,12 @@ impl TopTracks { self.country.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_country(&self) -> &str { - match self.country.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Track track = 2; - fn get_country_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.country - } - fn mut_country_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.country + pub fn get_track(&self) -> &[Track] { + &self.track } - - // repeated .Track track = 2; - pub fn clear_track(&mut self) { self.track.clear(); } @@ -113,18 +107,6 @@ impl TopTracks { pub fn take_track(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.track, ::protobuf::RepeatedField::new()) } - - pub fn get_track(&self) -> &[Track] { - &self.track - } - - fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.track - } - - fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.track - } } impl ::protobuf::Message for TopTracks { @@ -196,27 +178,25 @@ impl ::protobuf::Message for TopTracks { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for TopTracks { fn new() -> TopTracks { TopTracks::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -226,13 +206,13 @@ impl ::protobuf::MessageStatic for TopTracks { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "country", - TopTracks::get_country_for_reflect, - TopTracks::mut_country_for_reflect, + |m: &TopTracks| { &m.country }, + |m: &mut TopTracks| { &mut m.country }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - TopTracks::get_track_for_reflect, - TopTracks::mut_track_for_reflect, + |m: &TopTracks| { &m.track }, + |m: &mut TopTracks| { &mut m.track }, )); ::protobuf::reflect::MessageDescriptor::new::( "TopTracks", @@ -242,12 +222,22 @@ impl ::protobuf::MessageStatic for TopTracks { }) } } + + fn default_instance() -> &'static TopTracks { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TopTracks, + }; + unsafe { + instance.get(TopTracks::new) + } + } } impl ::protobuf::Clear for TopTracks { fn clear(&mut self) { - self.clear_country(); - self.clear_track(); + self.country.clear(); + self.track.clear(); self.unknown_fields.clear(); } } @@ -271,30 +261,27 @@ pub struct ActivityPeriod { end_year: ::std::option::Option, decade: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ActivityPeriod {} +impl<'a> ::std::default::Default for &'a ActivityPeriod { + fn default() -> &'a ActivityPeriod { + ::default_instance() + } +} impl ActivityPeriod { pub fn new() -> ActivityPeriod { ::std::default::Default::default() } - pub fn default_instance() -> &'static ActivityPeriod { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ActivityPeriod, - }; - unsafe { - instance.get(ActivityPeriod::new) - } - } - // optional sint32 start_year = 1; + + pub fn get_start_year(&self) -> i32 { + self.start_year.unwrap_or(0) + } pub fn clear_start_year(&mut self) { self.start_year = ::std::option::Option::None; } @@ -308,20 +295,12 @@ impl ActivityPeriod { self.start_year = ::std::option::Option::Some(v); } - pub fn get_start_year(&self) -> i32 { - self.start_year.unwrap_or(0) - } + // optional sint32 end_year = 2; - fn get_start_year_for_reflect(&self) -> &::std::option::Option { - &self.start_year - } - fn mut_start_year_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.start_year + pub fn get_end_year(&self) -> i32 { + self.end_year.unwrap_or(0) } - - // optional sint32 end_year = 2; - pub fn clear_end_year(&mut self) { self.end_year = ::std::option::Option::None; } @@ -335,20 +314,12 @@ impl ActivityPeriod { self.end_year = ::std::option::Option::Some(v); } - pub fn get_end_year(&self) -> i32 { - self.end_year.unwrap_or(0) - } + // optional sint32 decade = 3; - fn get_end_year_for_reflect(&self) -> &::std::option::Option { - &self.end_year - } - fn mut_end_year_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.end_year + pub fn get_decade(&self) -> i32 { + self.decade.unwrap_or(0) } - - // optional sint32 decade = 3; - pub fn clear_decade(&mut self) { self.decade = ::std::option::Option::None; } @@ -361,18 +332,6 @@ impl ActivityPeriod { pub fn set_decade(&mut self, v: i32) { self.decade = ::std::option::Option::Some(v); } - - pub fn get_decade(&self) -> i32 { - self.decade.unwrap_or(0) - } - - fn get_decade_for_reflect(&self) -> &::std::option::Option { - &self.decade - } - - fn mut_decade_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.decade - } } impl ::protobuf::Message for ActivityPeriod { @@ -457,27 +416,25 @@ impl ::protobuf::Message for ActivityPeriod { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ActivityPeriod { fn new() -> ActivityPeriod { ActivityPeriod::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -487,18 +444,18 @@ impl ::protobuf::MessageStatic for ActivityPeriod { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "start_year", - ActivityPeriod::get_start_year_for_reflect, - ActivityPeriod::mut_start_year_for_reflect, + |m: &ActivityPeriod| { &m.start_year }, + |m: &mut ActivityPeriod| { &mut m.start_year }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "end_year", - ActivityPeriod::get_end_year_for_reflect, - ActivityPeriod::mut_end_year_for_reflect, + |m: &ActivityPeriod| { &m.end_year }, + |m: &mut ActivityPeriod| { &mut m.end_year }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "decade", - ActivityPeriod::get_decade_for_reflect, - ActivityPeriod::mut_decade_for_reflect, + |m: &ActivityPeriod| { &m.decade }, + |m: &mut ActivityPeriod| { &mut m.decade }, )); ::protobuf::reflect::MessageDescriptor::new::( "ActivityPeriod", @@ -508,13 +465,23 @@ impl ::protobuf::MessageStatic for ActivityPeriod { }) } } + + fn default_instance() -> &'static ActivityPeriod { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ActivityPeriod, + }; + unsafe { + instance.get(ActivityPeriod::new) + } + } } impl ::protobuf::Clear for ActivityPeriod { fn clear(&mut self) { - self.clear_start_year(); - self.clear_end_year(); - self.clear_decade(); + self.start_year = ::std::option::Option::None; + self.end_year = ::std::option::Option::None; + self.decade = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -552,30 +519,30 @@ pub struct Artist { is_portrait_album_cover: ::std::option::Option, portrait_group: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Artist {} +impl<'a> ::std::default::Default for &'a Artist { + fn default() -> &'a Artist { + ::default_instance() + } +} impl Artist { pub fn new() -> Artist { ::std::default::Default::default() } - pub fn default_instance() -> &'static Artist { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Artist, - }; - unsafe { - instance.get(Artist::new) - } - } - // optional bytes gid = 1; + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gid(&mut self) { self.gid.clear(); } @@ -603,23 +570,15 @@ impl Artist { self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gid(&self) -> &[u8] { - match self.gid.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string name = 2; - fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gid - } - fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gid + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string name = 2; - pub fn clear_name(&mut self) { self.name.clear(); } @@ -647,23 +606,12 @@ impl Artist { self.name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_name(&self) -> &str { - match self.name.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional sint32 popularity = 3; - fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.name - } - fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.name + pub fn get_popularity(&self) -> i32 { + self.popularity.unwrap_or(0) } - - // optional sint32 popularity = 3; - pub fn clear_popularity(&mut self) { self.popularity = ::std::option::Option::None; } @@ -677,20 +625,12 @@ impl Artist { self.popularity = ::std::option::Option::Some(v); } - pub fn get_popularity(&self) -> i32 { - self.popularity.unwrap_or(0) - } + // repeated .TopTracks top_track = 4; - fn get_popularity_for_reflect(&self) -> &::std::option::Option { - &self.popularity - } - fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.popularity + pub fn get_top_track(&self) -> &[TopTracks] { + &self.top_track } - - // repeated .TopTracks top_track = 4; - pub fn clear_top_track(&mut self) { self.top_track.clear(); } @@ -710,20 +650,12 @@ impl Artist { ::std::mem::replace(&mut self.top_track, ::protobuf::RepeatedField::new()) } - pub fn get_top_track(&self) -> &[TopTracks] { - &self.top_track - } + // repeated .AlbumGroup album_group = 5; - fn get_top_track_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.top_track - } - fn mut_top_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.top_track + pub fn get_album_group(&self) -> &[AlbumGroup] { + &self.album_group } - - // repeated .AlbumGroup album_group = 5; - pub fn clear_album_group(&mut self) { self.album_group.clear(); } @@ -743,20 +675,12 @@ impl Artist { ::std::mem::replace(&mut self.album_group, ::protobuf::RepeatedField::new()) } - pub fn get_album_group(&self) -> &[AlbumGroup] { - &self.album_group - } + // repeated .AlbumGroup single_group = 6; - fn get_album_group_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.album_group - } - fn mut_album_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.album_group + pub fn get_single_group(&self) -> &[AlbumGroup] { + &self.single_group } - - // repeated .AlbumGroup single_group = 6; - pub fn clear_single_group(&mut self) { self.single_group.clear(); } @@ -776,20 +700,12 @@ impl Artist { ::std::mem::replace(&mut self.single_group, ::protobuf::RepeatedField::new()) } - pub fn get_single_group(&self) -> &[AlbumGroup] { - &self.single_group - } + // repeated .AlbumGroup compilation_group = 7; - fn get_single_group_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.single_group - } - fn mut_single_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.single_group + pub fn get_compilation_group(&self) -> &[AlbumGroup] { + &self.compilation_group } - - // repeated .AlbumGroup compilation_group = 7; - pub fn clear_compilation_group(&mut self) { self.compilation_group.clear(); } @@ -809,20 +725,12 @@ impl Artist { ::std::mem::replace(&mut self.compilation_group, ::protobuf::RepeatedField::new()) } - pub fn get_compilation_group(&self) -> &[AlbumGroup] { - &self.compilation_group - } + // repeated .AlbumGroup appears_on_group = 8; - fn get_compilation_group_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.compilation_group - } - fn mut_compilation_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.compilation_group + pub fn get_appears_on_group(&self) -> &[AlbumGroup] { + &self.appears_on_group } - - // repeated .AlbumGroup appears_on_group = 8; - pub fn clear_appears_on_group(&mut self) { self.appears_on_group.clear(); } @@ -842,20 +750,12 @@ impl Artist { ::std::mem::replace(&mut self.appears_on_group, ::protobuf::RepeatedField::new()) } - pub fn get_appears_on_group(&self) -> &[AlbumGroup] { - &self.appears_on_group - } + // repeated string genre = 9; - fn get_appears_on_group_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.appears_on_group - } - fn mut_appears_on_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.appears_on_group + pub fn get_genre(&self) -> &[::std::string::String] { + &self.genre } - - // repeated string genre = 9; - pub fn clear_genre(&mut self) { self.genre.clear(); } @@ -875,20 +775,12 @@ impl Artist { ::std::mem::replace(&mut self.genre, ::protobuf::RepeatedField::new()) } - pub fn get_genre(&self) -> &[::std::string::String] { - &self.genre - } + // repeated .ExternalId external_id = 10; - fn get_genre_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.genre - } - fn mut_genre_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.genre + pub fn get_external_id(&self) -> &[ExternalId] { + &self.external_id } - - // repeated .ExternalId external_id = 10; - pub fn clear_external_id(&mut self) { self.external_id.clear(); } @@ -908,20 +800,12 @@ impl Artist { ::std::mem::replace(&mut self.external_id, ::protobuf::RepeatedField::new()) } - pub fn get_external_id(&self) -> &[ExternalId] { - &self.external_id - } + // repeated .Image portrait = 11; - fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.external_id - } - fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.external_id + pub fn get_portrait(&self) -> &[Image] { + &self.portrait } - - // repeated .Image portrait = 11; - pub fn clear_portrait(&mut self) { self.portrait.clear(); } @@ -941,20 +825,12 @@ impl Artist { ::std::mem::replace(&mut self.portrait, ::protobuf::RepeatedField::new()) } - pub fn get_portrait(&self) -> &[Image] { - &self.portrait - } + // repeated .Biography biography = 12; - fn get_portrait_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.portrait - } - fn mut_portrait_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.portrait + pub fn get_biography(&self) -> &[Biography] { + &self.biography } - - // repeated .Biography biography = 12; - pub fn clear_biography(&mut self) { self.biography.clear(); } @@ -974,20 +850,12 @@ impl Artist { ::std::mem::replace(&mut self.biography, ::protobuf::RepeatedField::new()) } - pub fn get_biography(&self) -> &[Biography] { - &self.biography - } + // repeated .ActivityPeriod activity_period = 13; - fn get_biography_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.biography - } - fn mut_biography_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.biography + pub fn get_activity_period(&self) -> &[ActivityPeriod] { + &self.activity_period } - - // repeated .ActivityPeriod activity_period = 13; - pub fn clear_activity_period(&mut self) { self.activity_period.clear(); } @@ -1007,20 +875,12 @@ impl Artist { ::std::mem::replace(&mut self.activity_period, ::protobuf::RepeatedField::new()) } - pub fn get_activity_period(&self) -> &[ActivityPeriod] { - &self.activity_period - } + // repeated .Restriction restriction = 14; - fn get_activity_period_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.activity_period - } - fn mut_activity_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.activity_period + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction } - - // repeated .Restriction restriction = 14; - pub fn clear_restriction(&mut self) { self.restriction.clear(); } @@ -1040,20 +900,12 @@ impl Artist { ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) } - pub fn get_restriction(&self) -> &[Restriction] { - &self.restriction - } + // repeated .Artist related = 15; - fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.restriction - } - fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.restriction + pub fn get_related(&self) -> &[Artist] { + &self.related } - - // repeated .Artist related = 15; - pub fn clear_related(&mut self) { self.related.clear(); } @@ -1073,20 +925,12 @@ impl Artist { ::std::mem::replace(&mut self.related, ::protobuf::RepeatedField::new()) } - pub fn get_related(&self) -> &[Artist] { - &self.related - } + // optional bool is_portrait_album_cover = 16; - fn get_related_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.related - } - fn mut_related_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.related + pub fn get_is_portrait_album_cover(&self) -> bool { + self.is_portrait_album_cover.unwrap_or(false) } - - // optional bool is_portrait_album_cover = 16; - pub fn clear_is_portrait_album_cover(&mut self) { self.is_portrait_album_cover = ::std::option::Option::None; } @@ -1100,20 +944,12 @@ impl Artist { self.is_portrait_album_cover = ::std::option::Option::Some(v); } - pub fn get_is_portrait_album_cover(&self) -> bool { - self.is_portrait_album_cover.unwrap_or(false) - } + // optional .ImageGroup portrait_group = 17; - fn get_is_portrait_album_cover_for_reflect(&self) -> &::std::option::Option { - &self.is_portrait_album_cover - } - fn mut_is_portrait_album_cover_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.is_portrait_album_cover + pub fn get_portrait_group(&self) -> &ImageGroup { + self.portrait_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) } - - // optional .ImageGroup portrait_group = 17; - pub fn clear_portrait_group(&mut self) { self.portrait_group.clear(); } @@ -1140,18 +976,6 @@ impl Artist { pub fn take_portrait_group(&mut self) -> ImageGroup { self.portrait_group.take().unwrap_or_else(|| ImageGroup::new()) } - - pub fn get_portrait_group(&self) -> &ImageGroup { - self.portrait_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) - } - - fn get_portrait_group_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.portrait_group - } - - fn mut_portrait_group_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.portrait_group - } } impl ::protobuf::Message for Artist { @@ -1454,27 +1278,25 @@ impl ::protobuf::Message for Artist { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Artist { fn new() -> Artist { Artist::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1484,88 +1306,88 @@ impl ::protobuf::MessageStatic for Artist { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Artist::get_gid_for_reflect, - Artist::mut_gid_for_reflect, + |m: &Artist| { &m.gid }, + |m: &mut Artist| { &mut m.gid }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Artist::get_name_for_reflect, - Artist::mut_name_for_reflect, + |m: &Artist| { &m.name }, + |m: &mut Artist| { &mut m.name }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Artist::get_popularity_for_reflect, - Artist::mut_popularity_for_reflect, + |m: &Artist| { &m.popularity }, + |m: &mut Artist| { &mut m.popularity }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "top_track", - Artist::get_top_track_for_reflect, - Artist::mut_top_track_for_reflect, + |m: &Artist| { &m.top_track }, + |m: &mut Artist| { &mut m.top_track }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album_group", - Artist::get_album_group_for_reflect, - Artist::mut_album_group_for_reflect, + |m: &Artist| { &m.album_group }, + |m: &mut Artist| { &mut m.album_group }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "single_group", - Artist::get_single_group_for_reflect, - Artist::mut_single_group_for_reflect, + |m: &Artist| { &m.single_group }, + |m: &mut Artist| { &mut m.single_group }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "compilation_group", - Artist::get_compilation_group_for_reflect, - Artist::mut_compilation_group_for_reflect, + |m: &Artist| { &m.compilation_group }, + |m: &mut Artist| { &mut m.compilation_group }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "appears_on_group", - Artist::get_appears_on_group_for_reflect, - Artist::mut_appears_on_group_for_reflect, + |m: &Artist| { &m.appears_on_group }, + |m: &mut Artist| { &mut m.appears_on_group }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "genre", - Artist::get_genre_for_reflect, - Artist::mut_genre_for_reflect, + |m: &Artist| { &m.genre }, + |m: &mut Artist| { &mut m.genre }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Artist::get_external_id_for_reflect, - Artist::mut_external_id_for_reflect, + |m: &Artist| { &m.external_id }, + |m: &mut Artist| { &mut m.external_id }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait", - Artist::get_portrait_for_reflect, - Artist::mut_portrait_for_reflect, + |m: &Artist| { &m.portrait }, + |m: &mut Artist| { &mut m.portrait }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "biography", - Artist::get_biography_for_reflect, - Artist::mut_biography_for_reflect, + |m: &Artist| { &m.biography }, + |m: &mut Artist| { &mut m.biography }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "activity_period", - Artist::get_activity_period_for_reflect, - Artist::mut_activity_period_for_reflect, + |m: &Artist| { &m.activity_period }, + |m: &mut Artist| { &mut m.activity_period }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Artist::get_restriction_for_reflect, - Artist::mut_restriction_for_reflect, + |m: &Artist| { &m.restriction }, + |m: &mut Artist| { &mut m.restriction }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "related", - Artist::get_related_for_reflect, - Artist::mut_related_for_reflect, + |m: &Artist| { &m.related }, + |m: &mut Artist| { &mut m.related }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "is_portrait_album_cover", - Artist::get_is_portrait_album_cover_for_reflect, - Artist::mut_is_portrait_album_cover_for_reflect, + |m: &Artist| { &m.is_portrait_album_cover }, + |m: &mut Artist| { &mut m.is_portrait_album_cover }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait_group", - Artist::get_portrait_group_for_reflect, - Artist::mut_portrait_group_for_reflect, + |m: &Artist| { &m.portrait_group }, + |m: &mut Artist| { &mut m.portrait_group }, )); ::protobuf::reflect::MessageDescriptor::new::( "Artist", @@ -1575,27 +1397,37 @@ impl ::protobuf::MessageStatic for Artist { }) } } + + fn default_instance() -> &'static Artist { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Artist, + }; + unsafe { + instance.get(Artist::new) + } + } } impl ::protobuf::Clear for Artist { fn clear(&mut self) { - self.clear_gid(); - self.clear_name(); - self.clear_popularity(); - self.clear_top_track(); - self.clear_album_group(); - self.clear_single_group(); - self.clear_compilation_group(); - self.clear_appears_on_group(); - self.clear_genre(); - self.clear_external_id(); - self.clear_portrait(); - self.clear_biography(); - self.clear_activity_period(); - self.clear_restriction(); - self.clear_related(); - self.clear_is_portrait_album_cover(); - self.clear_portrait_group(); + self.gid.clear(); + self.name.clear(); + self.popularity = ::std::option::Option::None; + self.top_track.clear(); + self.album_group.clear(); + self.single_group.clear(); + self.compilation_group.clear(); + self.appears_on_group.clear(); + self.genre.clear(); + self.external_id.clear(); + self.portrait.clear(); + self.biography.clear(); + self.activity_period.clear(); + self.restriction.clear(); + self.related.clear(); + self.is_portrait_album_cover = ::std::option::Option::None; + self.portrait_group.clear(); self.unknown_fields.clear(); } } @@ -1617,30 +1449,27 @@ pub struct AlbumGroup { // message fields album: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for AlbumGroup {} +impl<'a> ::std::default::Default for &'a AlbumGroup { + fn default() -> &'a AlbumGroup { + ::default_instance() + } +} impl AlbumGroup { pub fn new() -> AlbumGroup { ::std::default::Default::default() } - pub fn default_instance() -> &'static AlbumGroup { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const AlbumGroup, - }; - unsafe { - instance.get(AlbumGroup::new) - } - } - // repeated .Album album = 1; + + pub fn get_album(&self) -> &[Album] { + &self.album + } pub fn clear_album(&mut self) { self.album.clear(); } @@ -1659,18 +1488,6 @@ impl AlbumGroup { pub fn take_album(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.album, ::protobuf::RepeatedField::new()) } - - pub fn get_album(&self) -> &[Album] { - &self.album - } - - fn get_album_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.album - } - - fn mut_album_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.album - } } impl ::protobuf::Message for AlbumGroup { @@ -1733,27 +1550,25 @@ impl ::protobuf::Message for AlbumGroup { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for AlbumGroup { fn new() -> AlbumGroup { AlbumGroup::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1763,8 +1578,8 @@ impl ::protobuf::MessageStatic for AlbumGroup { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album", - AlbumGroup::get_album_for_reflect, - AlbumGroup::mut_album_for_reflect, + |m: &AlbumGroup| { &m.album }, + |m: &mut AlbumGroup| { &mut m.album }, )); ::protobuf::reflect::MessageDescriptor::new::( "AlbumGroup", @@ -1774,11 +1589,21 @@ impl ::protobuf::MessageStatic for AlbumGroup { }) } } + + fn default_instance() -> &'static AlbumGroup { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AlbumGroup, + }; + unsafe { + instance.get(AlbumGroup::new) + } + } } impl ::protobuf::Clear for AlbumGroup { fn clear(&mut self) { - self.clear_album(); + self.album.clear(); self.unknown_fields.clear(); } } @@ -1802,30 +1627,27 @@ pub struct Date { month: ::std::option::Option, day: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Date {} +impl<'a> ::std::default::Default for &'a Date { + fn default() -> &'a Date { + ::default_instance() + } +} impl Date { pub fn new() -> Date { ::std::default::Default::default() } - pub fn default_instance() -> &'static Date { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Date, - }; - unsafe { - instance.get(Date::new) - } - } - // optional sint32 year = 1; + + pub fn get_year(&self) -> i32 { + self.year.unwrap_or(0) + } pub fn clear_year(&mut self) { self.year = ::std::option::Option::None; } @@ -1839,20 +1661,12 @@ impl Date { self.year = ::std::option::Option::Some(v); } - pub fn get_year(&self) -> i32 { - self.year.unwrap_or(0) - } + // optional sint32 month = 2; - fn get_year_for_reflect(&self) -> &::std::option::Option { - &self.year - } - fn mut_year_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.year + pub fn get_month(&self) -> i32 { + self.month.unwrap_or(0) } - - // optional sint32 month = 2; - pub fn clear_month(&mut self) { self.month = ::std::option::Option::None; } @@ -1866,20 +1680,12 @@ impl Date { self.month = ::std::option::Option::Some(v); } - pub fn get_month(&self) -> i32 { - self.month.unwrap_or(0) - } + // optional sint32 day = 3; - fn get_month_for_reflect(&self) -> &::std::option::Option { - &self.month - } - fn mut_month_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.month + pub fn get_day(&self) -> i32 { + self.day.unwrap_or(0) } - - // optional sint32 day = 3; - pub fn clear_day(&mut self) { self.day = ::std::option::Option::None; } @@ -1892,18 +1698,6 @@ impl Date { pub fn set_day(&mut self, v: i32) { self.day = ::std::option::Option::Some(v); } - - pub fn get_day(&self) -> i32 { - self.day.unwrap_or(0) - } - - fn get_day_for_reflect(&self) -> &::std::option::Option { - &self.day - } - - fn mut_day_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.day - } } impl ::protobuf::Message for Date { @@ -1988,27 +1782,25 @@ impl ::protobuf::Message for Date { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Date { fn new() -> Date { Date::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2018,18 +1810,18 @@ impl ::protobuf::MessageStatic for Date { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "year", - Date::get_year_for_reflect, - Date::mut_year_for_reflect, + |m: &Date| { &m.year }, + |m: &mut Date| { &mut m.year }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "month", - Date::get_month_for_reflect, - Date::mut_month_for_reflect, + |m: &Date| { &m.month }, + |m: &mut Date| { &mut m.month }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "day", - Date::get_day_for_reflect, - Date::mut_day_for_reflect, + |m: &Date| { &m.day }, + |m: &mut Date| { &mut m.day }, )); ::protobuf::reflect::MessageDescriptor::new::( "Date", @@ -2039,13 +1831,23 @@ impl ::protobuf::MessageStatic for Date { }) } } + + fn default_instance() -> &'static Date { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Date, + }; + unsafe { + instance.get(Date::new) + } + } } impl ::protobuf::Clear for Date { fn clear(&mut self) { - self.clear_year(); - self.clear_month(); - self.clear_day(); + self.year = ::std::option::Option::None; + self.month = ::std::option::Option::None; + self.day = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -2083,30 +1885,30 @@ pub struct Album { sale_period: ::protobuf::RepeatedField, cover_group: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Album {} - -impl Album { - pub fn new() -> Album { - ::std::default::Default::default() +impl<'a> ::std::default::Default for &'a Album { + fn default() -> &'a Album { + ::default_instance() } +} - pub fn default_instance() -> &'static Album { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Album, - }; - unsafe { - instance.get(Album::new) - } +impl Album { + pub fn new() -> Album { + ::std::default::Default::default() } // optional bytes gid = 1; + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gid(&mut self) { self.gid.clear(); } @@ -2134,23 +1936,15 @@ impl Album { self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gid(&self) -> &[u8] { - match self.gid.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string name = 2; - fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gid - } - fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gid + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string name = 2; - pub fn clear_name(&mut self) { self.name.clear(); } @@ -2178,23 +1972,12 @@ impl Album { self.name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_name(&self) -> &str { - match self.name.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Artist artist = 3; - fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.name - } - fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.name + pub fn get_artist(&self) -> &[Artist] { + &self.artist } - - // repeated .Artist artist = 3; - pub fn clear_artist(&mut self) { self.artist.clear(); } @@ -2214,20 +1997,12 @@ impl Album { ::std::mem::replace(&mut self.artist, ::protobuf::RepeatedField::new()) } - pub fn get_artist(&self) -> &[Artist] { - &self.artist - } + // optional .Album.Type typ = 4; - fn get_artist_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.artist - } - fn mut_artist_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.artist + pub fn get_typ(&self) -> Album_Type { + self.typ.unwrap_or(Album_Type::ALBUM) } - - // optional .Album.Type typ = 4; - pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -2241,20 +2016,15 @@ impl Album { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> Album_Type { - self.typ.unwrap_or(Album_Type::ALBUM) - } + // optional string label = 5; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_label(&self) -> &str { + match self.label.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string label = 5; - pub fn clear_label(&mut self) { self.label.clear(); } @@ -2282,23 +2052,12 @@ impl Album { self.label.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_label(&self) -> &str { - match self.label.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .Date date = 6; - fn get_label_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.label - } - fn mut_label_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.label + pub fn get_date(&self) -> &Date { + self.date.as_ref().unwrap_or_else(|| Date::default_instance()) } - - // optional .Date date = 6; - pub fn clear_date(&mut self) { self.date.clear(); } @@ -2326,20 +2085,12 @@ impl Album { self.date.take().unwrap_or_else(|| Date::new()) } - pub fn get_date(&self) -> &Date { - self.date.as_ref().unwrap_or_else(|| Date::default_instance()) - } + // optional sint32 popularity = 7; - fn get_date_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.date - } - fn mut_date_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.date + pub fn get_popularity(&self) -> i32 { + self.popularity.unwrap_or(0) } - - // optional sint32 popularity = 7; - pub fn clear_popularity(&mut self) { self.popularity = ::std::option::Option::None; } @@ -2353,20 +2104,12 @@ impl Album { self.popularity = ::std::option::Option::Some(v); } - pub fn get_popularity(&self) -> i32 { - self.popularity.unwrap_or(0) - } + // repeated string genre = 8; - fn get_popularity_for_reflect(&self) -> &::std::option::Option { - &self.popularity - } - fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.popularity + pub fn get_genre(&self) -> &[::std::string::String] { + &self.genre } - - // repeated string genre = 8; - pub fn clear_genre(&mut self) { self.genre.clear(); } @@ -2386,20 +2129,12 @@ impl Album { ::std::mem::replace(&mut self.genre, ::protobuf::RepeatedField::new()) } - pub fn get_genre(&self) -> &[::std::string::String] { - &self.genre - } + // repeated .Image cover = 9; - fn get_genre_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.genre - } - fn mut_genre_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.genre + pub fn get_cover(&self) -> &[Image] { + &self.cover } - - // repeated .Image cover = 9; - pub fn clear_cover(&mut self) { self.cover.clear(); } @@ -2419,20 +2154,12 @@ impl Album { ::std::mem::replace(&mut self.cover, ::protobuf::RepeatedField::new()) } - pub fn get_cover(&self) -> &[Image] { - &self.cover - } + // repeated .ExternalId external_id = 10; - fn get_cover_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.cover - } - fn mut_cover_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.cover + pub fn get_external_id(&self) -> &[ExternalId] { + &self.external_id } - - // repeated .ExternalId external_id = 10; - pub fn clear_external_id(&mut self) { self.external_id.clear(); } @@ -2452,20 +2179,12 @@ impl Album { ::std::mem::replace(&mut self.external_id, ::protobuf::RepeatedField::new()) } - pub fn get_external_id(&self) -> &[ExternalId] { - &self.external_id - } + // repeated .Disc disc = 11; - fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.external_id - } - fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.external_id + pub fn get_disc(&self) -> &[Disc] { + &self.disc } - - // repeated .Disc disc = 11; - pub fn clear_disc(&mut self) { self.disc.clear(); } @@ -2485,20 +2204,12 @@ impl Album { ::std::mem::replace(&mut self.disc, ::protobuf::RepeatedField::new()) } - pub fn get_disc(&self) -> &[Disc] { - &self.disc - } + // repeated string review = 12; - fn get_disc_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.disc - } - fn mut_disc_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.disc + pub fn get_review(&self) -> &[::std::string::String] { + &self.review } - - // repeated string review = 12; - pub fn clear_review(&mut self) { self.review.clear(); } @@ -2518,20 +2229,12 @@ impl Album { ::std::mem::replace(&mut self.review, ::protobuf::RepeatedField::new()) } - pub fn get_review(&self) -> &[::std::string::String] { - &self.review - } + // repeated .Copyright copyright = 13; - fn get_review_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.review - } - fn mut_review_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.review + pub fn get_copyright(&self) -> &[Copyright] { + &self.copyright } - - // repeated .Copyright copyright = 13; - pub fn clear_copyright(&mut self) { self.copyright.clear(); } @@ -2551,20 +2254,12 @@ impl Album { ::std::mem::replace(&mut self.copyright, ::protobuf::RepeatedField::new()) } - pub fn get_copyright(&self) -> &[Copyright] { - &self.copyright - } + // repeated .Restriction restriction = 14; - fn get_copyright_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.copyright - } - fn mut_copyright_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.copyright + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction } - - // repeated .Restriction restriction = 14; - pub fn clear_restriction(&mut self) { self.restriction.clear(); } @@ -2584,20 +2279,12 @@ impl Album { ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) } - pub fn get_restriction(&self) -> &[Restriction] { - &self.restriction - } + // repeated .Album related = 15; - fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.restriction - } - fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.restriction + pub fn get_related(&self) -> &[Album] { + &self.related } - - // repeated .Album related = 15; - pub fn clear_related(&mut self) { self.related.clear(); } @@ -2617,20 +2304,12 @@ impl Album { ::std::mem::replace(&mut self.related, ::protobuf::RepeatedField::new()) } - pub fn get_related(&self) -> &[Album] { - &self.related - } + // repeated .SalePeriod sale_period = 16; - fn get_related_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.related - } - fn mut_related_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.related + pub fn get_sale_period(&self) -> &[SalePeriod] { + &self.sale_period } - - // repeated .SalePeriod sale_period = 16; - pub fn clear_sale_period(&mut self) { self.sale_period.clear(); } @@ -2650,20 +2329,12 @@ impl Album { ::std::mem::replace(&mut self.sale_period, ::protobuf::RepeatedField::new()) } - pub fn get_sale_period(&self) -> &[SalePeriod] { - &self.sale_period - } + // optional .ImageGroup cover_group = 17; - fn get_sale_period_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.sale_period - } - fn mut_sale_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.sale_period + pub fn get_cover_group(&self) -> &ImageGroup { + self.cover_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) } - - // optional .ImageGroup cover_group = 17; - pub fn clear_cover_group(&mut self) { self.cover_group.clear(); } @@ -2690,18 +2361,6 @@ impl Album { pub fn take_cover_group(&mut self) -> ImageGroup { self.cover_group.take().unwrap_or_else(|| ImageGroup::new()) } - - pub fn get_cover_group(&self) -> &ImageGroup { - self.cover_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) - } - - fn get_cover_group_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.cover_group - } - - fn mut_cover_group_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.cover_group - } } impl ::protobuf::Message for Album { @@ -2773,11 +2432,7 @@ impl ::protobuf::Message for Album { ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.artist)?; }, 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 4, &mut self.unknown_fields)? }, 5 => { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; @@ -2988,27 +2643,25 @@ impl ::protobuf::Message for Album { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Album { fn new() -> Album { Album::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3018,88 +2671,88 @@ impl ::protobuf::MessageStatic for Album { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Album::get_gid_for_reflect, - Album::mut_gid_for_reflect, + |m: &Album| { &m.gid }, + |m: &mut Album| { &mut m.gid }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Album::get_name_for_reflect, - Album::mut_name_for_reflect, + |m: &Album| { &m.name }, + |m: &mut Album| { &mut m.name }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "artist", - Album::get_artist_for_reflect, - Album::mut_artist_for_reflect, + |m: &Album| { &m.artist }, + |m: &mut Album| { &mut m.artist }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Album::get_typ_for_reflect, - Album::mut_typ_for_reflect, + |m: &Album| { &m.typ }, + |m: &mut Album| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "label", - Album::get_label_for_reflect, - Album::mut_label_for_reflect, + |m: &Album| { &m.label }, + |m: &mut Album| { &mut m.label }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "date", - Album::get_date_for_reflect, - Album::mut_date_for_reflect, + |m: &Album| { &m.date }, + |m: &mut Album| { &mut m.date }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Album::get_popularity_for_reflect, - Album::mut_popularity_for_reflect, + |m: &Album| { &m.popularity }, + |m: &mut Album| { &mut m.popularity }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "genre", - Album::get_genre_for_reflect, - Album::mut_genre_for_reflect, + |m: &Album| { &m.genre }, + |m: &mut Album| { &mut m.genre }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "cover", - Album::get_cover_for_reflect, - Album::mut_cover_for_reflect, + |m: &Album| { &m.cover }, + |m: &mut Album| { &mut m.cover }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Album::get_external_id_for_reflect, - Album::mut_external_id_for_reflect, + |m: &Album| { &m.external_id }, + |m: &mut Album| { &mut m.external_id }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "disc", - Album::get_disc_for_reflect, - Album::mut_disc_for_reflect, + |m: &Album| { &m.disc }, + |m: &mut Album| { &mut m.disc }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "review", - Album::get_review_for_reflect, - Album::mut_review_for_reflect, + |m: &Album| { &m.review }, + |m: &mut Album| { &mut m.review }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "copyright", - Album::get_copyright_for_reflect, - Album::mut_copyright_for_reflect, + |m: &Album| { &m.copyright }, + |m: &mut Album| { &mut m.copyright }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Album::get_restriction_for_reflect, - Album::mut_restriction_for_reflect, + |m: &Album| { &m.restriction }, + |m: &mut Album| { &mut m.restriction }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "related", - Album::get_related_for_reflect, - Album::mut_related_for_reflect, + |m: &Album| { &m.related }, + |m: &mut Album| { &mut m.related }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "sale_period", - Album::get_sale_period_for_reflect, - Album::mut_sale_period_for_reflect, + |m: &Album| { &m.sale_period }, + |m: &mut Album| { &mut m.sale_period }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "cover_group", - Album::get_cover_group_for_reflect, - Album::mut_cover_group_for_reflect, + |m: &Album| { &m.cover_group }, + |m: &mut Album| { &mut m.cover_group }, )); ::protobuf::reflect::MessageDescriptor::new::( "Album", @@ -3109,27 +2762,37 @@ impl ::protobuf::MessageStatic for Album { }) } } + + fn default_instance() -> &'static Album { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Album, + }; + unsafe { + instance.get(Album::new) + } + } } impl ::protobuf::Clear for Album { fn clear(&mut self) { - self.clear_gid(); - self.clear_name(); - self.clear_artist(); - self.clear_typ(); - self.clear_label(); - self.clear_date(); - self.clear_popularity(); - self.clear_genre(); - self.clear_cover(); - self.clear_external_id(); - self.clear_disc(); - self.clear_review(); - self.clear_copyright(); - self.clear_restriction(); - self.clear_related(); - self.clear_sale_period(); - self.clear_cover_group(); + self.gid.clear(); + self.name.clear(); + self.artist.clear(); + self.typ = ::std::option::Option::None; + self.label.clear(); + self.date.clear(); + self.popularity = ::std::option::Option::None; + self.genre.clear(); + self.cover.clear(); + self.external_id.clear(); + self.disc.clear(); + self.review.clear(); + self.copyright.clear(); + self.restriction.clear(); + self.related.clear(); + self.sale_period.clear(); + self.cover_group.clear(); self.unknown_fields.clear(); } } @@ -3179,7 +2842,7 @@ impl ::protobuf::ProtobufEnum for Album_Type { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -3195,6 +2858,13 @@ impl ::protobuf::ProtobufEnum for Album_Type { impl ::std::marker::Copy for Album_Type { } +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for Album_Type { + fn default() -> Self { + Album_Type::ALBUM + } +} + impl ::protobuf::reflect::ProtobufValue for Album_Type { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -3220,30 +2890,30 @@ pub struct Track { sale_period: ::protobuf::RepeatedField, preview: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Track {} +impl<'a> ::std::default::Default for &'a Track { + fn default() -> &'a Track { + ::default_instance() + } +} impl Track { pub fn new() -> Track { ::std::default::Default::default() } - pub fn default_instance() -> &'static Track { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Track, - }; - unsafe { - instance.get(Track::new) - } - } - // optional bytes gid = 1; + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gid(&mut self) { self.gid.clear(); } @@ -3271,23 +2941,15 @@ impl Track { self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gid(&self) -> &[u8] { - match self.gid.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string name = 2; - fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gid - } - fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gid + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string name = 2; - pub fn clear_name(&mut self) { self.name.clear(); } @@ -3315,23 +2977,12 @@ impl Track { self.name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_name(&self) -> &str { - match self.name.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .Album album = 3; - fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.name - } - fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.name + pub fn get_album(&self) -> &Album { + self.album.as_ref().unwrap_or_else(|| Album::default_instance()) } - - // optional .Album album = 3; - pub fn clear_album(&mut self) { self.album.clear(); } @@ -3359,20 +3010,12 @@ impl Track { self.album.take().unwrap_or_else(|| Album::new()) } - pub fn get_album(&self) -> &Album { - self.album.as_ref().unwrap_or_else(|| Album::default_instance()) - } + // repeated .Artist artist = 4; - fn get_album_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.album - } - fn mut_album_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.album + pub fn get_artist(&self) -> &[Artist] { + &self.artist } - - // repeated .Artist artist = 4; - pub fn clear_artist(&mut self) { self.artist.clear(); } @@ -3392,20 +3035,12 @@ impl Track { ::std::mem::replace(&mut self.artist, ::protobuf::RepeatedField::new()) } - pub fn get_artist(&self) -> &[Artist] { - &self.artist - } + // optional sint32 number = 5; - fn get_artist_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.artist - } - fn mut_artist_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.artist + pub fn get_number(&self) -> i32 { + self.number.unwrap_or(0) } - - // optional sint32 number = 5; - pub fn clear_number(&mut self) { self.number = ::std::option::Option::None; } @@ -3419,20 +3054,12 @@ impl Track { self.number = ::std::option::Option::Some(v); } - pub fn get_number(&self) -> i32 { - self.number.unwrap_or(0) - } + // optional sint32 disc_number = 6; - fn get_number_for_reflect(&self) -> &::std::option::Option { - &self.number - } - fn mut_number_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.number + pub fn get_disc_number(&self) -> i32 { + self.disc_number.unwrap_or(0) } - - // optional sint32 disc_number = 6; - pub fn clear_disc_number(&mut self) { self.disc_number = ::std::option::Option::None; } @@ -3446,20 +3073,12 @@ impl Track { self.disc_number = ::std::option::Option::Some(v); } - pub fn get_disc_number(&self) -> i32 { - self.disc_number.unwrap_or(0) - } + // optional sint32 duration = 7; - fn get_disc_number_for_reflect(&self) -> &::std::option::Option { - &self.disc_number - } - fn mut_disc_number_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.disc_number + pub fn get_duration(&self) -> i32 { + self.duration.unwrap_or(0) } - - // optional sint32 duration = 7; - pub fn clear_duration(&mut self) { self.duration = ::std::option::Option::None; } @@ -3473,20 +3092,12 @@ impl Track { self.duration = ::std::option::Option::Some(v); } - pub fn get_duration(&self) -> i32 { - self.duration.unwrap_or(0) - } + // optional sint32 popularity = 8; - fn get_duration_for_reflect(&self) -> &::std::option::Option { - &self.duration - } - fn mut_duration_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.duration + pub fn get_popularity(&self) -> i32 { + self.popularity.unwrap_or(0) } - - // optional sint32 popularity = 8; - pub fn clear_popularity(&mut self) { self.popularity = ::std::option::Option::None; } @@ -3500,20 +3111,12 @@ impl Track { self.popularity = ::std::option::Option::Some(v); } - pub fn get_popularity(&self) -> i32 { - self.popularity.unwrap_or(0) - } + // optional bool explicit = 9; - fn get_popularity_for_reflect(&self) -> &::std::option::Option { - &self.popularity - } - fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.popularity + pub fn get_explicit(&self) -> bool { + self.explicit.unwrap_or(false) } - - // optional bool explicit = 9; - pub fn clear_explicit(&mut self) { self.explicit = ::std::option::Option::None; } @@ -3527,20 +3130,12 @@ impl Track { self.explicit = ::std::option::Option::Some(v); } - pub fn get_explicit(&self) -> bool { - self.explicit.unwrap_or(false) - } + // repeated .ExternalId external_id = 10; - fn get_explicit_for_reflect(&self) -> &::std::option::Option { - &self.explicit - } - fn mut_explicit_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.explicit + pub fn get_external_id(&self) -> &[ExternalId] { + &self.external_id } - - // repeated .ExternalId external_id = 10; - pub fn clear_external_id(&mut self) { self.external_id.clear(); } @@ -3560,20 +3155,12 @@ impl Track { ::std::mem::replace(&mut self.external_id, ::protobuf::RepeatedField::new()) } - pub fn get_external_id(&self) -> &[ExternalId] { - &self.external_id - } + // repeated .Restriction restriction = 11; - fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.external_id - } - fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.external_id + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction } - - // repeated .Restriction restriction = 11; - pub fn clear_restriction(&mut self) { self.restriction.clear(); } @@ -3593,20 +3180,12 @@ impl Track { ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) } - pub fn get_restriction(&self) -> &[Restriction] { - &self.restriction - } + // repeated .AudioFile file = 12; - fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.restriction - } - fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.restriction + pub fn get_file(&self) -> &[AudioFile] { + &self.file } - - // repeated .AudioFile file = 12; - pub fn clear_file(&mut self) { self.file.clear(); } @@ -3626,20 +3205,12 @@ impl Track { ::std::mem::replace(&mut self.file, ::protobuf::RepeatedField::new()) } - pub fn get_file(&self) -> &[AudioFile] { - &self.file - } + // repeated .Track alternative = 13; - fn get_file_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.file - } - fn mut_file_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.file + pub fn get_alternative(&self) -> &[Track] { + &self.alternative } - - // repeated .Track alternative = 13; - pub fn clear_alternative(&mut self) { self.alternative.clear(); } @@ -3659,20 +3230,12 @@ impl Track { ::std::mem::replace(&mut self.alternative, ::protobuf::RepeatedField::new()) } - pub fn get_alternative(&self) -> &[Track] { - &self.alternative - } + // repeated .SalePeriod sale_period = 14; - fn get_alternative_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.alternative - } - fn mut_alternative_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.alternative + pub fn get_sale_period(&self) -> &[SalePeriod] { + &self.sale_period } - - // repeated .SalePeriod sale_period = 14; - pub fn clear_sale_period(&mut self) { self.sale_period.clear(); } @@ -3692,20 +3255,12 @@ impl Track { ::std::mem::replace(&mut self.sale_period, ::protobuf::RepeatedField::new()) } - pub fn get_sale_period(&self) -> &[SalePeriod] { - &self.sale_period - } + // repeated .AudioFile preview = 15; - fn get_sale_period_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.sale_period - } - fn mut_sale_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.sale_period + pub fn get_preview(&self) -> &[AudioFile] { + &self.preview } - - // repeated .AudioFile preview = 15; - pub fn clear_preview(&mut self) { self.preview.clear(); } @@ -3724,18 +3279,6 @@ impl Track { pub fn take_preview(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.preview, ::protobuf::RepeatedField::new()) } - - pub fn get_preview(&self) -> &[AudioFile] { - &self.preview - } - - fn get_preview_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.preview - } - - fn mut_preview_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.preview - } } impl ::protobuf::Message for Track { @@ -4000,27 +3543,25 @@ impl ::protobuf::Message for Track { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Track { fn new() -> Track { Track::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4030,78 +3571,78 @@ impl ::protobuf::MessageStatic for Track { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Track::get_gid_for_reflect, - Track::mut_gid_for_reflect, + |m: &Track| { &m.gid }, + |m: &mut Track| { &mut m.gid }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Track::get_name_for_reflect, - Track::mut_name_for_reflect, + |m: &Track| { &m.name }, + |m: &mut Track| { &mut m.name }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album", - Track::get_album_for_reflect, - Track::mut_album_for_reflect, + |m: &Track| { &m.album }, + |m: &mut Track| { &mut m.album }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "artist", - Track::get_artist_for_reflect, - Track::mut_artist_for_reflect, + |m: &Track| { &m.artist }, + |m: &mut Track| { &mut m.artist }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "number", - Track::get_number_for_reflect, - Track::mut_number_for_reflect, + |m: &Track| { &m.number }, + |m: &mut Track| { &mut m.number }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "disc_number", - Track::get_disc_number_for_reflect, - Track::mut_disc_number_for_reflect, + |m: &Track| { &m.disc_number }, + |m: &mut Track| { &mut m.disc_number }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "duration", - Track::get_duration_for_reflect, - Track::mut_duration_for_reflect, + |m: &Track| { &m.duration }, + |m: &mut Track| { &mut m.duration }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Track::get_popularity_for_reflect, - Track::mut_popularity_for_reflect, + |m: &Track| { &m.popularity }, + |m: &mut Track| { &mut m.popularity }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "explicit", - Track::get_explicit_for_reflect, - Track::mut_explicit_for_reflect, + |m: &Track| { &m.explicit }, + |m: &mut Track| { &mut m.explicit }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Track::get_external_id_for_reflect, - Track::mut_external_id_for_reflect, + |m: &Track| { &m.external_id }, + |m: &mut Track| { &mut m.external_id }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Track::get_restriction_for_reflect, - Track::mut_restriction_for_reflect, + |m: &Track| { &m.restriction }, + |m: &mut Track| { &mut m.restriction }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "file", - Track::get_file_for_reflect, - Track::mut_file_for_reflect, + |m: &Track| { &m.file }, + |m: &mut Track| { &mut m.file }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "alternative", - Track::get_alternative_for_reflect, - Track::mut_alternative_for_reflect, + |m: &Track| { &m.alternative }, + |m: &mut Track| { &mut m.alternative }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "sale_period", - Track::get_sale_period_for_reflect, - Track::mut_sale_period_for_reflect, + |m: &Track| { &m.sale_period }, + |m: &mut Track| { &mut m.sale_period }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "preview", - Track::get_preview_for_reflect, - Track::mut_preview_for_reflect, + |m: &Track| { &m.preview }, + |m: &mut Track| { &mut m.preview }, )); ::protobuf::reflect::MessageDescriptor::new::( "Track", @@ -4111,25 +3652,35 @@ impl ::protobuf::MessageStatic for Track { }) } } + + fn default_instance() -> &'static Track { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Track, + }; + unsafe { + instance.get(Track::new) + } + } } impl ::protobuf::Clear for Track { fn clear(&mut self) { - self.clear_gid(); - self.clear_name(); - self.clear_album(); - self.clear_artist(); - self.clear_number(); - self.clear_disc_number(); - self.clear_duration(); - self.clear_popularity(); - self.clear_explicit(); - self.clear_external_id(); - self.clear_restriction(); - self.clear_file(); - self.clear_alternative(); - self.clear_sale_period(); - self.clear_preview(); + self.gid.clear(); + self.name.clear(); + self.album.clear(); + self.artist.clear(); + self.number = ::std::option::Option::None; + self.disc_number = ::std::option::Option::None; + self.duration = ::std::option::Option::None; + self.popularity = ::std::option::Option::None; + self.explicit = ::std::option::Option::None; + self.external_id.clear(); + self.restriction.clear(); + self.file.clear(); + self.alternative.clear(); + self.sale_period.clear(); + self.preview.clear(); self.unknown_fields.clear(); } } @@ -4154,30 +3705,30 @@ pub struct Image { width: ::std::option::Option, height: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Image {} +impl<'a> ::std::default::Default for &'a Image { + fn default() -> &'a Image { + ::default_instance() + } +} impl Image { pub fn new() -> Image { ::std::default::Default::default() } - pub fn default_instance() -> &'static Image { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Image, - }; - unsafe { - instance.get(Image::new) - } - } - // optional bytes file_id = 1; + + pub fn get_file_id(&self) -> &[u8] { + match self.file_id.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_file_id(&mut self) { self.file_id.clear(); } @@ -4205,23 +3756,12 @@ impl Image { self.file_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_file_id(&self) -> &[u8] { - match self.file_id.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional .Image.Size size = 2; - fn get_file_id_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.file_id - } - fn mut_file_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.file_id + pub fn get_size(&self) -> Image_Size { + self.size.unwrap_or(Image_Size::DEFAULT) } - - // optional .Image.Size size = 2; - pub fn clear_size(&mut self) { self.size = ::std::option::Option::None; } @@ -4235,20 +3775,12 @@ impl Image { self.size = ::std::option::Option::Some(v); } - pub fn get_size(&self) -> Image_Size { - self.size.unwrap_or(Image_Size::DEFAULT) - } + // optional sint32 width = 3; - fn get_size_for_reflect(&self) -> &::std::option::Option { - &self.size - } - fn mut_size_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.size + pub fn get_width(&self) -> i32 { + self.width.unwrap_or(0) } - - // optional sint32 width = 3; - pub fn clear_width(&mut self) { self.width = ::std::option::Option::None; } @@ -4258,24 +3790,16 @@ impl Image { } // Param is passed by value, moved - pub fn set_width(&mut self, v: i32) { - self.width = ::std::option::Option::Some(v); - } - - pub fn get_width(&self) -> i32 { - self.width.unwrap_or(0) - } - - fn get_width_for_reflect(&self) -> &::std::option::Option { - &self.width - } - - fn mut_width_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.width + pub fn set_width(&mut self, v: i32) { + self.width = ::std::option::Option::Some(v); } // optional sint32 height = 4; + + pub fn get_height(&self) -> i32 { + self.height.unwrap_or(0) + } pub fn clear_height(&mut self) { self.height = ::std::option::Option::None; } @@ -4288,18 +3812,6 @@ impl Image { pub fn set_height(&mut self, v: i32) { self.height = ::std::option::Option::Some(v); } - - pub fn get_height(&self) -> i32 { - self.height.unwrap_or(0) - } - - fn get_height_for_reflect(&self) -> &::std::option::Option { - &self.height - } - - fn mut_height_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.height - } } impl ::protobuf::Message for Image { @@ -4315,11 +3827,7 @@ impl ::protobuf::Message for Image { ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)?; }, 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.size = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.size, 2, &mut self.unknown_fields)? }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -4393,27 +3901,25 @@ impl ::protobuf::Message for Image { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Image { fn new() -> Image { Image::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4423,23 +3929,23 @@ impl ::protobuf::MessageStatic for Image { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "file_id", - Image::get_file_id_for_reflect, - Image::mut_file_id_for_reflect, + |m: &Image| { &m.file_id }, + |m: &mut Image| { &mut m.file_id }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "size", - Image::get_size_for_reflect, - Image::mut_size_for_reflect, + |m: &Image| { &m.size }, + |m: &mut Image| { &mut m.size }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "width", - Image::get_width_for_reflect, - Image::mut_width_for_reflect, + |m: &Image| { &m.width }, + |m: &mut Image| { &mut m.width }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "height", - Image::get_height_for_reflect, - Image::mut_height_for_reflect, + |m: &Image| { &m.height }, + |m: &mut Image| { &mut m.height }, )); ::protobuf::reflect::MessageDescriptor::new::( "Image", @@ -4449,14 +3955,24 @@ impl ::protobuf::MessageStatic for Image { }) } } + + fn default_instance() -> &'static Image { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Image, + }; + unsafe { + instance.get(Image::new) + } + } } impl ::protobuf::Clear for Image { fn clear(&mut self) { - self.clear_file_id(); - self.clear_size(); - self.clear_width(); - self.clear_height(); + self.file_id.clear(); + self.size = ::std::option::Option::None; + self.width = ::std::option::Option::None; + self.height = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -4506,7 +4022,7 @@ impl ::protobuf::ProtobufEnum for Image_Size { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -4522,6 +4038,12 @@ impl ::protobuf::ProtobufEnum for Image_Size { impl ::std::marker::Copy for Image_Size { } +impl ::std::default::Default for Image_Size { + fn default() -> Self { + Image_Size::DEFAULT + } +} + impl ::protobuf::reflect::ProtobufValue for Image_Size { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -4533,30 +4055,27 @@ pub struct ImageGroup { // message fields image: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ImageGroup {} +impl<'a> ::std::default::Default for &'a ImageGroup { + fn default() -> &'a ImageGroup { + ::default_instance() + } +} impl ImageGroup { pub fn new() -> ImageGroup { ::std::default::Default::default() } - pub fn default_instance() -> &'static ImageGroup { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ImageGroup, - }; - unsafe { - instance.get(ImageGroup::new) - } - } - // repeated .Image image = 1; + + pub fn get_image(&self) -> &[Image] { + &self.image + } pub fn clear_image(&mut self) { self.image.clear(); } @@ -4575,18 +4094,6 @@ impl ImageGroup { pub fn take_image(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.image, ::protobuf::RepeatedField::new()) } - - pub fn get_image(&self) -> &[Image] { - &self.image - } - - fn get_image_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.image - } - - fn mut_image_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.image - } } impl ::protobuf::Message for ImageGroup { @@ -4649,27 +4156,25 @@ impl ::protobuf::Message for ImageGroup { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ImageGroup { fn new() -> ImageGroup { ImageGroup::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4679,8 +4184,8 @@ impl ::protobuf::MessageStatic for ImageGroup { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "image", - ImageGroup::get_image_for_reflect, - ImageGroup::mut_image_for_reflect, + |m: &ImageGroup| { &m.image }, + |m: &mut ImageGroup| { &mut m.image }, )); ::protobuf::reflect::MessageDescriptor::new::( "ImageGroup", @@ -4690,11 +4195,21 @@ impl ::protobuf::MessageStatic for ImageGroup { }) } } + + fn default_instance() -> &'static ImageGroup { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ImageGroup, + }; + unsafe { + instance.get(ImageGroup::new) + } + } } impl ::protobuf::Clear for ImageGroup { fn clear(&mut self) { - self.clear_image(); + self.image.clear(); self.unknown_fields.clear(); } } @@ -4718,30 +4233,30 @@ pub struct Biography { portrait: ::protobuf::RepeatedField, portrait_group: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Biography {} +impl<'a> ::std::default::Default for &'a Biography { + fn default() -> &'a Biography { + ::default_instance() + } +} impl Biography { pub fn new() -> Biography { ::std::default::Default::default() } - pub fn default_instance() -> &'static Biography { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Biography, - }; - unsafe { - instance.get(Biography::new) - } - } - // optional string text = 1; + + pub fn get_text(&self) -> &str { + match self.text.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_text(&mut self) { self.text.clear(); } @@ -4769,23 +4284,12 @@ impl Biography { self.text.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_text(&self) -> &str { - match self.text.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Image portrait = 2; - fn get_text_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.text - } - fn mut_text_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.text + pub fn get_portrait(&self) -> &[Image] { + &self.portrait } - - // repeated .Image portrait = 2; - pub fn clear_portrait(&mut self) { self.portrait.clear(); } @@ -4805,20 +4309,12 @@ impl Biography { ::std::mem::replace(&mut self.portrait, ::protobuf::RepeatedField::new()) } - pub fn get_portrait(&self) -> &[Image] { - &self.portrait - } + // repeated .ImageGroup portrait_group = 3; - fn get_portrait_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.portrait - } - fn mut_portrait_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.portrait + pub fn get_portrait_group(&self) -> &[ImageGroup] { + &self.portrait_group } - - // repeated .ImageGroup portrait_group = 3; - pub fn clear_portrait_group(&mut self) { self.portrait_group.clear(); } @@ -4837,18 +4333,6 @@ impl Biography { pub fn take_portrait_group(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.portrait_group, ::protobuf::RepeatedField::new()) } - - pub fn get_portrait_group(&self) -> &[ImageGroup] { - &self.portrait_group - } - - fn get_portrait_group_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.portrait_group - } - - fn mut_portrait_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.portrait_group - } } impl ::protobuf::Message for Biography { @@ -4937,27 +4421,25 @@ impl ::protobuf::Message for Biography { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Biography { fn new() -> Biography { Biography::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4967,18 +4449,18 @@ impl ::protobuf::MessageStatic for Biography { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "text", - Biography::get_text_for_reflect, - Biography::mut_text_for_reflect, + |m: &Biography| { &m.text }, + |m: &mut Biography| { &mut m.text }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait", - Biography::get_portrait_for_reflect, - Biography::mut_portrait_for_reflect, + |m: &Biography| { &m.portrait }, + |m: &mut Biography| { &mut m.portrait }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait_group", - Biography::get_portrait_group_for_reflect, - Biography::mut_portrait_group_for_reflect, + |m: &Biography| { &m.portrait_group }, + |m: &mut Biography| { &mut m.portrait_group }, )); ::protobuf::reflect::MessageDescriptor::new::( "Biography", @@ -4988,13 +4470,23 @@ impl ::protobuf::MessageStatic for Biography { }) } } + + fn default_instance() -> &'static Biography { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Biography, + }; + unsafe { + instance.get(Biography::new) + } + } } impl ::protobuf::Clear for Biography { fn clear(&mut self) { - self.clear_text(); - self.clear_portrait(); - self.clear_portrait_group(); + self.text.clear(); + self.portrait.clear(); + self.portrait_group.clear(); self.unknown_fields.clear(); } } @@ -5018,30 +4510,27 @@ pub struct Disc { name: ::protobuf::SingularField<::std::string::String>, track: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Disc {} +impl<'a> ::std::default::Default for &'a Disc { + fn default() -> &'a Disc { + ::default_instance() + } +} impl Disc { pub fn new() -> Disc { ::std::default::Default::default() } - pub fn default_instance() -> &'static Disc { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Disc, - }; - unsafe { - instance.get(Disc::new) - } - } - // optional sint32 number = 1; + + pub fn get_number(&self) -> i32 { + self.number.unwrap_or(0) + } pub fn clear_number(&mut self) { self.number = ::std::option::Option::None; } @@ -5055,20 +4544,15 @@ impl Disc { self.number = ::std::option::Option::Some(v); } - pub fn get_number(&self) -> i32 { - self.number.unwrap_or(0) - } + // optional string name = 2; - fn get_number_for_reflect(&self) -> &::std::option::Option { - &self.number - } - fn mut_number_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.number + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string name = 2; - pub fn clear_name(&mut self) { self.name.clear(); } @@ -5096,23 +4580,12 @@ impl Disc { self.name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_name(&self) -> &str { - match self.name.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Track track = 3; - fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.name - } - fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.name + pub fn get_track(&self) -> &[Track] { + &self.track } - - // repeated .Track track = 3; - pub fn clear_track(&mut self) { self.track.clear(); } @@ -5131,18 +4604,6 @@ impl Disc { pub fn take_track(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.track, ::protobuf::RepeatedField::new()) } - - pub fn get_track(&self) -> &[Track] { - &self.track - } - - fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.track - } - - fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.track - } } impl ::protobuf::Message for Disc { @@ -5227,27 +4688,25 @@ impl ::protobuf::Message for Disc { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Disc { fn new() -> Disc { Disc::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5257,18 +4716,18 @@ impl ::protobuf::MessageStatic for Disc { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "number", - Disc::get_number_for_reflect, - Disc::mut_number_for_reflect, + |m: &Disc| { &m.number }, + |m: &mut Disc| { &mut m.number }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Disc::get_name_for_reflect, - Disc::mut_name_for_reflect, + |m: &Disc| { &m.name }, + |m: &mut Disc| { &mut m.name }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - Disc::get_track_for_reflect, - Disc::mut_track_for_reflect, + |m: &Disc| { &m.track }, + |m: &mut Disc| { &mut m.track }, )); ::protobuf::reflect::MessageDescriptor::new::( "Disc", @@ -5278,13 +4737,23 @@ impl ::protobuf::MessageStatic for Disc { }) } } + + fn default_instance() -> &'static Disc { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Disc, + }; + unsafe { + instance.get(Disc::new) + } + } } impl ::protobuf::Clear for Disc { fn clear(&mut self) { - self.clear_number(); - self.clear_name(); - self.clear_track(); + self.number = ::std::option::Option::None; + self.name.clear(); + self.track.clear(); self.unknown_fields.clear(); } } @@ -5307,30 +4776,27 @@ pub struct Copyright { typ: ::std::option::Option, text: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Copyright {} +impl<'a> ::std::default::Default for &'a Copyright { + fn default() -> &'a Copyright { + ::default_instance() + } +} impl Copyright { pub fn new() -> Copyright { ::std::default::Default::default() } - pub fn default_instance() -> &'static Copyright { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Copyright, - }; - unsafe { - instance.get(Copyright::new) - } - } - // optional .Copyright.Type typ = 1; + + pub fn get_typ(&self) -> Copyright_Type { + self.typ.unwrap_or(Copyright_Type::P) + } pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -5344,20 +4810,15 @@ impl Copyright { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> Copyright_Type { - self.typ.unwrap_or(Copyright_Type::P) - } + // optional string text = 2; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_text(&self) -> &str { + match self.text.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string text = 2; - pub fn clear_text(&mut self) { self.text.clear(); } @@ -5384,21 +4845,6 @@ impl Copyright { pub fn take_text(&mut self) -> ::std::string::String { self.text.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_text(&self) -> &str { - match self.text.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_text_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.text - } - - fn mut_text_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.text - } } impl ::protobuf::Message for Copyright { @@ -5411,11 +4857,7 @@ impl ::protobuf::Message for Copyright { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 1, &mut self.unknown_fields)? }, 2 => { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)?; @@ -5466,27 +4908,25 @@ impl ::protobuf::Message for Copyright { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Copyright { fn new() -> Copyright { Copyright::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5496,13 +4936,13 @@ impl ::protobuf::MessageStatic for Copyright { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Copyright::get_typ_for_reflect, - Copyright::mut_typ_for_reflect, + |m: &Copyright| { &m.typ }, + |m: &mut Copyright| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "text", - Copyright::get_text_for_reflect, - Copyright::mut_text_for_reflect, + |m: &Copyright| { &m.text }, + |m: &mut Copyright| { &mut m.text }, )); ::protobuf::reflect::MessageDescriptor::new::( "Copyright", @@ -5512,12 +4952,22 @@ impl ::protobuf::MessageStatic for Copyright { }) } } + + fn default_instance() -> &'static Copyright { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Copyright, + }; + unsafe { + instance.get(Copyright::new) + } + } } impl ::protobuf::Clear for Copyright { fn clear(&mut self) { - self.clear_typ(); - self.clear_text(); + self.typ = ::std::option::Option::None; + self.text.clear(); self.unknown_fields.clear(); } } @@ -5561,7 +5011,7 @@ impl ::protobuf::ProtobufEnum for Copyright_Type { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5577,6 +5027,12 @@ impl ::protobuf::ProtobufEnum for Copyright_Type { impl ::std::marker::Copy for Copyright_Type { } +impl ::std::default::Default for Copyright_Type { + fn default() -> Self { + Copyright_Type::P + } +} + impl ::protobuf::reflect::ProtobufValue for Copyright_Type { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5591,30 +5047,30 @@ pub struct Restriction { typ: ::std::option::Option, catalogue_str: ::protobuf::RepeatedField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Restriction {} +impl<'a> ::std::default::Default for &'a Restriction { + fn default() -> &'a Restriction { + ::default_instance() + } +} impl Restriction { pub fn new() -> Restriction { ::std::default::Default::default() } - pub fn default_instance() -> &'static Restriction { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Restriction, - }; - unsafe { - instance.get(Restriction::new) - } - } - // optional string countries_allowed = 2; + + pub fn get_countries_allowed(&self) -> &str { + match self.countries_allowed.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_countries_allowed(&mut self) { self.countries_allowed.clear(); } @@ -5642,23 +5098,15 @@ impl Restriction { self.countries_allowed.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_countries_allowed(&self) -> &str { - match self.countries_allowed.as_ref() { + // optional string countries_forbidden = 3; + + + pub fn get_countries_forbidden(&self) -> &str { + match self.countries_forbidden.as_ref() { Some(v) => &v, None => "", } } - - fn get_countries_allowed_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.countries_allowed - } - - fn mut_countries_allowed_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.countries_allowed - } - - // optional string countries_forbidden = 3; - pub fn clear_countries_forbidden(&mut self) { self.countries_forbidden.clear(); } @@ -5686,23 +5134,12 @@ impl Restriction { self.countries_forbidden.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_countries_forbidden(&self) -> &str { - match self.countries_forbidden.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .Restriction.Type typ = 4; - fn get_countries_forbidden_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.countries_forbidden - } - fn mut_countries_forbidden_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.countries_forbidden + pub fn get_typ(&self) -> Restriction_Type { + self.typ.unwrap_or(Restriction_Type::STREAMING) } - - // optional .Restriction.Type typ = 4; - pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -5716,20 +5153,12 @@ impl Restriction { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> Restriction_Type { - self.typ.unwrap_or(Restriction_Type::STREAMING) - } + // repeated string catalogue_str = 5; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_catalogue_str(&self) -> &[::std::string::String] { + &self.catalogue_str } - - // repeated string catalogue_str = 5; - pub fn clear_catalogue_str(&mut self) { self.catalogue_str.clear(); } @@ -5748,18 +5177,6 @@ impl Restriction { pub fn take_catalogue_str(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { ::std::mem::replace(&mut self.catalogue_str, ::protobuf::RepeatedField::new()) } - - pub fn get_catalogue_str(&self) -> &[::std::string::String] { - &self.catalogue_str - } - - fn get_catalogue_str_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.catalogue_str - } - - fn mut_catalogue_str_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.catalogue_str - } } impl ::protobuf::Message for Restriction { @@ -5778,11 +5195,7 @@ impl ::protobuf::Message for Restriction { ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.countries_forbidden)?; }, 4 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 4, &mut self.unknown_fields)? }, 5 => { ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.catalogue_str)?; @@ -5845,27 +5258,25 @@ impl ::protobuf::Message for Restriction { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Restriction { fn new() -> Restriction { Restriction::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -5875,23 +5286,23 @@ impl ::protobuf::MessageStatic for Restriction { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "countries_allowed", - Restriction::get_countries_allowed_for_reflect, - Restriction::mut_countries_allowed_for_reflect, + |m: &Restriction| { &m.countries_allowed }, + |m: &mut Restriction| { &mut m.countries_allowed }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "countries_forbidden", - Restriction::get_countries_forbidden_for_reflect, - Restriction::mut_countries_forbidden_for_reflect, + |m: &Restriction| { &m.countries_forbidden }, + |m: &mut Restriction| { &mut m.countries_forbidden }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Restriction::get_typ_for_reflect, - Restriction::mut_typ_for_reflect, + |m: &Restriction| { &m.typ }, + |m: &mut Restriction| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "catalogue_str", - Restriction::get_catalogue_str_for_reflect, - Restriction::mut_catalogue_str_for_reflect, + |m: &Restriction| { &m.catalogue_str }, + |m: &mut Restriction| { &mut m.catalogue_str }, )); ::protobuf::reflect::MessageDescriptor::new::( "Restriction", @@ -5901,14 +5312,24 @@ impl ::protobuf::MessageStatic for Restriction { }) } } + + fn default_instance() -> &'static Restriction { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Restriction, + }; + unsafe { + instance.get(Restriction::new) + } + } } impl ::protobuf::Clear for Restriction { fn clear(&mut self) { - self.clear_countries_allowed(); - self.clear_countries_forbidden(); - self.clear_typ(); - self.clear_catalogue_str(); + self.countries_allowed.clear(); + self.countries_forbidden.clear(); + self.typ = ::std::option::Option::None; + self.catalogue_str.clear(); self.unknown_fields.clear(); } } @@ -5949,7 +5370,7 @@ impl ::protobuf::ProtobufEnum for Restriction_Type { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -5965,6 +5386,12 @@ impl ::protobuf::ProtobufEnum for Restriction_Type { impl ::std::marker::Copy for Restriction_Type { } +impl ::std::default::Default for Restriction_Type { + fn default() -> Self { + Restriction_Type::STREAMING + } +} + impl ::protobuf::reflect::ProtobufValue for Restriction_Type { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -5978,30 +5405,27 @@ pub struct SalePeriod { start: ::protobuf::SingularPtrField, end: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for SalePeriod {} +impl<'a> ::std::default::Default for &'a SalePeriod { + fn default() -> &'a SalePeriod { + ::default_instance() + } +} impl SalePeriod { pub fn new() -> SalePeriod { ::std::default::Default::default() } - pub fn default_instance() -> &'static SalePeriod { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const SalePeriod, - }; - unsafe { - instance.get(SalePeriod::new) - } - } - // repeated .Restriction restriction = 1; + + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction + } pub fn clear_restriction(&mut self) { self.restriction.clear(); } @@ -6021,20 +5445,12 @@ impl SalePeriod { ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) } - pub fn get_restriction(&self) -> &[Restriction] { - &self.restriction - } + // optional .Date start = 2; - fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.restriction - } - fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.restriction + pub fn get_start(&self) -> &Date { + self.start.as_ref().unwrap_or_else(|| Date::default_instance()) } - - // optional .Date start = 2; - pub fn clear_start(&mut self) { self.start.clear(); } @@ -6062,20 +5478,12 @@ impl SalePeriod { self.start.take().unwrap_or_else(|| Date::new()) } - pub fn get_start(&self) -> &Date { - self.start.as_ref().unwrap_or_else(|| Date::default_instance()) - } + // optional .Date end = 3; - fn get_start_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.start - } - fn mut_start_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.start + pub fn get_end(&self) -> &Date { + self.end.as_ref().unwrap_or_else(|| Date::default_instance()) } - - // optional .Date end = 3; - pub fn clear_end(&mut self) { self.end.clear(); } @@ -6102,18 +5510,6 @@ impl SalePeriod { pub fn take_end(&mut self) -> Date { self.end.take().unwrap_or_else(|| Date::new()) } - - pub fn get_end(&self) -> &Date { - self.end.as_ref().unwrap_or_else(|| Date::default_instance()) - } - - fn get_end_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.end - } - - fn mut_end_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.end - } } impl ::protobuf::Message for SalePeriod { @@ -6210,27 +5606,25 @@ impl ::protobuf::Message for SalePeriod { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for SalePeriod { fn new() -> SalePeriod { SalePeriod::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6240,18 +5634,18 @@ impl ::protobuf::MessageStatic for SalePeriod { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - SalePeriod::get_restriction_for_reflect, - SalePeriod::mut_restriction_for_reflect, + |m: &SalePeriod| { &m.restriction }, + |m: &mut SalePeriod| { &mut m.restriction }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "start", - SalePeriod::get_start_for_reflect, - SalePeriod::mut_start_for_reflect, + |m: &SalePeriod| { &m.start }, + |m: &mut SalePeriod| { &mut m.start }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "end", - SalePeriod::get_end_for_reflect, - SalePeriod::mut_end_for_reflect, + |m: &SalePeriod| { &m.end }, + |m: &mut SalePeriod| { &mut m.end }, )); ::protobuf::reflect::MessageDescriptor::new::( "SalePeriod", @@ -6261,13 +5655,23 @@ impl ::protobuf::MessageStatic for SalePeriod { }) } } + + fn default_instance() -> &'static SalePeriod { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SalePeriod, + }; + unsafe { + instance.get(SalePeriod::new) + } + } } impl ::protobuf::Clear for SalePeriod { fn clear(&mut self) { - self.clear_restriction(); - self.clear_start(); - self.clear_end(); + self.restriction.clear(); + self.start.clear(); + self.end.clear(); self.unknown_fields.clear(); } } @@ -6290,30 +5694,30 @@ pub struct ExternalId { typ: ::protobuf::SingularField<::std::string::String>, id: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for ExternalId {} +impl<'a> ::std::default::Default for &'a ExternalId { + fn default() -> &'a ExternalId { + ::default_instance() + } +} impl ExternalId { pub fn new() -> ExternalId { ::std::default::Default::default() } - pub fn default_instance() -> &'static ExternalId { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const ExternalId, - }; - unsafe { - instance.get(ExternalId::new) - } - } - // optional string typ = 1; + + pub fn get_typ(&self) -> &str { + match self.typ.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_typ(&mut self) { self.typ.clear(); } @@ -6341,23 +5745,15 @@ impl ExternalId { self.typ.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_typ(&self) -> &str { - match self.typ.as_ref() { + // optional string id = 2; + + + pub fn get_id(&self) -> &str { + match self.id.as_ref() { Some(v) => &v, None => "", } } - - fn get_typ_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.typ - } - - fn mut_typ_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.typ - } - - // optional string id = 2; - pub fn clear_id(&mut self) { self.id.clear(); } @@ -6384,21 +5780,6 @@ impl ExternalId { pub fn take_id(&mut self) -> ::std::string::String { self.id.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_id(&self) -> &str { - match self.id.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.id - } - - fn mut_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.id - } } impl ::protobuf::Message for ExternalId { @@ -6462,27 +5843,25 @@ impl ::protobuf::Message for ExternalId { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for ExternalId { fn new() -> ExternalId { ExternalId::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6492,13 +5871,13 @@ impl ::protobuf::MessageStatic for ExternalId { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "typ", - ExternalId::get_typ_for_reflect, - ExternalId::mut_typ_for_reflect, + |m: &ExternalId| { &m.typ }, + |m: &mut ExternalId| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "id", - ExternalId::get_id_for_reflect, - ExternalId::mut_id_for_reflect, + |m: &ExternalId| { &m.id }, + |m: &mut ExternalId| { &mut m.id }, )); ::protobuf::reflect::MessageDescriptor::new::( "ExternalId", @@ -6508,12 +5887,22 @@ impl ::protobuf::MessageStatic for ExternalId { }) } } + + fn default_instance() -> &'static ExternalId { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ExternalId, + }; + unsafe { + instance.get(ExternalId::new) + } + } } impl ::protobuf::Clear for ExternalId { fn clear(&mut self) { - self.clear_typ(); - self.clear_id(); + self.typ.clear(); + self.id.clear(); self.unknown_fields.clear(); } } @@ -6536,30 +5925,30 @@ pub struct AudioFile { file_id: ::protobuf::SingularField<::std::vec::Vec>, format: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for AudioFile {} +impl<'a> ::std::default::Default for &'a AudioFile { + fn default() -> &'a AudioFile { + ::default_instance() + } +} impl AudioFile { pub fn new() -> AudioFile { ::std::default::Default::default() } - pub fn default_instance() -> &'static AudioFile { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const AudioFile, - }; - unsafe { - instance.get(AudioFile::new) - } - } - // optional bytes file_id = 1; + + pub fn get_file_id(&self) -> &[u8] { + match self.file_id.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_file_id(&mut self) { self.file_id.clear(); } @@ -6587,23 +5976,12 @@ impl AudioFile { self.file_id.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_file_id(&self) -> &[u8] { - match self.file_id.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional .AudioFile.Format format = 2; - fn get_file_id_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.file_id - } - fn mut_file_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.file_id + pub fn get_format(&self) -> AudioFile_Format { + self.format.unwrap_or(AudioFile_Format::OGG_VORBIS_96) } - - // optional .AudioFile.Format format = 2; - pub fn clear_format(&mut self) { self.format = ::std::option::Option::None; } @@ -6616,18 +5994,6 @@ impl AudioFile { pub fn set_format(&mut self, v: AudioFile_Format) { self.format = ::std::option::Option::Some(v); } - - pub fn get_format(&self) -> AudioFile_Format { - self.format.unwrap_or(AudioFile_Format::OGG_VORBIS_96) - } - - fn get_format_for_reflect(&self) -> &::std::option::Option { - &self.format - } - - fn mut_format_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.format - } } impl ::protobuf::Message for AudioFile { @@ -6643,11 +6009,7 @@ impl ::protobuf::Message for AudioFile { ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)?; }, 2 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.format = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.format, 2, &mut self.unknown_fields)? }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; @@ -6695,27 +6057,25 @@ impl ::protobuf::Message for AudioFile { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for AudioFile { fn new() -> AudioFile { AudioFile::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -6725,13 +6085,13 @@ impl ::protobuf::MessageStatic for AudioFile { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "file_id", - AudioFile::get_file_id_for_reflect, - AudioFile::mut_file_id_for_reflect, + |m: &AudioFile| { &m.file_id }, + |m: &mut AudioFile| { &mut m.file_id }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "format", - AudioFile::get_format_for_reflect, - AudioFile::mut_format_for_reflect, + |m: &AudioFile| { &m.format }, + |m: &mut AudioFile| { &mut m.format }, )); ::protobuf::reflect::MessageDescriptor::new::( "AudioFile", @@ -6741,12 +6101,22 @@ impl ::protobuf::MessageStatic for AudioFile { }) } } + + fn default_instance() -> &'static AudioFile { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AudioFile, + }; + unsafe { + instance.get(AudioFile::new) + } + } } impl ::protobuf::Clear for AudioFile { fn clear(&mut self) { - self.clear_file_id(); - self.clear_format(); + self.file_id.clear(); + self.format = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -6826,7 +6196,7 @@ impl ::protobuf::ProtobufEnum for AudioFile_Format { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -6842,6 +6212,12 @@ impl ::protobuf::ProtobufEnum for AudioFile_Format { impl ::std::marker::Copy for AudioFile_Format { } +impl ::std::default::Default for AudioFile_Format { + fn default() -> Self { + AudioFile_Format::OGG_VORBIS_96 + } +} + impl ::protobuf::reflect::ProtobufValue for AudioFile_Format { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -6849,451 +6225,83 @@ impl ::protobuf::reflect::ProtobufValue for AudioFile_Format { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0emetadata.proto\"C\n\tTopTracks\x12\x18\n\x07country\x18\x01\x20\ - \x01(\tR\x07country\x12\x1c\n\x05track\x18\x02\x20\x03(\x0b2\x06.TrackR\ - \x05track\"b\n\x0eActivityPeriod\x12\x1d\n\nstart_year\x18\x01\x20\x01(\ - \x11R\tstartYear\x12\x19\n\x08end_year\x18\x02\x20\x01(\x11R\x07endYear\ - \x12\x16\n\x06decade\x18\x03\x20\x01(\x11R\x06decade\"\xd0\x05\n\x06Arti\ - st\x12\x10\n\x03gid\x18\x01\x20\x01(\x0cR\x03gid\x12\x12\n\x04name\x18\ - \x02\x20\x01(\tR\x04name\x12\x1e\n\npopularity\x18\x03\x20\x01(\x11R\npo\ - pularity\x12'\n\ttop_track\x18\x04\x20\x03(\x0b2\n.TopTracksR\x08topTrac\ - k\x12,\n\x0balbum_group\x18\x05\x20\x03(\x0b2\x0b.AlbumGroupR\nalbumGrou\ - p\x12.\n\x0csingle_group\x18\x06\x20\x03(\x0b2\x0b.AlbumGroupR\x0bsingle\ - Group\x128\n\x11compilation_group\x18\x07\x20\x03(\x0b2\x0b.AlbumGroupR\ - \x10compilationGroup\x125\n\x10appears_on_group\x18\x08\x20\x03(\x0b2\ - \x0b.AlbumGroupR\x0eappearsOnGroup\x12\x14\n\x05genre\x18\t\x20\x03(\tR\ - \x05genre\x12,\n\x0bexternal_id\x18\n\x20\x03(\x0b2\x0b.ExternalIdR\next\ - ernalId\x12\"\n\x08portrait\x18\x0b\x20\x03(\x0b2\x06.ImageR\x08portrait\ - \x12(\n\tbiography\x18\x0c\x20\x03(\x0b2\n.BiographyR\tbiography\x128\n\ - \x0factivity_period\x18\r\x20\x03(\x0b2\x0f.ActivityPeriodR\x0eactivityP\ - eriod\x12.\n\x0brestriction\x18\x0e\x20\x03(\x0b2\x0c.RestrictionR\x0bre\ - striction\x12!\n\x07related\x18\x0f\x20\x03(\x0b2\x07.ArtistR\x07related\ - \x125\n\x17is_portrait_album_cover\x18\x10\x20\x01(\x08R\x14isPortraitAl\ - bumCover\x122\n\x0eportrait_group\x18\x11\x20\x01(\x0b2\x0b.ImageGroupR\ - \rportraitGroup\"*\n\nAlbumGroup\x12\x1c\n\x05album\x18\x01\x20\x03(\x0b\ - 2\x06.AlbumR\x05album\"B\n\x04Date\x12\x12\n\x04year\x18\x01\x20\x01(\ - \x11R\x04year\x12\x14\n\x05month\x18\x02\x20\x01(\x11R\x05month\x12\x10\ - \n\x03day\x18\x03\x20\x01(\x11R\x03day\"\xe3\x04\n\x05Album\x12\x10\n\ - \x03gid\x18\x01\x20\x01(\x0cR\x03gid\x12\x12\n\x04name\x18\x02\x20\x01(\ - \tR\x04name\x12\x1f\n\x06artist\x18\x03\x20\x03(\x0b2\x07.ArtistR\x06art\ - ist\x12\x1d\n\x03typ\x18\x04\x20\x01(\x0e2\x0b.Album.TypeR\x03typ\x12\ - \x14\n\x05label\x18\x05\x20\x01(\tR\x05label\x12\x19\n\x04date\x18\x06\ - \x20\x01(\x0b2\x05.DateR\x04date\x12\x1e\n\npopularity\x18\x07\x20\x01(\ - \x11R\npopularity\x12\x14\n\x05genre\x18\x08\x20\x03(\tR\x05genre\x12\ - \x1c\n\x05cover\x18\t\x20\x03(\x0b2\x06.ImageR\x05cover\x12,\n\x0bextern\ - al_id\x18\n\x20\x03(\x0b2\x0b.ExternalIdR\nexternalId\x12\x19\n\x04disc\ - \x18\x0b\x20\x03(\x0b2\x05.DiscR\x04disc\x12\x16\n\x06review\x18\x0c\x20\ - \x03(\tR\x06review\x12(\n\tcopyright\x18\r\x20\x03(\x0b2\n.CopyrightR\tc\ - opyright\x12.\n\x0brestriction\x18\x0e\x20\x03(\x0b2\x0c.RestrictionR\ - \x0brestriction\x12\x20\n\x07related\x18\x0f\x20\x03(\x0b2\x06.AlbumR\ - \x07related\x12,\n\x0bsale_period\x18\x10\x20\x03(\x0b2\x0b.SalePeriodR\ - \nsalePeriod\x12,\n\x0bcover_group\x18\x11\x20\x01(\x0b2\x0b.ImageGroupR\ - \ncoverGroup\"6\n\x04Type\x12\t\n\x05ALBUM\x10\x01\x12\n\n\x06SINGLE\x10\ - \x02\x12\x0f\n\x0bCOMPILATION\x10\x03\x12\x06\n\x02EP\x10\x04\"\xf9\x03\ - \n\x05Track\x12\x10\n\x03gid\x18\x01\x20\x01(\x0cR\x03gid\x12\x12\n\x04n\ - ame\x18\x02\x20\x01(\tR\x04name\x12\x1c\n\x05album\x18\x03\x20\x01(\x0b2\ - \x06.AlbumR\x05album\x12\x1f\n\x06artist\x18\x04\x20\x03(\x0b2\x07.Artis\ - tR\x06artist\x12\x16\n\x06number\x18\x05\x20\x01(\x11R\x06number\x12\x1f\ - \n\x0bdisc_number\x18\x06\x20\x01(\x11R\ndiscNumber\x12\x1a\n\x08duratio\ - n\x18\x07\x20\x01(\x11R\x08duration\x12\x1e\n\npopularity\x18\x08\x20\ - \x01(\x11R\npopularity\x12\x1a\n\x08explicit\x18\t\x20\x01(\x08R\x08expl\ - icit\x12,\n\x0bexternal_id\x18\n\x20\x03(\x0b2\x0b.ExternalIdR\nexternal\ - Id\x12.\n\x0brestriction\x18\x0b\x20\x03(\x0b2\x0c.RestrictionR\x0brestr\ - iction\x12\x1e\n\x04file\x18\x0c\x20\x03(\x0b2\n.AudioFileR\x04file\x12(\ - \n\x0balternative\x18\r\x20\x03(\x0b2\x06.TrackR\x0balternative\x12,\n\ - \x0bsale_period\x18\x0e\x20\x03(\x0b2\x0b.SalePeriodR\nsalePeriod\x12$\n\ - \x07preview\x18\x0f\x20\x03(\x0b2\n.AudioFileR\x07preview\"\xa6\x01\n\ - \x05Image\x12\x17\n\x07file_id\x18\x01\x20\x01(\x0cR\x06fileId\x12\x1f\n\ - \x04size\x18\x02\x20\x01(\x0e2\x0b.Image.SizeR\x04size\x12\x14\n\x05widt\ - h\x18\x03\x20\x01(\x11R\x05width\x12\x16\n\x06height\x18\x04\x20\x01(\ - \x11R\x06height\"5\n\x04Size\x12\x0b\n\x07DEFAULT\x10\0\x12\t\n\x05SMALL\ - \x10\x01\x12\t\n\x05LARGE\x10\x02\x12\n\n\x06XLARGE\x10\x03\"*\n\nImageG\ - roup\x12\x1c\n\x05image\x18\x01\x20\x03(\x0b2\x06.ImageR\x05image\"w\n\t\ - Biography\x12\x12\n\x04text\x18\x01\x20\x01(\tR\x04text\x12\"\n\x08portr\ - ait\x18\x02\x20\x03(\x0b2\x06.ImageR\x08portrait\x122\n\x0eportrait_grou\ - p\x18\x03\x20\x03(\x0b2\x0b.ImageGroupR\rportraitGroup\"P\n\x04Disc\x12\ - \x16\n\x06number\x18\x01\x20\x01(\x11R\x06number\x12\x12\n\x04name\x18\ - \x02\x20\x01(\tR\x04name\x12\x1c\n\x05track\x18\x03\x20\x03(\x0b2\x06.Tr\ - ackR\x05track\"X\n\tCopyright\x12!\n\x03typ\x18\x01\x20\x01(\x0e2\x0f.Co\ - pyright.TypeR\x03typ\x12\x12\n\x04text\x18\x02\x20\x01(\tR\x04text\"\x14\ - \n\x04Type\x12\x05\n\x01P\x10\0\x12\x05\n\x01C\x10\x01\"\xcc\x01\n\x0bRe\ - striction\x12+\n\x11countries_allowed\x18\x02\x20\x01(\tR\x10countriesAl\ - lowed\x12/\n\x13countries_forbidden\x18\x03\x20\x01(\tR\x12countriesForb\ - idden\x12#\n\x03typ\x18\x04\x20\x01(\x0e2\x11.Restriction.TypeR\x03typ\ - \x12#\n\rcatalogue_str\x18\x05\x20\x03(\tR\x0ccatalogueStr\"\x15\n\x04Ty\ - pe\x12\r\n\tSTREAMING\x10\0\"r\n\nSalePeriod\x12.\n\x0brestriction\x18\ - \x01\x20\x03(\x0b2\x0c.RestrictionR\x0brestriction\x12\x1b\n\x05start\ - \x18\x02\x20\x01(\x0b2\x05.DateR\x05start\x12\x17\n\x03end\x18\x03\x20\ - \x01(\x0b2\x05.DateR\x03end\".\n\nExternalId\x12\x10\n\x03typ\x18\x01\ - \x20\x01(\tR\x03typ\x12\x0e\n\x02id\x18\x02\x20\x01(\tR\x02id\"\xa3\x02\ - \n\tAudioFile\x12\x17\n\x07file_id\x18\x01\x20\x01(\x0cR\x06fileId\x12)\ - \n\x06format\x18\x02\x20\x01(\x0e2\x11.AudioFile.FormatR\x06format\"\xd1\ - \x01\n\x06Format\x12\x11\n\rOGG_VORBIS_96\x10\0\x12\x12\n\x0eOGG_VORBIS_\ - 160\x10\x01\x12\x12\n\x0eOGG_VORBIS_320\x10\x02\x12\x0b\n\x07MP3_256\x10\ - \x03\x12\x0b\n\x07MP3_320\x10\x04\x12\x0b\n\x07MP3_160\x10\x05\x12\n\n\ - \x06MP3_96\x10\x06\x12\x0f\n\x0bMP3_160_ENC\x10\x07\x12\n\n\x06OTHER2\ - \x10\x08\x12\n\n\x06OTHER3\x10\t\x12\x0b\n\x07AAC_160\x10\n\x12\x0b\n\ - \x07AAC_320\x10\x0b\x12\n\n\x06OTHER4\x10\x0c\x12\n\n\x06OTHER5\x10\rJ\ - \xba:\n\x07\x12\x05\0\0\xa5\x01\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\ - \n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\ - \x11\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\"\n\x0c\n\x05\x04\0\x02\0\ - \x04\x12\x03\x03\x04\x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\r\x13\n\ - \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x14\x1b\n\x0c\n\x05\x04\0\x02\0\ - \x03\x12\x03\x03\x1e!\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x1f\n\ - \x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x04\x04\x0c\n\x0c\n\x05\x04\0\x02\ - \x01\x06\x12\x03\x04\r\x12\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x13\ - \x18\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x1b\x1e\n\n\n\x02\x04\x01\ - \x12\x04\x07\0\x0b\x01\n\n\n\x03\x04\x01\x01\x12\x03\x07\x08\x16\n\x0b\n\ - \x04\x04\x01\x02\0\x12\x03\x08\x04%\n\x0c\n\x05\x04\x01\x02\0\x04\x12\ - \x03\x08\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\r\x13\n\x0c\n\ - \x05\x04\x01\x02\0\x01\x12\x03\x08\x14\x1e\n\x0c\n\x05\x04\x01\x02\0\x03\ - \x12\x03\x08!$\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04#\n\x0c\n\x05\ - \x04\x01\x02\x01\x04\x12\x03\t\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\ - \x12\x03\t\r\x13\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\t\x14\x1c\n\x0c\ - \n\x05\x04\x01\x02\x01\x03\x12\x03\t\x1f\"\n\x0b\n\x04\x04\x01\x02\x02\ - \x12\x03\n\x04!\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03\n\x04\x0c\n\x0c\ - \n\x05\x04\x01\x02\x02\x05\x12\x03\n\r\x13\n\x0c\n\x05\x04\x01\x02\x02\ - \x01\x12\x03\n\x14\x1a\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x1d\x20\ - \n\n\n\x02\x04\x02\x12\x04\r\0\x1f\x01\n\n\n\x03\x04\x02\x01\x12\x03\r\ - \x08\x0e\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0e\x04\x1d\n\x0c\n\x05\x04\ - \x02\x02\0\x04\x12\x03\x0e\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\ - \x0e\r\x12\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x0e\x13\x16\n\x0c\n\x05\ - \x04\x02\x02\0\x03\x12\x03\x0e\x19\x1c\n\x0b\n\x04\x04\x02\x02\x01\x12\ - \x03\x0f\x04\x1f\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03\x0f\x04\x0c\n\ - \x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0f\r\x13\n\x0c\n\x05\x04\x02\x02\ - \x01\x01\x12\x03\x0f\x14\x18\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x0f\ - \x1b\x1e\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\x10\x04%\n\x0c\n\x05\x04\ - \x02\x02\x02\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\ - \x03\x10\r\x13\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x10\x14\x1e\n\x0c\ - \n\x05\x04\x02\x02\x02\x03\x12\x03\x10!$\n\x0b\n\x04\x04\x02\x02\x03\x12\ - \x03\x11\x04'\n\x0c\n\x05\x04\x02\x02\x03\x04\x12\x03\x11\x04\x0c\n\x0c\ - \n\x05\x04\x02\x02\x03\x06\x12\x03\x11\r\x16\n\x0c\n\x05\x04\x02\x02\x03\ - \x01\x12\x03\x11\x17\x20\n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x03\x11#&\n\ - \x0b\n\x04\x04\x02\x02\x04\x12\x03\x12\x04*\n\x0c\n\x05\x04\x02\x02\x04\ - \x04\x12\x03\x12\x04\x0c\n\x0c\n\x05\x04\x02\x02\x04\x06\x12\x03\x12\r\ - \x17\n\x0c\n\x05\x04\x02\x02\x04\x01\x12\x03\x12\x18#\n\x0c\n\x05\x04\ - \x02\x02\x04\x03\x12\x03\x12&)\n\x0b\n\x04\x04\x02\x02\x05\x12\x03\x13\ - \x04+\n\x0c\n\x05\x04\x02\x02\x05\x04\x12\x03\x13\x04\x0c\n\x0c\n\x05\ - \x04\x02\x02\x05\x06\x12\x03\x13\r\x17\n\x0c\n\x05\x04\x02\x02\x05\x01\ - \x12\x03\x13\x18$\n\x0c\n\x05\x04\x02\x02\x05\x03\x12\x03\x13'*\n\x0b\n\ - \x04\x04\x02\x02\x06\x12\x03\x14\x040\n\x0c\n\x05\x04\x02\x02\x06\x04\ - \x12\x03\x14\x04\x0c\n\x0c\n\x05\x04\x02\x02\x06\x06\x12\x03\x14\r\x17\n\ - \x0c\n\x05\x04\x02\x02\x06\x01\x12\x03\x14\x18)\n\x0c\n\x05\x04\x02\x02\ - \x06\x03\x12\x03\x14,/\n\x0b\n\x04\x04\x02\x02\x07\x12\x03\x15\x04/\n\ - \x0c\n\x05\x04\x02\x02\x07\x04\x12\x03\x15\x04\x0c\n\x0c\n\x05\x04\x02\ - \x02\x07\x06\x12\x03\x15\r\x17\n\x0c\n\x05\x04\x02\x02\x07\x01\x12\x03\ - \x15\x18(\n\x0c\n\x05\x04\x02\x02\x07\x03\x12\x03\x15+.\n\x0b\n\x04\x04\ - \x02\x02\x08\x12\x03\x16\x04\x20\n\x0c\n\x05\x04\x02\x02\x08\x04\x12\x03\ - \x16\x04\x0c\n\x0c\n\x05\x04\x02\x02\x08\x05\x12\x03\x16\r\x13\n\x0c\n\ - \x05\x04\x02\x02\x08\x01\x12\x03\x16\x14\x19\n\x0c\n\x05\x04\x02\x02\x08\ - \x03\x12\x03\x16\x1c\x1f\n\x0b\n\x04\x04\x02\x02\t\x12\x03\x17\x04*\n\ - \x0c\n\x05\x04\x02\x02\t\x04\x12\x03\x17\x04\x0c\n\x0c\n\x05\x04\x02\x02\ - \t\x06\x12\x03\x17\r\x17\n\x0c\n\x05\x04\x02\x02\t\x01\x12\x03\x17\x18#\ - \n\x0c\n\x05\x04\x02\x02\t\x03\x12\x03\x17&)\n\x0b\n\x04\x04\x02\x02\n\ - \x12\x03\x18\x04\"\n\x0c\n\x05\x04\x02\x02\n\x04\x12\x03\x18\x04\x0c\n\ - \x0c\n\x05\x04\x02\x02\n\x06\x12\x03\x18\r\x12\n\x0c\n\x05\x04\x02\x02\n\ - \x01\x12\x03\x18\x13\x1b\n\x0c\n\x05\x04\x02\x02\n\x03\x12\x03\x18\x1e!\ - \n\x0b\n\x04\x04\x02\x02\x0b\x12\x03\x19\x04'\n\x0c\n\x05\x04\x02\x02\ - \x0b\x04\x12\x03\x19\x04\x0c\n\x0c\n\x05\x04\x02\x02\x0b\x06\x12\x03\x19\ - \r\x16\n\x0c\n\x05\x04\x02\x02\x0b\x01\x12\x03\x19\x17\x20\n\x0c\n\x05\ - \x04\x02\x02\x0b\x03\x12\x03\x19#&\n\x0b\n\x04\x04\x02\x02\x0c\x12\x03\ - \x1a\x042\n\x0c\n\x05\x04\x02\x02\x0c\x04\x12\x03\x1a\x04\x0c\n\x0c\n\ - \x05\x04\x02\x02\x0c\x06\x12\x03\x1a\r\x1b\n\x0c\n\x05\x04\x02\x02\x0c\ - \x01\x12\x03\x1a\x1c+\n\x0c\n\x05\x04\x02\x02\x0c\x03\x12\x03\x1a.1\n\ - \x0b\n\x04\x04\x02\x02\r\x12\x03\x1b\x04+\n\x0c\n\x05\x04\x02\x02\r\x04\ - \x12\x03\x1b\x04\x0c\n\x0c\n\x05\x04\x02\x02\r\x06\x12\x03\x1b\r\x18\n\ - \x0c\n\x05\x04\x02\x02\r\x01\x12\x03\x1b\x19$\n\x0c\n\x05\x04\x02\x02\r\ - \x03\x12\x03\x1b'*\n\x0b\n\x04\x04\x02\x02\x0e\x12\x03\x1c\x04\"\n\x0c\n\ - \x05\x04\x02\x02\x0e\x04\x12\x03\x1c\x04\x0c\n\x0c\n\x05\x04\x02\x02\x0e\ - \x06\x12\x03\x1c\r\x13\n\x0c\n\x05\x04\x02\x02\x0e\x01\x12\x03\x1c\x14\ - \x1b\n\x0c\n\x05\x04\x02\x02\x0e\x03\x12\x03\x1c\x1e!\n\x0b\n\x04\x04\ - \x02\x02\x0f\x12\x03\x1d\x041\n\x0c\n\x05\x04\x02\x02\x0f\x04\x12\x03\ - \x1d\x04\x0c\n\x0c\n\x05\x04\x02\x02\x0f\x05\x12\x03\x1d\r\x11\n\x0c\n\ - \x05\x04\x02\x02\x0f\x01\x12\x03\x1d\x12)\n\x0c\n\x05\x04\x02\x02\x0f\ - \x03\x12\x03\x1d,0\n\x0b\n\x04\x04\x02\x02\x10\x12\x03\x1e\x04.\n\x0c\n\ - \x05\x04\x02\x02\x10\x04\x12\x03\x1e\x04\x0c\n\x0c\n\x05\x04\x02\x02\x10\ - \x06\x12\x03\x1e\r\x17\n\x0c\n\x05\x04\x02\x02\x10\x01\x12\x03\x1e\x18&\ - \n\x0c\n\x05\x04\x02\x02\x10\x03\x12\x03\x1e)-\n\n\n\x02\x04\x03\x12\x04\ - !\0#\x01\n\n\n\x03\x04\x03\x01\x12\x03!\x08\x12\n\x0b\n\x04\x04\x03\x02\ - \0\x12\x03\"\x04\x1f\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03\"\x04\x0c\n\ - \x0c\n\x05\x04\x03\x02\0\x06\x12\x03\"\r\x12\n\x0c\n\x05\x04\x03\x02\0\ - \x01\x12\x03\"\x13\x18\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\"\x1b\x1e\n\ - \n\n\x02\x04\x04\x12\x04%\0)\x01\n\n\n\x03\x04\x04\x01\x12\x03%\x08\x0c\ - \n\x0b\n\x04\x04\x04\x02\0\x12\x03&\x04\x1f\n\x0c\n\x05\x04\x04\x02\0\ - \x04\x12\x03&\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03&\r\x13\n\x0c\ - \n\x05\x04\x04\x02\0\x01\x12\x03&\x14\x18\n\x0c\n\x05\x04\x04\x02\0\x03\ - \x12\x03&\x1b\x1e\n\x0b\n\x04\x04\x04\x02\x01\x12\x03'\x04\x20\n\x0c\n\ - \x05\x04\x04\x02\x01\x04\x12\x03'\x04\x0c\n\x0c\n\x05\x04\x04\x02\x01\ - \x05\x12\x03'\r\x13\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03'\x14\x19\n\ - \x0c\n\x05\x04\x04\x02\x01\x03\x12\x03'\x1c\x1f\n\x0b\n\x04\x04\x04\x02\ - \x02\x12\x03(\x04\x1e\n\x0c\n\x05\x04\x04\x02\x02\x04\x12\x03(\x04\x0c\n\ - \x0c\n\x05\x04\x04\x02\x02\x05\x12\x03(\r\x13\n\x0c\n\x05\x04\x04\x02\ - \x02\x01\x12\x03(\x14\x17\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03(\x1a\ - \x1d\n\n\n\x02\x04\x05\x12\x04+\0C\x01\n\n\n\x03\x04\x05\x01\x12\x03+\ - \x08\r\n\x0b\n\x04\x04\x05\x02\0\x12\x03,\x04\x1d\n\x0c\n\x05\x04\x05\ - \x02\0\x04\x12\x03,\x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03,\r\x12\ - \n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03,\x13\x16\n\x0c\n\x05\x04\x05\x02\ - \0\x03\x12\x03,\x19\x1c\n\x0b\n\x04\x04\x05\x02\x01\x12\x03-\x04\x1f\n\ - \x0c\n\x05\x04\x05\x02\x01\x04\x12\x03-\x04\x0c\n\x0c\n\x05\x04\x05\x02\ - \x01\x05\x12\x03-\r\x13\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x03-\x14\x18\ - \n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03-\x1b\x1e\n\x0b\n\x04\x04\x05\ - \x02\x02\x12\x03.\x04!\n\x0c\n\x05\x04\x05\x02\x02\x04\x12\x03.\x04\x0c\ - \n\x0c\n\x05\x04\x05\x02\x02\x06\x12\x03.\r\x13\n\x0c\n\x05\x04\x05\x02\ - \x02\x01\x12\x03.\x14\x1a\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03.\x1d\ - \x20\n\x0b\n\x04\x04\x05\x02\x03\x12\x03/\x04\x1c\n\x0c\n\x05\x04\x05\ - \x02\x03\x04\x12\x03/\x04\x0c\n\x0c\n\x05\x04\x05\x02\x03\x06\x12\x03/\r\ - \x11\n\x0c\n\x05\x04\x05\x02\x03\x01\x12\x03/\x12\x15\n\x0c\n\x05\x04\ - \x05\x02\x03\x03\x12\x03/\x18\x1b\n\x0c\n\x04\x04\x05\x04\0\x12\x040\x04\ - 5\x05\n\x0c\n\x05\x04\x05\x04\0\x01\x12\x030\t\r\n\r\n\x06\x04\x05\x04\0\ - \x02\0\x12\x031\x08\x14\n\x0e\n\x07\x04\x05\x04\0\x02\0\x01\x12\x031\x08\ - \r\n\x0e\n\x07\x04\x05\x04\0\x02\0\x02\x12\x031\x10\x13\n\r\n\x06\x04\ - \x05\x04\0\x02\x01\x12\x032\x08\x15\n\x0e\n\x07\x04\x05\x04\0\x02\x01\ - \x01\x12\x032\x08\x0e\n\x0e\n\x07\x04\x05\x04\0\x02\x01\x02\x12\x032\x11\ - \x14\n\r\n\x06\x04\x05\x04\0\x02\x02\x12\x033\x08\x1a\n\x0e\n\x07\x04\ - \x05\x04\0\x02\x02\x01\x12\x033\x08\x13\n\x0e\n\x07\x04\x05\x04\0\x02\ - \x02\x02\x12\x033\x16\x19\n\r\n\x06\x04\x05\x04\0\x02\x03\x12\x034\x08\ - \x11\n\x0e\n\x07\x04\x05\x04\0\x02\x03\x01\x12\x034\x08\n\n\x0e\n\x07\ - \x04\x05\x04\0\x02\x03\x02\x12\x034\r\x10\n\x0b\n\x04\x04\x05\x02\x04\ - \x12\x036\x04\x20\n\x0c\n\x05\x04\x05\x02\x04\x04\x12\x036\x04\x0c\n\x0c\ - \n\x05\x04\x05\x02\x04\x05\x12\x036\r\x13\n\x0c\n\x05\x04\x05\x02\x04\ - \x01\x12\x036\x14\x19\n\x0c\n\x05\x04\x05\x02\x04\x03\x12\x036\x1c\x1f\n\ - \x0b\n\x04\x04\x05\x02\x05\x12\x037\x04\x1d\n\x0c\n\x05\x04\x05\x02\x05\ - \x04\x12\x037\x04\x0c\n\x0c\n\x05\x04\x05\x02\x05\x06\x12\x037\r\x11\n\ - \x0c\n\x05\x04\x05\x02\x05\x01\x12\x037\x12\x16\n\x0c\n\x05\x04\x05\x02\ - \x05\x03\x12\x037\x19\x1c\n\x0b\n\x04\x04\x05\x02\x06\x12\x038\x04%\n\ - \x0c\n\x05\x04\x05\x02\x06\x04\x12\x038\x04\x0c\n\x0c\n\x05\x04\x05\x02\ - \x06\x05\x12\x038\r\x13\n\x0c\n\x05\x04\x05\x02\x06\x01\x12\x038\x14\x1e\ - \n\x0c\n\x05\x04\x05\x02\x06\x03\x12\x038!$\n\x0b\n\x04\x04\x05\x02\x07\ - \x12\x039\x04\x20\n\x0c\n\x05\x04\x05\x02\x07\x04\x12\x039\x04\x0c\n\x0c\ - \n\x05\x04\x05\x02\x07\x05\x12\x039\r\x13\n\x0c\n\x05\x04\x05\x02\x07\ - \x01\x12\x039\x14\x19\n\x0c\n\x05\x04\x05\x02\x07\x03\x12\x039\x1c\x1f\n\ - \x0b\n\x04\x04\x05\x02\x08\x12\x03:\x04\x1f\n\x0c\n\x05\x04\x05\x02\x08\ - \x04\x12\x03:\x04\x0c\n\x0c\n\x05\x04\x05\x02\x08\x06\x12\x03:\r\x12\n\ - \x0c\n\x05\x04\x05\x02\x08\x01\x12\x03:\x13\x18\n\x0c\n\x05\x04\x05\x02\ - \x08\x03\x12\x03:\x1b\x1e\n\x0b\n\x04\x04\x05\x02\t\x12\x03;\x04*\n\x0c\ - \n\x05\x04\x05\x02\t\x04\x12\x03;\x04\x0c\n\x0c\n\x05\x04\x05\x02\t\x06\ - \x12\x03;\r\x17\n\x0c\n\x05\x04\x05\x02\t\x01\x12\x03;\x18#\n\x0c\n\x05\ - \x04\x05\x02\t\x03\x12\x03;&)\n\x0b\n\x04\x04\x05\x02\n\x12\x03<\x04\x1d\ - \n\x0c\n\x05\x04\x05\x02\n\x04\x12\x03<\x04\x0c\n\x0c\n\x05\x04\x05\x02\ - \n\x06\x12\x03<\r\x11\n\x0c\n\x05\x04\x05\x02\n\x01\x12\x03<\x12\x16\n\ - \x0c\n\x05\x04\x05\x02\n\x03\x12\x03<\x19\x1c\n\x0b\n\x04\x04\x05\x02\ - \x0b\x12\x03=\x04!\n\x0c\n\x05\x04\x05\x02\x0b\x04\x12\x03=\x04\x0c\n\ - \x0c\n\x05\x04\x05\x02\x0b\x05\x12\x03=\r\x13\n\x0c\n\x05\x04\x05\x02\ - \x0b\x01\x12\x03=\x14\x1a\n\x0c\n\x05\x04\x05\x02\x0b\x03\x12\x03=\x1d\ - \x20\n\x0b\n\x04\x04\x05\x02\x0c\x12\x03>\x04'\n\x0c\n\x05\x04\x05\x02\ - \x0c\x04\x12\x03>\x04\x0c\n\x0c\n\x05\x04\x05\x02\x0c\x06\x12\x03>\r\x16\ - \n\x0c\n\x05\x04\x05\x02\x0c\x01\x12\x03>\x17\x20\n\x0c\n\x05\x04\x05\ - \x02\x0c\x03\x12\x03>#&\n\x0b\n\x04\x04\x05\x02\r\x12\x03?\x04+\n\x0c\n\ - \x05\x04\x05\x02\r\x04\x12\x03?\x04\x0c\n\x0c\n\x05\x04\x05\x02\r\x06\ - \x12\x03?\r\x18\n\x0c\n\x05\x04\x05\x02\r\x01\x12\x03?\x19$\n\x0c\n\x05\ - \x04\x05\x02\r\x03\x12\x03?'*\n\x0b\n\x04\x04\x05\x02\x0e\x12\x03@\x04!\ - \n\x0c\n\x05\x04\x05\x02\x0e\x04\x12\x03@\x04\x0c\n\x0c\n\x05\x04\x05\ - \x02\x0e\x06\x12\x03@\r\x12\n\x0c\n\x05\x04\x05\x02\x0e\x01\x12\x03@\x13\ - \x1a\n\x0c\n\x05\x04\x05\x02\x0e\x03\x12\x03@\x1d\x20\n\x0b\n\x04\x04\ - \x05\x02\x0f\x12\x03A\x04+\n\x0c\n\x05\x04\x05\x02\x0f\x04\x12\x03A\x04\ - \x0c\n\x0c\n\x05\x04\x05\x02\x0f\x06\x12\x03A\r\x17\n\x0c\n\x05\x04\x05\ - \x02\x0f\x01\x12\x03A\x18#\n\x0c\n\x05\x04\x05\x02\x0f\x03\x12\x03A&*\n\ - \x0b\n\x04\x04\x05\x02\x10\x12\x03B\x04+\n\x0c\n\x05\x04\x05\x02\x10\x04\ - \x12\x03B\x04\x0c\n\x0c\n\x05\x04\x05\x02\x10\x06\x12\x03B\r\x17\n\x0c\n\ - \x05\x04\x05\x02\x10\x01\x12\x03B\x18#\n\x0c\n\x05\x04\x05\x02\x10\x03\ - \x12\x03B&*\n\n\n\x02\x04\x06\x12\x04E\0U\x01\n\n\n\x03\x04\x06\x01\x12\ - \x03E\x08\r\n\x0b\n\x04\x04\x06\x02\0\x12\x03F\x04\x1d\n\x0c\n\x05\x04\ - \x06\x02\0\x04\x12\x03F\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\x12\x03F\r\ - \x12\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03F\x13\x16\n\x0c\n\x05\x04\x06\ - \x02\0\x03\x12\x03F\x19\x1c\n\x0b\n\x04\x04\x06\x02\x01\x12\x03G\x04\x1f\ - \n\x0c\n\x05\x04\x06\x02\x01\x04\x12\x03G\x04\x0c\n\x0c\n\x05\x04\x06\ - \x02\x01\x05\x12\x03G\r\x13\n\x0c\n\x05\x04\x06\x02\x01\x01\x12\x03G\x14\ - \x18\n\x0c\n\x05\x04\x06\x02\x01\x03\x12\x03G\x1b\x1e\n\x0b\n\x04\x04\ - \x06\x02\x02\x12\x03H\x04\x1f\n\x0c\n\x05\x04\x06\x02\x02\x04\x12\x03H\ - \x04\x0c\n\x0c\n\x05\x04\x06\x02\x02\x06\x12\x03H\r\x12\n\x0c\n\x05\x04\ - \x06\x02\x02\x01\x12\x03H\x13\x18\n\x0c\n\x05\x04\x06\x02\x02\x03\x12\ - \x03H\x1b\x1e\n\x0b\n\x04\x04\x06\x02\x03\x12\x03I\x04!\n\x0c\n\x05\x04\ - \x06\x02\x03\x04\x12\x03I\x04\x0c\n\x0c\n\x05\x04\x06\x02\x03\x06\x12\ - \x03I\r\x13\n\x0c\n\x05\x04\x06\x02\x03\x01\x12\x03I\x14\x1a\n\x0c\n\x05\ - \x04\x06\x02\x03\x03\x12\x03I\x1d\x20\n\x0b\n\x04\x04\x06\x02\x04\x12\ - \x03J\x04!\n\x0c\n\x05\x04\x06\x02\x04\x04\x12\x03J\x04\x0c\n\x0c\n\x05\ - \x04\x06\x02\x04\x05\x12\x03J\r\x13\n\x0c\n\x05\x04\x06\x02\x04\x01\x12\ - \x03J\x14\x1a\n\x0c\n\x05\x04\x06\x02\x04\x03\x12\x03J\x1d\x20\n\x0b\n\ - \x04\x04\x06\x02\x05\x12\x03K\x04&\n\x0c\n\x05\x04\x06\x02\x05\x04\x12\ - \x03K\x04\x0c\n\x0c\n\x05\x04\x06\x02\x05\x05\x12\x03K\r\x13\n\x0c\n\x05\ - \x04\x06\x02\x05\x01\x12\x03K\x14\x1f\n\x0c\n\x05\x04\x06\x02\x05\x03\ - \x12\x03K\"%\n\x0b\n\x04\x04\x06\x02\x06\x12\x03L\x04#\n\x0c\n\x05\x04\ - \x06\x02\x06\x04\x12\x03L\x04\x0c\n\x0c\n\x05\x04\x06\x02\x06\x05\x12\ - \x03L\r\x13\n\x0c\n\x05\x04\x06\x02\x06\x01\x12\x03L\x14\x1c\n\x0c\n\x05\ - \x04\x06\x02\x06\x03\x12\x03L\x1f\"\n\x0b\n\x04\x04\x06\x02\x07\x12\x03M\ - \x04%\n\x0c\n\x05\x04\x06\x02\x07\x04\x12\x03M\x04\x0c\n\x0c\n\x05\x04\ - \x06\x02\x07\x05\x12\x03M\r\x13\n\x0c\n\x05\x04\x06\x02\x07\x01\x12\x03M\ - \x14\x1e\n\x0c\n\x05\x04\x06\x02\x07\x03\x12\x03M!$\n\x0b\n\x04\x04\x06\ - \x02\x08\x12\x03N\x04!\n\x0c\n\x05\x04\x06\x02\x08\x04\x12\x03N\x04\x0c\ - \n\x0c\n\x05\x04\x06\x02\x08\x05\x12\x03N\r\x11\n\x0c\n\x05\x04\x06\x02\ - \x08\x01\x12\x03N\x12\x1a\n\x0c\n\x05\x04\x06\x02\x08\x03\x12\x03N\x1d\ - \x20\n\x0b\n\x04\x04\x06\x02\t\x12\x03O\x04*\n\x0c\n\x05\x04\x06\x02\t\ - \x04\x12\x03O\x04\x0c\n\x0c\n\x05\x04\x06\x02\t\x06\x12\x03O\r\x17\n\x0c\ - \n\x05\x04\x06\x02\t\x01\x12\x03O\x18#\n\x0c\n\x05\x04\x06\x02\t\x03\x12\ - \x03O&)\n\x0b\n\x04\x04\x06\x02\n\x12\x03P\x04+\n\x0c\n\x05\x04\x06\x02\ - \n\x04\x12\x03P\x04\x0c\n\x0c\n\x05\x04\x06\x02\n\x06\x12\x03P\r\x18\n\ - \x0c\n\x05\x04\x06\x02\n\x01\x12\x03P\x19$\n\x0c\n\x05\x04\x06\x02\n\x03\ - \x12\x03P'*\n\x0b\n\x04\x04\x06\x02\x0b\x12\x03Q\x04\"\n\x0c\n\x05\x04\ - \x06\x02\x0b\x04\x12\x03Q\x04\x0c\n\x0c\n\x05\x04\x06\x02\x0b\x06\x12\ - \x03Q\r\x16\n\x0c\n\x05\x04\x06\x02\x0b\x01\x12\x03Q\x17\x1b\n\x0c\n\x05\ - \x04\x06\x02\x0b\x03\x12\x03Q\x1e!\n\x0b\n\x04\x04\x06\x02\x0c\x12\x03R\ - \x04%\n\x0c\n\x05\x04\x06\x02\x0c\x04\x12\x03R\x04\x0c\n\x0c\n\x05\x04\ - \x06\x02\x0c\x06\x12\x03R\r\x12\n\x0c\n\x05\x04\x06\x02\x0c\x01\x12\x03R\ - \x13\x1e\n\x0c\n\x05\x04\x06\x02\x0c\x03\x12\x03R!$\n\x0b\n\x04\x04\x06\ - \x02\r\x12\x03S\x04*\n\x0c\n\x05\x04\x06\x02\r\x04\x12\x03S\x04\x0c\n\ - \x0c\n\x05\x04\x06\x02\r\x06\x12\x03S\r\x17\n\x0c\n\x05\x04\x06\x02\r\ - \x01\x12\x03S\x18#\n\x0c\n\x05\x04\x06\x02\r\x03\x12\x03S&)\n\x0b\n\x04\ - \x04\x06\x02\x0e\x12\x03T\x04%\n\x0c\n\x05\x04\x06\x02\x0e\x04\x12\x03T\ - \x04\x0c\n\x0c\n\x05\x04\x06\x02\x0e\x06\x12\x03T\r\x16\n\x0c\n\x05\x04\ - \x06\x02\x0e\x01\x12\x03T\x17\x1e\n\x0c\n\x05\x04\x06\x02\x0e\x03\x12\ - \x03T!$\n\n\n\x02\x04\x07\x12\x04W\0b\x01\n\n\n\x03\x04\x07\x01\x12\x03W\ - \x08\r\n\x0b\n\x04\x04\x07\x02\0\x12\x03X\x04!\n\x0c\n\x05\x04\x07\x02\0\ - \x04\x12\x03X\x04\x0c\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03X\r\x12\n\x0c\ - \n\x05\x04\x07\x02\0\x01\x12\x03X\x13\x1a\n\x0c\n\x05\x04\x07\x02\0\x03\ - \x12\x03X\x1d\x20\n\x0b\n\x04\x04\x07\x02\x01\x12\x03Y\x04\x1d\n\x0c\n\ - \x05\x04\x07\x02\x01\x04\x12\x03Y\x04\x0c\n\x0c\n\x05\x04\x07\x02\x01\ - \x06\x12\x03Y\r\x11\n\x0c\n\x05\x04\x07\x02\x01\x01\x12\x03Y\x12\x16\n\ - \x0c\n\x05\x04\x07\x02\x01\x03\x12\x03Y\x19\x1c\n\x0c\n\x04\x04\x07\x04\ - \0\x12\x04Z\x04_\x05\n\x0c\n\x05\x04\x07\x04\0\x01\x12\x03Z\t\r\n\r\n\ - \x06\x04\x07\x04\0\x02\0\x12\x03[\x08\x16\n\x0e\n\x07\x04\x07\x04\0\x02\ - \0\x01\x12\x03[\x08\x0f\n\x0e\n\x07\x04\x07\x04\0\x02\0\x02\x12\x03[\x12\ - \x15\n\r\n\x06\x04\x07\x04\0\x02\x01\x12\x03\\\x08\x14\n\x0e\n\x07\x04\ - \x07\x04\0\x02\x01\x01\x12\x03\\\x08\r\n\x0e\n\x07\x04\x07\x04\0\x02\x01\ - \x02\x12\x03\\\x10\x13\n\r\n\x06\x04\x07\x04\0\x02\x02\x12\x03]\x08\x14\ - \n\x0e\n\x07\x04\x07\x04\0\x02\x02\x01\x12\x03]\x08\r\n\x0e\n\x07\x04\ - \x07\x04\0\x02\x02\x02\x12\x03]\x10\x13\n\r\n\x06\x04\x07\x04\0\x02\x03\ - \x12\x03^\x08\x15\n\x0e\n\x07\x04\x07\x04\0\x02\x03\x01\x12\x03^\x08\x0e\ - \n\x0e\n\x07\x04\x07\x04\0\x02\x03\x02\x12\x03^\x11\x14\n\x0b\n\x04\x04\ - \x07\x02\x02\x12\x03`\x04\x20\n\x0c\n\x05\x04\x07\x02\x02\x04\x12\x03`\ - \x04\x0c\n\x0c\n\x05\x04\x07\x02\x02\x05\x12\x03`\r\x13\n\x0c\n\x05\x04\ - \x07\x02\x02\x01\x12\x03`\x14\x19\n\x0c\n\x05\x04\x07\x02\x02\x03\x12\ - \x03`\x1c\x1f\n\x0b\n\x04\x04\x07\x02\x03\x12\x03a\x04!\n\x0c\n\x05\x04\ - \x07\x02\x03\x04\x12\x03a\x04\x0c\n\x0c\n\x05\x04\x07\x02\x03\x05\x12\ - \x03a\r\x13\n\x0c\n\x05\x04\x07\x02\x03\x01\x12\x03a\x14\x1a\n\x0c\n\x05\ - \x04\x07\x02\x03\x03\x12\x03a\x1d\x20\n\n\n\x02\x04\x08\x12\x04d\0f\x01\ - \n\n\n\x03\x04\x08\x01\x12\x03d\x08\x12\n\x0b\n\x04\x04\x08\x02\0\x12\ - \x03e\x04\x1f\n\x0c\n\x05\x04\x08\x02\0\x04\x12\x03e\x04\x0c\n\x0c\n\x05\ - \x04\x08\x02\0\x06\x12\x03e\r\x12\n\x0c\n\x05\x04\x08\x02\0\x01\x12\x03e\ - \x13\x18\n\x0c\n\x05\x04\x08\x02\0\x03\x12\x03e\x1b\x1e\n\n\n\x02\x04\t\ - \x12\x04h\0l\x01\n\n\n\x03\x04\t\x01\x12\x03h\x08\x11\n\x0b\n\x04\x04\t\ - \x02\0\x12\x03i\x04\x1f\n\x0c\n\x05\x04\t\x02\0\x04\x12\x03i\x04\x0c\n\ - \x0c\n\x05\x04\t\x02\0\x05\x12\x03i\r\x13\n\x0c\n\x05\x04\t\x02\0\x01\ - \x12\x03i\x14\x18\n\x0c\n\x05\x04\t\x02\0\x03\x12\x03i\x1b\x1e\n\x0b\n\ - \x04\x04\t\x02\x01\x12\x03j\x04\"\n\x0c\n\x05\x04\t\x02\x01\x04\x12\x03j\ - \x04\x0c\n\x0c\n\x05\x04\t\x02\x01\x06\x12\x03j\r\x12\n\x0c\n\x05\x04\t\ - \x02\x01\x01\x12\x03j\x13\x1b\n\x0c\n\x05\x04\t\x02\x01\x03\x12\x03j\x1e\ - !\n\x0b\n\x04\x04\t\x02\x02\x12\x03k\x04-\n\x0c\n\x05\x04\t\x02\x02\x04\ - \x12\x03k\x04\x0c\n\x0c\n\x05\x04\t\x02\x02\x06\x12\x03k\r\x17\n\x0c\n\ - \x05\x04\t\x02\x02\x01\x12\x03k\x18&\n\x0c\n\x05\x04\t\x02\x02\x03\x12\ - \x03k),\n\n\n\x02\x04\n\x12\x04n\0r\x01\n\n\n\x03\x04\n\x01\x12\x03n\x08\ - \x0c\n\x0b\n\x04\x04\n\x02\0\x12\x03o\x04!\n\x0c\n\x05\x04\n\x02\0\x04\ - \x12\x03o\x04\x0c\n\x0c\n\x05\x04\n\x02\0\x05\x12\x03o\r\x13\n\x0c\n\x05\ - \x04\n\x02\0\x01\x12\x03o\x14\x1a\n\x0c\n\x05\x04\n\x02\0\x03\x12\x03o\ - \x1d\x20\n\x0b\n\x04\x04\n\x02\x01\x12\x03p\x04\x1f\n\x0c\n\x05\x04\n\ - \x02\x01\x04\x12\x03p\x04\x0c\n\x0c\n\x05\x04\n\x02\x01\x05\x12\x03p\r\ - \x13\n\x0c\n\x05\x04\n\x02\x01\x01\x12\x03p\x14\x18\n\x0c\n\x05\x04\n\ - \x02\x01\x03\x12\x03p\x1b\x1e\n\x0b\n\x04\x04\n\x02\x02\x12\x03q\x04\x1f\ - \n\x0c\n\x05\x04\n\x02\x02\x04\x12\x03q\x04\x0c\n\x0c\n\x05\x04\n\x02\ - \x02\x06\x12\x03q\r\x12\n\x0c\n\x05\x04\n\x02\x02\x01\x12\x03q\x13\x18\n\ - \x0c\n\x05\x04\n\x02\x02\x03\x12\x03q\x1b\x1e\n\n\n\x02\x04\x0b\x12\x04t\ - \0{\x01\n\n\n\x03\x04\x0b\x01\x12\x03t\x08\x11\n\x0b\n\x04\x04\x0b\x02\0\ - \x12\x03u\x04\x1c\n\x0c\n\x05\x04\x0b\x02\0\x04\x12\x03u\x04\x0c\n\x0c\n\ - \x05\x04\x0b\x02\0\x06\x12\x03u\r\x11\n\x0c\n\x05\x04\x0b\x02\0\x01\x12\ - \x03u\x12\x15\n\x0c\n\x05\x04\x0b\x02\0\x03\x12\x03u\x18\x1b\n\x0c\n\x04\ - \x04\x0b\x04\0\x12\x04v\x04y\x05\n\x0c\n\x05\x04\x0b\x04\0\x01\x12\x03v\ - \t\r\n\r\n\x06\x04\x0b\x04\0\x02\0\x12\x03w\x08\x10\n\x0e\n\x07\x04\x0b\ - \x04\0\x02\0\x01\x12\x03w\x08\t\n\x0e\n\x07\x04\x0b\x04\0\x02\0\x02\x12\ - \x03w\x0c\x0f\n\r\n\x06\x04\x0b\x04\0\x02\x01\x12\x03x\x08\x10\n\x0e\n\ - \x07\x04\x0b\x04\0\x02\x01\x01\x12\x03x\x08\t\n\x0e\n\x07\x04\x0b\x04\0\ - \x02\x01\x02\x12\x03x\x0c\x0f\n\x0b\n\x04\x04\x0b\x02\x01\x12\x03z\x04\ - \x1f\n\x0c\n\x05\x04\x0b\x02\x01\x04\x12\x03z\x04\x0c\n\x0c\n\x05\x04\ - \x0b\x02\x01\x05\x12\x03z\r\x13\n\x0c\n\x05\x04\x0b\x02\x01\x01\x12\x03z\ - \x14\x18\n\x0c\n\x05\x04\x0b\x02\x01\x03\x12\x03z\x1b\x1e\n\x0b\n\x02\ - \x04\x0c\x12\x05}\0\x85\x01\x01\n\n\n\x03\x04\x0c\x01\x12\x03}\x08\x13\n\ - \x0b\n\x04\x04\x0c\x02\0\x12\x03~\x04,\n\x0c\n\x05\x04\x0c\x02\0\x04\x12\ - \x03~\x04\x0c\n\x0c\n\x05\x04\x0c\x02\0\x05\x12\x03~\r\x13\n\x0c\n\x05\ - \x04\x0c\x02\0\x01\x12\x03~\x14%\n\x0c\n\x05\x04\x0c\x02\0\x03\x12\x03~(\ - +\n\x0b\n\x04\x04\x0c\x02\x01\x12\x03\x7f\x04.\n\x0c\n\x05\x04\x0c\x02\ - \x01\x04\x12\x03\x7f\x04\x0c\n\x0c\n\x05\x04\x0c\x02\x01\x05\x12\x03\x7f\ - \r\x13\n\x0c\n\x05\x04\x0c\x02\x01\x01\x12\x03\x7f\x14'\n\x0c\n\x05\x04\ - \x0c\x02\x01\x03\x12\x03\x7f*-\n\x0c\n\x04\x04\x0c\x02\x02\x12\x04\x80\ - \x01\x04\x1c\n\r\n\x05\x04\x0c\x02\x02\x04\x12\x04\x80\x01\x04\x0c\n\r\n\ - \x05\x04\x0c\x02\x02\x06\x12\x04\x80\x01\r\x11\n\r\n\x05\x04\x0c\x02\x02\ - \x01\x12\x04\x80\x01\x12\x15\n\r\n\x05\x04\x0c\x02\x02\x03\x12\x04\x80\ - \x01\x18\x1b\n\x0e\n\x04\x04\x0c\x04\0\x12\x06\x81\x01\x04\x83\x01\x05\n\ - \r\n\x05\x04\x0c\x04\0\x01\x12\x04\x81\x01\t\r\n\x0e\n\x06\x04\x0c\x04\0\ - \x02\0\x12\x04\x82\x01\x08\x18\n\x0f\n\x07\x04\x0c\x04\0\x02\0\x01\x12\ - \x04\x82\x01\x08\x11\n\x0f\n\x07\x04\x0c\x04\0\x02\0\x02\x12\x04\x82\x01\ - \x14\x17\n\x0c\n\x04\x04\x0c\x02\x03\x12\x04\x84\x01\x04(\n\r\n\x05\x04\ - \x0c\x02\x03\x04\x12\x04\x84\x01\x04\x0c\n\r\n\x05\x04\x0c\x02\x03\x05\ - \x12\x04\x84\x01\r\x13\n\r\n\x05\x04\x0c\x02\x03\x01\x12\x04\x84\x01\x14\ - !\n\r\n\x05\x04\x0c\x02\x03\x03\x12\x04\x84\x01$'\n\x0c\n\x02\x04\r\x12\ - \x06\x87\x01\0\x8b\x01\x01\n\x0b\n\x03\x04\r\x01\x12\x04\x87\x01\x08\x12\ - \n\x0c\n\x04\x04\r\x02\0\x12\x04\x88\x01\x04+\n\r\n\x05\x04\r\x02\0\x04\ - \x12\x04\x88\x01\x04\x0c\n\r\n\x05\x04\r\x02\0\x06\x12\x04\x88\x01\r\x18\ - \n\r\n\x05\x04\r\x02\0\x01\x12\x04\x88\x01\x19$\n\r\n\x05\x04\r\x02\0\ - \x03\x12\x04\x88\x01'*\n\x0c\n\x04\x04\r\x02\x01\x12\x04\x89\x01\x04\x1e\ - \n\r\n\x05\x04\r\x02\x01\x04\x12\x04\x89\x01\x04\x0c\n\r\n\x05\x04\r\x02\ - \x01\x06\x12\x04\x89\x01\r\x11\n\r\n\x05\x04\r\x02\x01\x01\x12\x04\x89\ - \x01\x12\x17\n\r\n\x05\x04\r\x02\x01\x03\x12\x04\x89\x01\x1a\x1d\n\x0c\n\ - \x04\x04\r\x02\x02\x12\x04\x8a\x01\x04\x1c\n\r\n\x05\x04\r\x02\x02\x04\ - \x12\x04\x8a\x01\x04\x0c\n\r\n\x05\x04\r\x02\x02\x06\x12\x04\x8a\x01\r\ - \x11\n\r\n\x05\x04\r\x02\x02\x01\x12\x04\x8a\x01\x12\x15\n\r\n\x05\x04\r\ - \x02\x02\x03\x12\x04\x8a\x01\x18\x1b\n\x0c\n\x02\x04\x0e\x12\x06\x8d\x01\ - \0\x90\x01\x01\n\x0b\n\x03\x04\x0e\x01\x12\x04\x8d\x01\x08\x12\n\x0c\n\ - \x04\x04\x0e\x02\0\x12\x04\x8e\x01\x04\x1e\n\r\n\x05\x04\x0e\x02\0\x04\ - \x12\x04\x8e\x01\x04\x0c\n\r\n\x05\x04\x0e\x02\0\x05\x12\x04\x8e\x01\r\ - \x13\n\r\n\x05\x04\x0e\x02\0\x01\x12\x04\x8e\x01\x14\x17\n\r\n\x05\x04\ - \x0e\x02\0\x03\x12\x04\x8e\x01\x1a\x1d\n\x0c\n\x04\x04\x0e\x02\x01\x12\ - \x04\x8f\x01\x04\x1d\n\r\n\x05\x04\x0e\x02\x01\x04\x12\x04\x8f\x01\x04\ - \x0c\n\r\n\x05\x04\x0e\x02\x01\x05\x12\x04\x8f\x01\r\x13\n\r\n\x05\x04\ - \x0e\x02\x01\x01\x12\x04\x8f\x01\x14\x16\n\r\n\x05\x04\x0e\x02\x01\x03\ - \x12\x04\x8f\x01\x19\x1c\n\x0c\n\x02\x04\x0f\x12\x06\x92\x01\0\xa5\x01\ - \x01\n\x0b\n\x03\x04\x0f\x01\x12\x04\x92\x01\x08\x11\n\x0c\n\x04\x04\x0f\ - \x02\0\x12\x04\x93\x01\x04!\n\r\n\x05\x04\x0f\x02\0\x04\x12\x04\x93\x01\ - \x04\x0c\n\r\n\x05\x04\x0f\x02\0\x05\x12\x04\x93\x01\r\x12\n\r\n\x05\x04\ - \x0f\x02\0\x01\x12\x04\x93\x01\x13\x1a\n\r\n\x05\x04\x0f\x02\0\x03\x12\ - \x04\x93\x01\x1d\x20\n\x0c\n\x04\x04\x0f\x02\x01\x12\x04\x94\x01\x04!\n\ - \r\n\x05\x04\x0f\x02\x01\x04\x12\x04\x94\x01\x04\x0c\n\r\n\x05\x04\x0f\ - \x02\x01\x06\x12\x04\x94\x01\r\x13\n\r\n\x05\x04\x0f\x02\x01\x01\x12\x04\ - \x94\x01\x14\x1a\n\r\n\x05\x04\x0f\x02\x01\x03\x12\x04\x94\x01\x1d\x20\n\ - \x0e\n\x04\x04\x0f\x04\0\x12\x06\x95\x01\x04\xa4\x01\x05\n\r\n\x05\x04\ - \x0f\x04\0\x01\x12\x04\x95\x01\t\x0f\n\x0e\n\x06\x04\x0f\x04\0\x02\0\x12\ - \x04\x96\x01\x08\x1c\n\x0f\n\x07\x04\x0f\x04\0\x02\0\x01\x12\x04\x96\x01\ - \x08\x15\n\x0f\n\x07\x04\x0f\x04\0\x02\0\x02\x12\x04\x96\x01\x18\x1b\n\ - \x0e\n\x06\x04\x0f\x04\0\x02\x01\x12\x04\x97\x01\x08\x1d\n\x0f\n\x07\x04\ - \x0f\x04\0\x02\x01\x01\x12\x04\x97\x01\x08\x16\n\x0f\n\x07\x04\x0f\x04\0\ - \x02\x01\x02\x12\x04\x97\x01\x19\x1c\n\x0e\n\x06\x04\x0f\x04\0\x02\x02\ - \x12\x04\x98\x01\x08\x1d\n\x0f\n\x07\x04\x0f\x04\0\x02\x02\x01\x12\x04\ - \x98\x01\x08\x16\n\x0f\n\x07\x04\x0f\x04\0\x02\x02\x02\x12\x04\x98\x01\ - \x19\x1c\n\x0e\n\x06\x04\x0f\x04\0\x02\x03\x12\x04\x99\x01\x08\x16\n\x0f\ - \n\x07\x04\x0f\x04\0\x02\x03\x01\x12\x04\x99\x01\x08\x0f\n\x0f\n\x07\x04\ - \x0f\x04\0\x02\x03\x02\x12\x04\x99\x01\x12\x15\n\x0e\n\x06\x04\x0f\x04\0\ - \x02\x04\x12\x04\x9a\x01\x08\x16\n\x0f\n\x07\x04\x0f\x04\0\x02\x04\x01\ - \x12\x04\x9a\x01\x08\x0f\n\x0f\n\x07\x04\x0f\x04\0\x02\x04\x02\x12\x04\ - \x9a\x01\x12\x15\n\x0e\n\x06\x04\x0f\x04\0\x02\x05\x12\x04\x9b\x01\x08\ - \x16\n\x0f\n\x07\x04\x0f\x04\0\x02\x05\x01\x12\x04\x9b\x01\x08\x0f\n\x0f\ - \n\x07\x04\x0f\x04\0\x02\x05\x02\x12\x04\x9b\x01\x12\x15\n\x0e\n\x06\x04\ - \x0f\x04\0\x02\x06\x12\x04\x9c\x01\x08\x15\n\x0f\n\x07\x04\x0f\x04\0\x02\ - \x06\x01\x12\x04\x9c\x01\x08\x0e\n\x0f\n\x07\x04\x0f\x04\0\x02\x06\x02\ - \x12\x04\x9c\x01\x11\x14\n\x0e\n\x06\x04\x0f\x04\0\x02\x07\x12\x04\x9d\ - \x01\x08\x1a\n\x0f\n\x07\x04\x0f\x04\0\x02\x07\x01\x12\x04\x9d\x01\x08\ - \x13\n\x0f\n\x07\x04\x0f\x04\0\x02\x07\x02\x12\x04\x9d\x01\x16\x19\n\x0e\ - \n\x06\x04\x0f\x04\0\x02\x08\x12\x04\x9e\x01\x08\x15\n\x0f\n\x07\x04\x0f\ - \x04\0\x02\x08\x01\x12\x04\x9e\x01\x08\x0e\n\x0f\n\x07\x04\x0f\x04\0\x02\ - \x08\x02\x12\x04\x9e\x01\x11\x14\n\x0e\n\x06\x04\x0f\x04\0\x02\t\x12\x04\ - \x9f\x01\x08\x15\n\x0f\n\x07\x04\x0f\x04\0\x02\t\x01\x12\x04\x9f\x01\x08\ - \x0e\n\x0f\n\x07\x04\x0f\x04\0\x02\t\x02\x12\x04\x9f\x01\x11\x14\n\x0e\n\ - \x06\x04\x0f\x04\0\x02\n\x12\x04\xa0\x01\x08\x16\n\x0f\n\x07\x04\x0f\x04\ - \0\x02\n\x01\x12\x04\xa0\x01\x08\x0f\n\x0f\n\x07\x04\x0f\x04\0\x02\n\x02\ - \x12\x04\xa0\x01\x12\x15\n\x0e\n\x06\x04\x0f\x04\0\x02\x0b\x12\x04\xa1\ - \x01\x08\x16\n\x0f\n\x07\x04\x0f\x04\0\x02\x0b\x01\x12\x04\xa1\x01\x08\ - \x0f\n\x0f\n\x07\x04\x0f\x04\0\x02\x0b\x02\x12\x04\xa1\x01\x12\x15\n\x0e\ - \n\x06\x04\x0f\x04\0\x02\x0c\x12\x04\xa2\x01\x08\x15\n\x0f\n\x07\x04\x0f\ - \x04\0\x02\x0c\x01\x12\x04\xa2\x01\x08\x0e\n\x0f\n\x07\x04\x0f\x04\0\x02\ - \x0c\x02\x12\x04\xa2\x01\x11\x14\n\x0e\n\x06\x04\x0f\x04\0\x02\r\x12\x04\ - \xa3\x01\x08\x15\n\x0f\n\x07\x04\x0f\x04\0\x02\r\x01\x12\x04\xa3\x01\x08\ - \x0e\n\x0f\n\x07\x04\x0f\x04\0\x02\r\x02\x12\x04\xa3\x01\x11\x14\ + \n\x0emetadata.proto\x12\0\"9\n\tTopTracks\x12\x11\n\x07country\x18\x01\ + \x20\x01(\tB\0\x12\x17\n\x05track\x18\x02\x20\x03(\x0b2\x06.TrackB\0:\0\ + \"N\n\x0eActivityPeriod\x12\x14\n\nstart_year\x18\x01\x20\x01(\x11B\0\ + \x12\x12\n\x08end_year\x18\x02\x20\x01(\x11B\0\x12\x10\n\x06decade\x18\ + \x03\x20\x01(\x11B\0:\0\"\xa5\x04\n\x06Artist\x12\r\n\x03gid\x18\x01\x20\ + \x01(\x0cB\0\x12\x0e\n\x04name\x18\x02\x20\x01(\tB\0\x12\x14\n\npopulari\ + ty\x18\x03\x20\x01(\x11B\0\x12\x1f\n\ttop_track\x18\x04\x20\x03(\x0b2\n.\ + TopTracksB\0\x12\"\n\x0balbum_group\x18\x05\x20\x03(\x0b2\x0b.AlbumGroup\ + B\0\x12#\n\x0csingle_group\x18\x06\x20\x03(\x0b2\x0b.AlbumGroupB\0\x12(\ + \n\x11compilation_group\x18\x07\x20\x03(\x0b2\x0b.AlbumGroupB\0\x12'\n\ + \x10appears_on_group\x18\x08\x20\x03(\x0b2\x0b.AlbumGroupB\0\x12\x0f\n\ + \x05genre\x18\t\x20\x03(\tB\0\x12\"\n\x0bexternal_id\x18\n\x20\x03(\x0b2\ + \x0b.ExternalIdB\0\x12\x1a\n\x08portrait\x18\x0b\x20\x03(\x0b2\x06.Image\ + B\0\x12\x1f\n\tbiography\x18\x0c\x20\x03(\x0b2\n.BiographyB\0\x12*\n\x0f\ + activity_period\x18\r\x20\x03(\x0b2\x0f.ActivityPeriodB\0\x12#\n\x0brest\ + riction\x18\x0e\x20\x03(\x0b2\x0c.RestrictionB\0\x12\x1a\n\x07related\ + \x18\x0f\x20\x03(\x0b2\x07.ArtistB\0\x12!\n\x17is_portrait_album_cover\ + \x18\x10\x20\x01(\x08B\0\x12%\n\x0eportrait_group\x18\x11\x20\x01(\x0b2\ + \x0b.ImageGroupB\0:\0\"'\n\nAlbumGroup\x12\x17\n\x05album\x18\x01\x20\ + \x03(\x0b2\x06.AlbumB\0:\0\"8\n\x04Date\x12\x0e\n\x04year\x18\x01\x20\ + \x01(\x11B\0\x12\x0f\n\x05month\x18\x02\x20\x01(\x11B\0\x12\r\n\x03day\ + \x18\x03\x20\x01(\x11B\0:\0\"\xf7\x03\n\x05Album\x12\r\n\x03gid\x18\x01\ + \x20\x01(\x0cB\0\x12\x0e\n\x04name\x18\x02\x20\x01(\tB\0\x12\x19\n\x06ar\ + tist\x18\x03\x20\x03(\x0b2\x07.ArtistB\0\x12\x1a\n\x03typ\x18\x04\x20\ + \x01(\x0e2\x0b.Album.TypeB\0\x12\x0f\n\x05label\x18\x05\x20\x01(\tB\0\ + \x12\x15\n\x04date\x18\x06\x20\x01(\x0b2\x05.DateB\0\x12\x14\n\npopulari\ + ty\x18\x07\x20\x01(\x11B\0\x12\x0f\n\x05genre\x18\x08\x20\x03(\tB\0\x12\ + \x17\n\x05cover\x18\t\x20\x03(\x0b2\x06.ImageB\0\x12\"\n\x0bexternal_id\ + \x18\n\x20\x03(\x0b2\x0b.ExternalIdB\0\x12\x15\n\x04disc\x18\x0b\x20\x03\ + (\x0b2\x05.DiscB\0\x12\x10\n\x06review\x18\x0c\x20\x03(\tB\0\x12\x1f\n\t\ + copyright\x18\r\x20\x03(\x0b2\n.CopyrightB\0\x12#\n\x0brestriction\x18\ + \x0e\x20\x03(\x0b2\x0c.RestrictionB\0\x12\x19\n\x07related\x18\x0f\x20\ + \x03(\x0b2\x06.AlbumB\0\x12\"\n\x0bsale_period\x18\x10\x20\x03(\x0b2\x0b\ + .SalePeriodB\0\x12\"\n\x0bcover_group\x18\x11\x20\x01(\x0b2\x0b.ImageGro\ + upB\0\"8\n\x04Type\x12\t\n\x05ALBUM\x10\x01\x12\n\n\x06SINGLE\x10\x02\ + \x12\x0f\n\x0bCOMPILATION\x10\x03\x12\x06\n\x02EP\x10\x04\x1a\0:\0\"\x8a\ + \x03\n\x05Track\x12\r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\x0e\n\x04name\ + \x18\x02\x20\x01(\tB\0\x12\x17\n\x05album\x18\x03\x20\x01(\x0b2\x06.Albu\ + mB\0\x12\x19\n\x06artist\x18\x04\x20\x03(\x0b2\x07.ArtistB\0\x12\x10\n\ + \x06number\x18\x05\x20\x01(\x11B\0\x12\x15\n\x0bdisc_number\x18\x06\x20\ + \x01(\x11B\0\x12\x12\n\x08duration\x18\x07\x20\x01(\x11B\0\x12\x14\n\npo\ + pularity\x18\x08\x20\x01(\x11B\0\x12\x12\n\x08explicit\x18\t\x20\x01(\ + \x08B\0\x12\"\n\x0bexternal_id\x18\n\x20\x03(\x0b2\x0b.ExternalIdB\0\x12\ + #\n\x0brestriction\x18\x0b\x20\x03(\x0b2\x0c.RestrictionB\0\x12\x1a\n\ + \x04file\x18\x0c\x20\x03(\x0b2\n.AudioFileB\0\x12\x1d\n\x0balternative\ + \x18\r\x20\x03(\x0b2\x06.TrackB\0\x12\"\n\x0bsale_period\x18\x0e\x20\x03\ + (\x0b2\x0b.SalePeriodB\0\x12\x1d\n\x07preview\x18\x0f\x20\x03(\x0b2\n.Au\ + dioFileB\0:\0\"\x95\x01\n\x05Image\x12\x11\n\x07file_id\x18\x01\x20\x01(\ + \x0cB\0\x12\x1b\n\x04size\x18\x02\x20\x01(\x0e2\x0b.Image.SizeB\0\x12\ + \x0f\n\x05width\x18\x03\x20\x01(\x11B\0\x12\x10\n\x06height\x18\x04\x20\ + \x01(\x11B\0\"7\n\x04Size\x12\x0b\n\x07DEFAULT\x10\0\x12\t\n\x05SMALL\ + \x10\x01\x12\t\n\x05LARGE\x10\x02\x12\n\n\x06XLARGE\x10\x03\x1a\0:\0\"'\ + \n\nImageGroup\x12\x17\n\x05image\x18\x01\x20\x03(\x0b2\x06.ImageB\0:\0\ + \"`\n\tBiography\x12\x0e\n\x04text\x18\x01\x20\x01(\tB\0\x12\x1a\n\x08po\ + rtrait\x18\x02\x20\x03(\x0b2\x06.ImageB\0\x12%\n\x0eportrait_group\x18\ + \x03\x20\x03(\x0b2\x0b.ImageGroupB\0:\0\"C\n\x04Disc\x12\x10\n\x06number\ + \x18\x01\x20\x01(\x11B\0\x12\x0e\n\x04name\x18\x02\x20\x01(\tB\0\x12\x17\ + \n\x05track\x18\x03\x20\x03(\x0b2\x06.TrackB\0:\0\"U\n\tCopyright\x12\ + \x1e\n\x03typ\x18\x01\x20\x01(\x0e2\x0f.Copyright.TypeB\0\x12\x0e\n\x04t\ + ext\x18\x02\x20\x01(\tB\0\"\x16\n\x04Type\x12\x05\n\x01P\x10\0\x12\x05\n\ + \x01C\x10\x01\x1a\0:\0\"\x9f\x01\n\x0bRestriction\x12\x1b\n\x11countries\ + _allowed\x18\x02\x20\x01(\tB\0\x12\x1d\n\x13countries_forbidden\x18\x03\ + \x20\x01(\tB\0\x12\x20\n\x03typ\x18\x04\x20\x01(\x0e2\x11.Restriction.Ty\ + peB\0\x12\x17\n\rcatalogue_str\x18\x05\x20\x03(\tB\0\"\x17\n\x04Type\x12\ + \r\n\tSTREAMING\x10\0\x1a\0:\0\"a\n\nSalePeriod\x12#\n\x0brestriction\ + \x18\x01\x20\x03(\x0b2\x0c.RestrictionB\0\x12\x16\n\x05start\x18\x02\x20\ + \x01(\x0b2\x05.DateB\0\x12\x14\n\x03end\x18\x03\x20\x01(\x0b2\x05.DateB\ + \0:\0\"+\n\nExternalId\x12\r\n\x03typ\x18\x01\x20\x01(\tB\0\x12\x0c\n\ + \x02id\x18\x02\x20\x01(\tB\0:\0\"\x9b\x02\n\tAudioFile\x12\x11\n\x07file\ + _id\x18\x01\x20\x01(\x0cB\0\x12#\n\x06format\x18\x02\x20\x01(\x0e2\x11.A\ + udioFile.FormatB\0\"\xd3\x01\n\x06Format\x12\x11\n\rOGG_VORBIS_96\x10\0\ + \x12\x12\n\x0eOGG_VORBIS_160\x10\x01\x12\x12\n\x0eOGG_VORBIS_320\x10\x02\ + \x12\x0b\n\x07MP3_256\x10\x03\x12\x0b\n\x07MP3_320\x10\x04\x12\x0b\n\x07\ + MP3_160\x10\x05\x12\n\n\x06MP3_96\x10\x06\x12\x0f\n\x0bMP3_160_ENC\x10\ + \x07\x12\n\n\x06OTHER2\x10\x08\x12\n\n\x06OTHER3\x10\t\x12\x0b\n\x07AAC_\ + 160\x10\n\x12\x0b\n\x07AAC_320\x10\x0b\x12\n\n\x06OTHER4\x10\x0c\x12\n\n\ + \x06OTHER5\x10\r\x1a\0:\0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/protocol/src/pubsub.rs b/protocol/src/pubsub.rs index ed74d9be..31871a2d 100644 --- a/protocol/src/pubsub.rs +++ b/protocol/src/pubsub.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,10 +17,15 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `pubsub.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct Subscription { // message fields @@ -28,30 +33,30 @@ pub struct Subscription { expiry: ::std::option::Option, status_code: ::std::option::Option, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Subscription {} +impl<'a> ::std::default::Default for &'a Subscription { + fn default() -> &'a Subscription { + ::default_instance() + } +} impl Subscription { pub fn new() -> Subscription { ::std::default::Default::default() } - pub fn default_instance() -> &'static Subscription { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Subscription, - }; - unsafe { - instance.get(Subscription::new) - } - } - // optional string uri = 1; + + pub fn get_uri(&self) -> &str { + match self.uri.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_uri(&mut self) { self.uri.clear(); } @@ -79,23 +84,12 @@ impl Subscription { self.uri.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_uri(&self) -> &str { - match self.uri.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional int32 expiry = 2; - fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.uri - } - fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.uri + pub fn get_expiry(&self) -> i32 { + self.expiry.unwrap_or(0) } - - // optional int32 expiry = 2; - pub fn clear_expiry(&mut self) { self.expiry = ::std::option::Option::None; } @@ -109,20 +103,12 @@ impl Subscription { self.expiry = ::std::option::Option::Some(v); } - pub fn get_expiry(&self) -> i32 { - self.expiry.unwrap_or(0) - } + // optional int32 status_code = 3; - fn get_expiry_for_reflect(&self) -> &::std::option::Option { - &self.expiry - } - fn mut_expiry_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.expiry + pub fn get_status_code(&self) -> i32 { + self.status_code.unwrap_or(0) } - - // optional int32 status_code = 3; - pub fn clear_status_code(&mut self) { self.status_code = ::std::option::Option::None; } @@ -135,18 +121,6 @@ impl Subscription { pub fn set_status_code(&mut self, v: i32) { self.status_code = ::std::option::Option::Some(v); } - - pub fn get_status_code(&self) -> i32 { - self.status_code.unwrap_or(0) - } - - fn get_status_code_for_reflect(&self) -> &::std::option::Option { - &self.status_code - } - - fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.status_code - } } impl ::protobuf::Message for Subscription { @@ -227,27 +201,25 @@ impl ::protobuf::Message for Subscription { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Subscription { fn new() -> Subscription { Subscription::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -257,18 +229,18 @@ impl ::protobuf::MessageStatic for Subscription { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - Subscription::get_uri_for_reflect, - Subscription::mut_uri_for_reflect, + |m: &Subscription| { &m.uri }, + |m: &mut Subscription| { &mut m.uri }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "expiry", - Subscription::get_expiry_for_reflect, - Subscription::mut_expiry_for_reflect, + |m: &Subscription| { &m.expiry }, + |m: &mut Subscription| { &mut m.expiry }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "status_code", - Subscription::get_status_code_for_reflect, - Subscription::mut_status_code_for_reflect, + |m: &Subscription| { &m.status_code }, + |m: &mut Subscription| { &mut m.status_code }, )); ::protobuf::reflect::MessageDescriptor::new::( "Subscription", @@ -278,13 +250,23 @@ impl ::protobuf::MessageStatic for Subscription { }) } } + + fn default_instance() -> &'static Subscription { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Subscription, + }; + unsafe { + instance.get(Subscription::new) + } + } } impl ::protobuf::Clear for Subscription { fn clear(&mut self) { - self.clear_uri(); - self.clear_expiry(); - self.clear_status_code(); + self.uri.clear(); + self.expiry = ::std::option::Option::None; + self.status_code = ::std::option::Option::None; self.unknown_fields.clear(); } } @@ -302,21 +284,9 @@ impl ::protobuf::reflect::ProtobufValue for Subscription { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0cpubsub.proto\"Y\n\x0cSubscription\x12\x10\n\x03uri\x18\x01\x20\x01\ - (\tR\x03uri\x12\x16\n\x06expiry\x18\x02\x20\x01(\x05R\x06expiry\x12\x1f\ - \n\x0bstatus_code\x18\x03\x20\x01(\x05R\nstatusCodeJ\xf9\x01\n\x06\x12\ - \x04\0\0\x06\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\ - \x02\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x14\n\x0b\n\x04\x04\0\ - \x02\0\x12\x03\x03\x04\x1e\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x04\ - \x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\r\x13\n\x0c\n\x05\x04\0\x02\ - \0\x01\x12\x03\x03\x14\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1a\ - \x1d\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x20\n\x0c\n\x05\x04\0\x02\ - \x01\x04\x12\x03\x04\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\r\ - \x12\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x13\x19\n\x0c\n\x05\x04\0\ - \x02\x01\x03\x12\x03\x04\x1c\x1f\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\ - \x04%\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\x05\x04\x0c\n\x0c\n\x05\x04\ - \0\x02\x02\x05\x12\x03\x05\r\x12\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\ - \x05\x13\x1e\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05!$\ + \n\x0cpubsub.proto\x12\0\"H\n\x0cSubscription\x12\r\n\x03uri\x18\x01\x20\ + \x01(\tB\0\x12\x10\n\x06expiry\x18\x02\x20\x01(\x05B\0\x12\x15\n\x0bstat\ + us_code\x18\x03\x20\x01(\x05B\0:\0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/protocol/src/spirc.rs b/protocol/src/spirc.rs index a8b2f265..80b92d24 100644 --- a/protocol/src/spirc.rs +++ b/protocol/src/spirc.rs @@ -1,9 +1,9 @@ -// This file is generated. Do not edit +// This file is generated by rust-protobuf 2.8.0. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] -#![allow(clippy)] +#![allow(clippy::all)] #![cfg_attr(rustfmt, rustfmt_skip)] @@ -17,10 +17,15 @@ #![allow(unsafe_code)] #![allow(unused_imports)] #![allow(unused_results)] +//! Generated file from `spirc.proto` use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; +/// Generated files are compatible only with the same version +/// of protobuf runtime. +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_0; + #[derive(PartialEq,Clone,Default)] pub struct Frame { // message fields @@ -40,30 +45,27 @@ pub struct Frame { new_name: ::protobuf::SingularField<::std::string::String>, metadata: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Frame {} +impl<'a> ::std::default::Default for &'a Frame { + fn default() -> &'a Frame { + ::default_instance() + } +} impl Frame { pub fn new() -> Frame { ::std::default::Default::default() } - pub fn default_instance() -> &'static Frame { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Frame, - }; - unsafe { - instance.get(Frame::new) - } - } - // optional uint32 version = 1; + + pub fn get_version(&self) -> u32 { + self.version.unwrap_or(0) + } pub fn clear_version(&mut self) { self.version = ::std::option::Option::None; } @@ -77,20 +79,15 @@ impl Frame { self.version = ::std::option::Option::Some(v); } - pub fn get_version(&self) -> u32 { - self.version.unwrap_or(0) - } + // optional string ident = 2; - fn get_version_for_reflect(&self) -> &::std::option::Option { - &self.version - } - fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.version + pub fn get_ident(&self) -> &str { + match self.ident.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string ident = 2; - pub fn clear_ident(&mut self) { self.ident.clear(); } @@ -118,23 +115,15 @@ impl Frame { self.ident.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_ident(&self) -> &str { - match self.ident.as_ref() { + // optional string protocol_version = 3; + + + pub fn get_protocol_version(&self) -> &str { + match self.protocol_version.as_ref() { Some(v) => &v, None => "", } } - - fn get_ident_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.ident - } - - fn mut_ident_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.ident - } - - // optional string protocol_version = 3; - pub fn clear_protocol_version(&mut self) { self.protocol_version.clear(); } @@ -162,23 +151,12 @@ impl Frame { self.protocol_version.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_protocol_version(&self) -> &str { - match self.protocol_version.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional uint32 seq_nr = 4; - fn get_protocol_version_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.protocol_version - } - fn mut_protocol_version_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.protocol_version + pub fn get_seq_nr(&self) -> u32 { + self.seq_nr.unwrap_or(0) } - - // optional uint32 seq_nr = 4; - pub fn clear_seq_nr(&mut self) { self.seq_nr = ::std::option::Option::None; } @@ -192,20 +170,12 @@ impl Frame { self.seq_nr = ::std::option::Option::Some(v); } - pub fn get_seq_nr(&self) -> u32 { - self.seq_nr.unwrap_or(0) - } + // optional .MessageType typ = 5; - fn get_seq_nr_for_reflect(&self) -> &::std::option::Option { - &self.seq_nr - } - fn mut_seq_nr_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.seq_nr + pub fn get_typ(&self) -> MessageType { + self.typ.unwrap_or(MessageType::kMessageTypeHello) } - - // optional .MessageType typ = 5; - pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -219,20 +189,12 @@ impl Frame { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> MessageType { - self.typ.unwrap_or(MessageType::kMessageTypeHello) - } + // optional .DeviceState device_state = 7; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_device_state(&self) -> &DeviceState { + self.device_state.as_ref().unwrap_or_else(|| DeviceState::default_instance()) } - - // optional .DeviceState device_state = 7; - pub fn clear_device_state(&mut self) { self.device_state.clear(); } @@ -260,20 +222,12 @@ impl Frame { self.device_state.take().unwrap_or_else(|| DeviceState::new()) } - pub fn get_device_state(&self) -> &DeviceState { - self.device_state.as_ref().unwrap_or_else(|| DeviceState::default_instance()) - } + // optional .Goodbye goodbye = 11; - fn get_device_state_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.device_state - } - fn mut_device_state_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.device_state + pub fn get_goodbye(&self) -> &Goodbye { + self.goodbye.as_ref().unwrap_or_else(|| Goodbye::default_instance()) } - - // optional .Goodbye goodbye = 11; - pub fn clear_goodbye(&mut self) { self.goodbye.clear(); } @@ -301,20 +255,12 @@ impl Frame { self.goodbye.take().unwrap_or_else(|| Goodbye::new()) } - pub fn get_goodbye(&self) -> &Goodbye { - self.goodbye.as_ref().unwrap_or_else(|| Goodbye::default_instance()) - } + // optional .State state = 12; - fn get_goodbye_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.goodbye - } - fn mut_goodbye_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.goodbye + pub fn get_state(&self) -> &State { + self.state.as_ref().unwrap_or_else(|| State::default_instance()) } - - // optional .State state = 12; - pub fn clear_state(&mut self) { self.state.clear(); } @@ -342,20 +288,12 @@ impl Frame { self.state.take().unwrap_or_else(|| State::new()) } - pub fn get_state(&self) -> &State { - self.state.as_ref().unwrap_or_else(|| State::default_instance()) - } + // optional uint32 position = 13; - fn get_state_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.state - } - fn mut_state_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.state + pub fn get_position(&self) -> u32 { + self.position.unwrap_or(0) } - - // optional uint32 position = 13; - pub fn clear_position(&mut self) { self.position = ::std::option::Option::None; } @@ -369,20 +307,12 @@ impl Frame { self.position = ::std::option::Option::Some(v); } - pub fn get_position(&self) -> u32 { - self.position.unwrap_or(0) - } + // optional uint32 volume = 14; - fn get_position_for_reflect(&self) -> &::std::option::Option { - &self.position - } - fn mut_position_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.position + pub fn get_volume(&self) -> u32 { + self.volume.unwrap_or(0) } - - // optional uint32 volume = 14; - pub fn clear_volume(&mut self) { self.volume = ::std::option::Option::None; } @@ -396,20 +326,12 @@ impl Frame { self.volume = ::std::option::Option::Some(v); } - pub fn get_volume(&self) -> u32 { - self.volume.unwrap_or(0) - } + // optional int64 state_update_id = 17; - fn get_volume_for_reflect(&self) -> &::std::option::Option { - &self.volume - } - fn mut_volume_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.volume + pub fn get_state_update_id(&self) -> i64 { + self.state_update_id.unwrap_or(0) } - - // optional int64 state_update_id = 17; - pub fn clear_state_update_id(&mut self) { self.state_update_id = ::std::option::Option::None; } @@ -423,20 +345,12 @@ impl Frame { self.state_update_id = ::std::option::Option::Some(v); } - pub fn get_state_update_id(&self) -> i64 { - self.state_update_id.unwrap_or(0) - } + // repeated string recipient = 18; - fn get_state_update_id_for_reflect(&self) -> &::std::option::Option { - &self.state_update_id - } - fn mut_state_update_id_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.state_update_id + pub fn get_recipient(&self) -> &[::std::string::String] { + &self.recipient } - - // repeated string recipient = 18; - pub fn clear_recipient(&mut self) { self.recipient.clear(); } @@ -456,20 +370,15 @@ impl Frame { ::std::mem::replace(&mut self.recipient, ::protobuf::RepeatedField::new()) } - pub fn get_recipient(&self) -> &[::std::string::String] { - &self.recipient - } + // optional bytes context_player_state = 19; - fn get_recipient_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.recipient - } - fn mut_recipient_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.recipient + pub fn get_context_player_state(&self) -> &[u8] { + match self.context_player_state.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes context_player_state = 19; - pub fn clear_context_player_state(&mut self) { self.context_player_state.clear(); } @@ -497,23 +406,15 @@ impl Frame { self.context_player_state.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_context_player_state(&self) -> &[u8] { - match self.context_player_state.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string new_name = 20; - fn get_context_player_state_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.context_player_state - } - fn mut_context_player_state_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.context_player_state + pub fn get_new_name(&self) -> &str { + match self.new_name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string new_name = 20; - pub fn clear_new_name(&mut self) { self.new_name.clear(); } @@ -541,23 +442,12 @@ impl Frame { self.new_name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_new_name(&self) -> &str { - match self.new_name.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional .Metadata metadata = 25; - fn get_new_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.new_name - } - fn mut_new_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.new_name + pub fn get_metadata(&self) -> &Metadata { + self.metadata.as_ref().unwrap_or_else(|| Metadata::default_instance()) } - - // optional .Metadata metadata = 25; - pub fn clear_metadata(&mut self) { self.metadata.clear(); } @@ -584,18 +474,6 @@ impl Frame { pub fn take_metadata(&mut self) -> Metadata { self.metadata.take().unwrap_or_else(|| Metadata::new()) } - - pub fn get_metadata(&self) -> &Metadata { - self.metadata.as_ref().unwrap_or_else(|| Metadata::default_instance()) - } - - fn get_metadata_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.metadata - } - - fn mut_metadata_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.metadata - } } impl ::protobuf::Message for Frame { @@ -648,11 +526,7 @@ impl ::protobuf::Message for Frame { self.seq_nr = ::std::option::Option::Some(tmp); }, 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 5, &mut self.unknown_fields)? }, 7 => { ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.device_state)?; @@ -832,27 +706,25 @@ impl ::protobuf::Message for Frame { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Frame { fn new() -> Frame { Frame::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -862,78 +734,78 @@ impl ::protobuf::MessageStatic for Frame { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "version", - Frame::get_version_for_reflect, - Frame::mut_version_for_reflect, + |m: &Frame| { &m.version }, + |m: &mut Frame| { &mut m.version }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "ident", - Frame::get_ident_for_reflect, - Frame::mut_ident_for_reflect, + |m: &Frame| { &m.ident }, + |m: &mut Frame| { &mut m.ident }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "protocol_version", - Frame::get_protocol_version_for_reflect, - Frame::mut_protocol_version_for_reflect, + |m: &Frame| { &m.protocol_version }, + |m: &mut Frame| { &mut m.protocol_version }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "seq_nr", - Frame::get_seq_nr_for_reflect, - Frame::mut_seq_nr_for_reflect, + |m: &Frame| { &m.seq_nr }, + |m: &mut Frame| { &mut m.seq_nr }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Frame::get_typ_for_reflect, - Frame::mut_typ_for_reflect, + |m: &Frame| { &m.typ }, + |m: &mut Frame| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "device_state", - Frame::get_device_state_for_reflect, - Frame::mut_device_state_for_reflect, + |m: &Frame| { &m.device_state }, + |m: &mut Frame| { &mut m.device_state }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "goodbye", - Frame::get_goodbye_for_reflect, - Frame::mut_goodbye_for_reflect, + |m: &Frame| { &m.goodbye }, + |m: &mut Frame| { &mut m.goodbye }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "state", - Frame::get_state_for_reflect, - Frame::mut_state_for_reflect, + |m: &Frame| { &m.state }, + |m: &mut Frame| { &mut m.state }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "position", - Frame::get_position_for_reflect, - Frame::mut_position_for_reflect, + |m: &Frame| { &m.position }, + |m: &mut Frame| { &mut m.position }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "volume", - Frame::get_volume_for_reflect, - Frame::mut_volume_for_reflect, + |m: &Frame| { &m.volume }, + |m: &mut Frame| { &mut m.volume }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "state_update_id", - Frame::get_state_update_id_for_reflect, - Frame::mut_state_update_id_for_reflect, + |m: &Frame| { &m.state_update_id }, + |m: &mut Frame| { &mut m.state_update_id }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "recipient", - Frame::get_recipient_for_reflect, - Frame::mut_recipient_for_reflect, + |m: &Frame| { &m.recipient }, + |m: &mut Frame| { &mut m.recipient }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "context_player_state", - Frame::get_context_player_state_for_reflect, - Frame::mut_context_player_state_for_reflect, + |m: &Frame| { &m.context_player_state }, + |m: &mut Frame| { &mut m.context_player_state }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "new_name", - Frame::get_new_name_for_reflect, - Frame::mut_new_name_for_reflect, + |m: &Frame| { &m.new_name }, + |m: &mut Frame| { &mut m.new_name }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "metadata", - Frame::get_metadata_for_reflect, - Frame::mut_metadata_for_reflect, + |m: &Frame| { &m.metadata }, + |m: &mut Frame| { &mut m.metadata }, )); ::protobuf::reflect::MessageDescriptor::new::( "Frame", @@ -943,25 +815,35 @@ impl ::protobuf::MessageStatic for Frame { }) } } + + fn default_instance() -> &'static Frame { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Frame, + }; + unsafe { + instance.get(Frame::new) + } + } } impl ::protobuf::Clear for Frame { fn clear(&mut self) { - self.clear_version(); - self.clear_ident(); - self.clear_protocol_version(); - self.clear_seq_nr(); - self.clear_typ(); - self.clear_device_state(); - self.clear_goodbye(); - self.clear_state(); - self.clear_position(); - self.clear_volume(); - self.clear_state_update_id(); - self.clear_recipient(); - self.clear_context_player_state(); - self.clear_new_name(); - self.clear_metadata(); + self.version = ::std::option::Option::None; + self.ident.clear(); + self.protocol_version.clear(); + self.seq_nr = ::std::option::Option::None; + self.typ = ::std::option::Option::None; + self.device_state.clear(); + self.goodbye.clear(); + self.state.clear(); + self.position = ::std::option::Option::None; + self.volume = ::std::option::Option::None; + self.state_update_id = ::std::option::Option::None; + self.recipient.clear(); + self.context_player_state.clear(); + self.new_name.clear(); + self.metadata.clear(); self.unknown_fields.clear(); } } @@ -993,30 +875,30 @@ pub struct DeviceState { context_player_error: ::protobuf::SingularField<::std::string::String>, metadata: ::protobuf::RepeatedField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for DeviceState {} +impl<'a> ::std::default::Default for &'a DeviceState { + fn default() -> &'a DeviceState { + ::default_instance() + } +} impl DeviceState { pub fn new() -> DeviceState { ::std::default::Default::default() } - pub fn default_instance() -> &'static DeviceState { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const DeviceState, - }; - unsafe { - instance.get(DeviceState::new) - } - } - // optional string sw_version = 1; + + pub fn get_sw_version(&self) -> &str { + match self.sw_version.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_sw_version(&mut self) { self.sw_version.clear(); } @@ -1044,23 +926,12 @@ impl DeviceState { self.sw_version.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_sw_version(&self) -> &str { - match self.sw_version.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bool is_active = 10; - fn get_sw_version_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.sw_version - } - fn mut_sw_version_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.sw_version + pub fn get_is_active(&self) -> bool { + self.is_active.unwrap_or(false) } - - // optional bool is_active = 10; - pub fn clear_is_active(&mut self) { self.is_active = ::std::option::Option::None; } @@ -1074,20 +945,12 @@ impl DeviceState { self.is_active = ::std::option::Option::Some(v); } - pub fn get_is_active(&self) -> bool { - self.is_active.unwrap_or(false) - } + // optional bool can_play = 11; - fn get_is_active_for_reflect(&self) -> &::std::option::Option { - &self.is_active - } - fn mut_is_active_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.is_active + pub fn get_can_play(&self) -> bool { + self.can_play.unwrap_or(false) } - - // optional bool can_play = 11; - pub fn clear_can_play(&mut self) { self.can_play = ::std::option::Option::None; } @@ -1101,20 +964,12 @@ impl DeviceState { self.can_play = ::std::option::Option::Some(v); } - pub fn get_can_play(&self) -> bool { - self.can_play.unwrap_or(false) - } + // optional uint32 volume = 12; - fn get_can_play_for_reflect(&self) -> &::std::option::Option { - &self.can_play - } - fn mut_can_play_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.can_play + pub fn get_volume(&self) -> u32 { + self.volume.unwrap_or(0) } - - // optional uint32 volume = 12; - pub fn clear_volume(&mut self) { self.volume = ::std::option::Option::None; } @@ -1128,20 +983,15 @@ impl DeviceState { self.volume = ::std::option::Option::Some(v); } - pub fn get_volume(&self) -> u32 { - self.volume.unwrap_or(0) - } + // optional string name = 13; - fn get_volume_for_reflect(&self) -> &::std::option::Option { - &self.volume - } - fn mut_volume_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.volume + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string name = 13; - pub fn clear_name(&mut self) { self.name.clear(); } @@ -1169,23 +1019,12 @@ impl DeviceState { self.name.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_name(&self) -> &str { - match self.name.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional uint32 error_code = 14; - fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.name - } - fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.name + pub fn get_error_code(&self) -> u32 { + self.error_code.unwrap_or(0) } - - // optional uint32 error_code = 14; - pub fn clear_error_code(&mut self) { self.error_code = ::std::option::Option::None; } @@ -1199,20 +1038,12 @@ impl DeviceState { self.error_code = ::std::option::Option::Some(v); } - pub fn get_error_code(&self) -> u32 { - self.error_code.unwrap_or(0) - } + // optional int64 became_active_at = 15; - fn get_error_code_for_reflect(&self) -> &::std::option::Option { - &self.error_code - } - fn mut_error_code_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.error_code + pub fn get_became_active_at(&self) -> i64 { + self.became_active_at.unwrap_or(0) } - - // optional int64 became_active_at = 15; - pub fn clear_became_active_at(&mut self) { self.became_active_at = ::std::option::Option::None; } @@ -1226,20 +1057,15 @@ impl DeviceState { self.became_active_at = ::std::option::Option::Some(v); } - pub fn get_became_active_at(&self) -> i64 { - self.became_active_at.unwrap_or(0) - } + // optional string error_message = 16; - fn get_became_active_at_for_reflect(&self) -> &::std::option::Option { - &self.became_active_at - } - fn mut_became_active_at_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.became_active_at + pub fn get_error_message(&self) -> &str { + match self.error_message.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string error_message = 16; - pub fn clear_error_message(&mut self) { self.error_message.clear(); } @@ -1267,23 +1093,12 @@ impl DeviceState { self.error_message.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_error_message(&self) -> &str { - match self.error_message.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Capability capabilities = 17; - fn get_error_message_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.error_message - } - fn mut_error_message_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.error_message + pub fn get_capabilities(&self) -> &[Capability] { + &self.capabilities } - - // repeated .Capability capabilities = 17; - pub fn clear_capabilities(&mut self) { self.capabilities.clear(); } @@ -1303,20 +1118,15 @@ impl DeviceState { ::std::mem::replace(&mut self.capabilities, ::protobuf::RepeatedField::new()) } - pub fn get_capabilities(&self) -> &[Capability] { - &self.capabilities - } + // optional string context_player_error = 20; - fn get_capabilities_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.capabilities - } - fn mut_capabilities_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.capabilities + pub fn get_context_player_error(&self) -> &str { + match self.context_player_error.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string context_player_error = 20; - pub fn clear_context_player_error(&mut self) { self.context_player_error.clear(); } @@ -1344,23 +1154,12 @@ impl DeviceState { self.context_player_error.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_context_player_error(&self) -> &str { - match self.context_player_error.as_ref() { - Some(v) => &v, - None => "", - } - } + // repeated .Metadata metadata = 25; - fn get_context_player_error_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.context_player_error - } - fn mut_context_player_error_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.context_player_error + pub fn get_metadata(&self) -> &[Metadata] { + &self.metadata } - - // repeated .Metadata metadata = 25; - pub fn clear_metadata(&mut self) { self.metadata.clear(); } @@ -1379,18 +1178,6 @@ impl DeviceState { pub fn take_metadata(&mut self) -> ::protobuf::RepeatedField { ::std::mem::replace(&mut self.metadata, ::protobuf::RepeatedField::new()) } - - pub fn get_metadata(&self) -> &[Metadata] { - &self.metadata - } - - fn get_metadata_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.metadata - } - - fn mut_metadata_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.metadata - } } impl ::protobuf::Message for DeviceState { @@ -1571,27 +1358,25 @@ impl ::protobuf::Message for DeviceState { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for DeviceState { fn new() -> DeviceState { DeviceState::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1601,58 +1386,58 @@ impl ::protobuf::MessageStatic for DeviceState { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "sw_version", - DeviceState::get_sw_version_for_reflect, - DeviceState::mut_sw_version_for_reflect, + |m: &DeviceState| { &m.sw_version }, + |m: &mut DeviceState| { &mut m.sw_version }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "is_active", - DeviceState::get_is_active_for_reflect, - DeviceState::mut_is_active_for_reflect, + |m: &DeviceState| { &m.is_active }, + |m: &mut DeviceState| { &mut m.is_active }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "can_play", - DeviceState::get_can_play_for_reflect, - DeviceState::mut_can_play_for_reflect, + |m: &DeviceState| { &m.can_play }, + |m: &mut DeviceState| { &mut m.can_play }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "volume", - DeviceState::get_volume_for_reflect, - DeviceState::mut_volume_for_reflect, + |m: &DeviceState| { &m.volume }, + |m: &mut DeviceState| { &mut m.volume }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - DeviceState::get_name_for_reflect, - DeviceState::mut_name_for_reflect, + |m: &DeviceState| { &m.name }, + |m: &mut DeviceState| { &mut m.name }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "error_code", - DeviceState::get_error_code_for_reflect, - DeviceState::mut_error_code_for_reflect, + |m: &DeviceState| { &m.error_code }, + |m: &mut DeviceState| { &mut m.error_code }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "became_active_at", - DeviceState::get_became_active_at_for_reflect, - DeviceState::mut_became_active_at_for_reflect, + |m: &DeviceState| { &m.became_active_at }, + |m: &mut DeviceState| { &mut m.became_active_at }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "error_message", - DeviceState::get_error_message_for_reflect, - DeviceState::mut_error_message_for_reflect, + |m: &DeviceState| { &m.error_message }, + |m: &mut DeviceState| { &mut m.error_message }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "capabilities", - DeviceState::get_capabilities_for_reflect, - DeviceState::mut_capabilities_for_reflect, + |m: &DeviceState| { &m.capabilities }, + |m: &mut DeviceState| { &mut m.capabilities }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context_player_error", - DeviceState::get_context_player_error_for_reflect, - DeviceState::mut_context_player_error_for_reflect, + |m: &DeviceState| { &m.context_player_error }, + |m: &mut DeviceState| { &mut m.context_player_error }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "metadata", - DeviceState::get_metadata_for_reflect, - DeviceState::mut_metadata_for_reflect, + |m: &DeviceState| { &m.metadata }, + |m: &mut DeviceState| { &mut m.metadata }, )); ::protobuf::reflect::MessageDescriptor::new::( "DeviceState", @@ -1662,21 +1447,31 @@ impl ::protobuf::MessageStatic for DeviceState { }) } } + + fn default_instance() -> &'static DeviceState { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const DeviceState, + }; + unsafe { + instance.get(DeviceState::new) + } + } } impl ::protobuf::Clear for DeviceState { fn clear(&mut self) { - self.clear_sw_version(); - self.clear_is_active(); - self.clear_can_play(); - self.clear_volume(); - self.clear_name(); - self.clear_error_code(); - self.clear_became_active_at(); - self.clear_error_message(); - self.clear_capabilities(); - self.clear_context_player_error(); - self.clear_metadata(); + self.sw_version.clear(); + self.is_active = ::std::option::Option::None; + self.can_play = ::std::option::Option::None; + self.volume = ::std::option::Option::None; + self.name.clear(); + self.error_code = ::std::option::Option::None; + self.became_active_at = ::std::option::Option::None; + self.error_message.clear(); + self.capabilities.clear(); + self.context_player_error.clear(); + self.metadata.clear(); self.unknown_fields.clear(); } } @@ -1700,30 +1495,27 @@ pub struct Capability { intValue: ::std::vec::Vec, stringValue: ::protobuf::RepeatedField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Capability {} +impl<'a> ::std::default::Default for &'a Capability { + fn default() -> &'a Capability { + ::default_instance() + } +} impl Capability { pub fn new() -> Capability { ::std::default::Default::default() } - pub fn default_instance() -> &'static Capability { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Capability, - }; - unsafe { - instance.get(Capability::new) - } - } - // optional .CapabilityType typ = 1; + + pub fn get_typ(&self) -> CapabilityType { + self.typ.unwrap_or(CapabilityType::kSupportedContexts) + } pub fn clear_typ(&mut self) { self.typ = ::std::option::Option::None; } @@ -1737,20 +1529,12 @@ impl Capability { self.typ = ::std::option::Option::Some(v); } - pub fn get_typ(&self) -> CapabilityType { - self.typ.unwrap_or(CapabilityType::kSupportedContexts) - } + // repeated int64 intValue = 2; - fn get_typ_for_reflect(&self) -> &::std::option::Option { - &self.typ - } - fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.typ + pub fn get_intValue(&self) -> &[i64] { + &self.intValue } - - // repeated int64 intValue = 2; - pub fn clear_intValue(&mut self) { self.intValue.clear(); } @@ -1770,20 +1554,12 @@ impl Capability { ::std::mem::replace(&mut self.intValue, ::std::vec::Vec::new()) } - pub fn get_intValue(&self) -> &[i64] { - &self.intValue - } + // repeated string stringValue = 3; - fn get_intValue_for_reflect(&self) -> &::std::vec::Vec { - &self.intValue - } - fn mut_intValue_for_reflect(&mut self) -> &mut ::std::vec::Vec { - &mut self.intValue + pub fn get_stringValue(&self) -> &[::std::string::String] { + &self.stringValue } - - // repeated string stringValue = 3; - pub fn clear_stringValue(&mut self) { self.stringValue.clear(); } @@ -1802,18 +1578,6 @@ impl Capability { pub fn take_stringValue(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { ::std::mem::replace(&mut self.stringValue, ::protobuf::RepeatedField::new()) } - - pub fn get_stringValue(&self) -> &[::std::string::String] { - &self.stringValue - } - - fn get_stringValue_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { - &self.stringValue - } - - fn mut_stringValue_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.stringValue - } } impl ::protobuf::Message for Capability { @@ -1826,11 +1590,7 @@ impl ::protobuf::Message for Capability { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.typ = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 1, &mut self.unknown_fields)? }, 2 => { ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.intValue)?; @@ -1890,27 +1650,25 @@ impl ::protobuf::Message for Capability { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Capability { fn new() -> Capability { Capability::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -1920,18 +1678,18 @@ impl ::protobuf::MessageStatic for Capability { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Capability::get_typ_for_reflect, - Capability::mut_typ_for_reflect, + |m: &Capability| { &m.typ }, + |m: &mut Capability| { &mut m.typ }, )); fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "intValue", - Capability::get_intValue_for_reflect, - Capability::mut_intValue_for_reflect, + |m: &Capability| { &m.intValue }, + |m: &mut Capability| { &mut m.intValue }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "stringValue", - Capability::get_stringValue_for_reflect, - Capability::mut_stringValue_for_reflect, + |m: &Capability| { &m.stringValue }, + |m: &mut Capability| { &mut m.stringValue }, )); ::protobuf::reflect::MessageDescriptor::new::( "Capability", @@ -1941,13 +1699,23 @@ impl ::protobuf::MessageStatic for Capability { }) } } + + fn default_instance() -> &'static Capability { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Capability, + }; + unsafe { + instance.get(Capability::new) + } + } } impl ::protobuf::Clear for Capability { fn clear(&mut self) { - self.clear_typ(); - self.clear_intValue(); - self.clear_stringValue(); + self.typ = ::std::option::Option::None; + self.intValue.clear(); + self.stringValue.clear(); self.unknown_fields.clear(); } } @@ -1969,30 +1737,30 @@ pub struct Goodbye { // message fields reason: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Goodbye {} +impl<'a> ::std::default::Default for &'a Goodbye { + fn default() -> &'a Goodbye { + ::default_instance() + } +} impl Goodbye { pub fn new() -> Goodbye { ::std::default::Default::default() } - pub fn default_instance() -> &'static Goodbye { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Goodbye, - }; - unsafe { - instance.get(Goodbye::new) - } - } - // optional string reason = 1; + + pub fn get_reason(&self) -> &str { + match self.reason.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_reason(&mut self) { self.reason.clear(); } @@ -2019,21 +1787,6 @@ impl Goodbye { pub fn take_reason(&mut self) -> ::std::string::String { self.reason.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_reason(&self) -> &str { - match self.reason.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_reason_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.reason - } - - fn mut_reason_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.reason - } } impl ::protobuf::Message for Goodbye { @@ -2088,27 +1841,25 @@ impl ::protobuf::Message for Goodbye { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Goodbye { fn new() -> Goodbye { Goodbye::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2118,8 +1869,8 @@ impl ::protobuf::MessageStatic for Goodbye { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "reason", - Goodbye::get_reason_for_reflect, - Goodbye::mut_reason_for_reflect, + |m: &Goodbye| { &m.reason }, + |m: &mut Goodbye| { &mut m.reason }, )); ::protobuf::reflect::MessageDescriptor::new::( "Goodbye", @@ -2129,11 +1880,21 @@ impl ::protobuf::MessageStatic for Goodbye { }) } } + + fn default_instance() -> &'static Goodbye { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Goodbye, + }; + unsafe { + instance.get(Goodbye::new) + } + } } impl ::protobuf::Clear for Goodbye { fn clear(&mut self) { - self.clear_reason(); + self.reason.clear(); self.unknown_fields.clear(); } } @@ -2169,30 +1930,30 @@ pub struct State { track: ::protobuf::RepeatedField, ad: ::protobuf::SingularPtrField, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for State {} +impl<'a> ::std::default::Default for &'a State { + fn default() -> &'a State { + ::default_instance() + } +} impl State { pub fn new() -> State { ::std::default::Default::default() } - pub fn default_instance() -> &'static State { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const State, - }; - unsafe { - instance.get(State::new) - } - } - // optional string context_uri = 2; + + pub fn get_context_uri(&self) -> &str { + match self.context_uri.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_context_uri(&mut self) { self.context_uri.clear(); } @@ -2220,23 +1981,12 @@ impl State { self.context_uri.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_context_uri(&self) -> &str { - match self.context_uri.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional uint32 index = 3; - fn get_context_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.context_uri - } - fn mut_context_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.context_uri + pub fn get_index(&self) -> u32 { + self.index.unwrap_or(0) } - - // optional uint32 index = 3; - pub fn clear_index(&mut self) { self.index = ::std::option::Option::None; } @@ -2250,20 +2000,12 @@ impl State { self.index = ::std::option::Option::Some(v); } - pub fn get_index(&self) -> u32 { - self.index.unwrap_or(0) - } + // optional uint32 position_ms = 4; - fn get_index_for_reflect(&self) -> &::std::option::Option { - &self.index - } - fn mut_index_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.index + pub fn get_position_ms(&self) -> u32 { + self.position_ms.unwrap_or(0) } - - // optional uint32 position_ms = 4; - pub fn clear_position_ms(&mut self) { self.position_ms = ::std::option::Option::None; } @@ -2277,20 +2019,12 @@ impl State { self.position_ms = ::std::option::Option::Some(v); } - pub fn get_position_ms(&self) -> u32 { - self.position_ms.unwrap_or(0) - } + // optional .PlayStatus status = 5; - fn get_position_ms_for_reflect(&self) -> &::std::option::Option { - &self.position_ms - } - fn mut_position_ms_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.position_ms + pub fn get_status(&self) -> PlayStatus { + self.status.unwrap_or(PlayStatus::kPlayStatusStop) } - - // optional .PlayStatus status = 5; - pub fn clear_status(&mut self) { self.status = ::std::option::Option::None; } @@ -2304,20 +2038,12 @@ impl State { self.status = ::std::option::Option::Some(v); } - pub fn get_status(&self) -> PlayStatus { - self.status.unwrap_or(PlayStatus::kPlayStatusStop) - } + // optional uint64 position_measured_at = 7; - fn get_status_for_reflect(&self) -> &::std::option::Option { - &self.status - } - fn mut_status_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.status + pub fn get_position_measured_at(&self) -> u64 { + self.position_measured_at.unwrap_or(0) } - - // optional uint64 position_measured_at = 7; - pub fn clear_position_measured_at(&mut self) { self.position_measured_at = ::std::option::Option::None; } @@ -2331,20 +2057,15 @@ impl State { self.position_measured_at = ::std::option::Option::Some(v); } - pub fn get_position_measured_at(&self) -> u64 { - self.position_measured_at.unwrap_or(0) - } + // optional string context_description = 8; - fn get_position_measured_at_for_reflect(&self) -> &::std::option::Option { - &self.position_measured_at - } - fn mut_position_measured_at_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.position_measured_at + pub fn get_context_description(&self) -> &str { + match self.context_description.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string context_description = 8; - pub fn clear_context_description(&mut self) { self.context_description.clear(); } @@ -2372,23 +2093,12 @@ impl State { self.context_description.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_context_description(&self) -> &str { - match self.context_description.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bool shuffle = 13; - fn get_context_description_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.context_description - } - fn mut_context_description_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.context_description + pub fn get_shuffle(&self) -> bool { + self.shuffle.unwrap_or(false) } - - // optional bool shuffle = 13; - pub fn clear_shuffle(&mut self) { self.shuffle = ::std::option::Option::None; } @@ -2402,20 +2112,12 @@ impl State { self.shuffle = ::std::option::Option::Some(v); } - pub fn get_shuffle(&self) -> bool { - self.shuffle.unwrap_or(false) - } + // optional bool repeat = 14; - fn get_shuffle_for_reflect(&self) -> &::std::option::Option { - &self.shuffle - } - fn mut_shuffle_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.shuffle + pub fn get_repeat(&self) -> bool { + self.repeat.unwrap_or(false) } - - // optional bool repeat = 14; - pub fn clear_repeat(&mut self) { self.repeat = ::std::option::Option::None; } @@ -2429,20 +2131,15 @@ impl State { self.repeat = ::std::option::Option::Some(v); } - pub fn get_repeat(&self) -> bool { - self.repeat.unwrap_or(false) - } + // optional string last_command_ident = 20; - fn get_repeat_for_reflect(&self) -> &::std::option::Option { - &self.repeat - } - fn mut_repeat_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.repeat + pub fn get_last_command_ident(&self) -> &str { + match self.last_command_ident.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string last_command_ident = 20; - pub fn clear_last_command_ident(&mut self) { self.last_command_ident.clear(); } @@ -2470,23 +2167,12 @@ impl State { self.last_command_ident.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_last_command_ident(&self) -> &str { - match self.last_command_ident.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional uint32 last_command_msgid = 21; - fn get_last_command_ident_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.last_command_ident - } - fn mut_last_command_ident_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.last_command_ident + pub fn get_last_command_msgid(&self) -> u32 { + self.last_command_msgid.unwrap_or(0) } - - // optional uint32 last_command_msgid = 21; - pub fn clear_last_command_msgid(&mut self) { self.last_command_msgid = ::std::option::Option::None; } @@ -2500,20 +2186,12 @@ impl State { self.last_command_msgid = ::std::option::Option::Some(v); } - pub fn get_last_command_msgid(&self) -> u32 { - self.last_command_msgid.unwrap_or(0) - } + // optional bool playing_from_fallback = 24; - fn get_last_command_msgid_for_reflect(&self) -> &::std::option::Option { - &self.last_command_msgid - } - fn mut_last_command_msgid_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.last_command_msgid + pub fn get_playing_from_fallback(&self) -> bool { + self.playing_from_fallback.unwrap_or(false) } - - // optional bool playing_from_fallback = 24; - pub fn clear_playing_from_fallback(&mut self) { self.playing_from_fallback = ::std::option::Option::None; } @@ -2527,20 +2205,12 @@ impl State { self.playing_from_fallback = ::std::option::Option::Some(v); } - pub fn get_playing_from_fallback(&self) -> bool { - self.playing_from_fallback.unwrap_or(false) - } + // optional uint32 row = 25; - fn get_playing_from_fallback_for_reflect(&self) -> &::std::option::Option { - &self.playing_from_fallback - } - fn mut_playing_from_fallback_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.playing_from_fallback + pub fn get_row(&self) -> u32 { + self.row.unwrap_or(0) } - - // optional uint32 row = 25; - pub fn clear_row(&mut self) { self.row = ::std::option::Option::None; } @@ -2554,20 +2224,12 @@ impl State { self.row = ::std::option::Option::Some(v); } - pub fn get_row(&self) -> u32 { - self.row.unwrap_or(0) - } + // optional uint32 playing_track_index = 26; - fn get_row_for_reflect(&self) -> &::std::option::Option { - &self.row - } - fn mut_row_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.row + pub fn get_playing_track_index(&self) -> u32 { + self.playing_track_index.unwrap_or(0) } - - // optional uint32 playing_track_index = 26; - pub fn clear_playing_track_index(&mut self) { self.playing_track_index = ::std::option::Option::None; } @@ -2581,20 +2243,12 @@ impl State { self.playing_track_index = ::std::option::Option::Some(v); } - pub fn get_playing_track_index(&self) -> u32 { - self.playing_track_index.unwrap_or(0) - } + // repeated .TrackRef track = 27; - fn get_playing_track_index_for_reflect(&self) -> &::std::option::Option { - &self.playing_track_index - } - fn mut_playing_track_index_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.playing_track_index + pub fn get_track(&self) -> &[TrackRef] { + &self.track } - - // repeated .TrackRef track = 27; - pub fn clear_track(&mut self) { self.track.clear(); } @@ -2614,20 +2268,12 @@ impl State { ::std::mem::replace(&mut self.track, ::protobuf::RepeatedField::new()) } - pub fn get_track(&self) -> &[TrackRef] { - &self.track - } + // optional .Ad ad = 28; - fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { - &self.track - } - fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { - &mut self.track + pub fn get_ad(&self) -> &Ad { + self.ad.as_ref().unwrap_or_else(|| Ad::default_instance()) } - - // optional .Ad ad = 28; - pub fn clear_ad(&mut self) { self.ad.clear(); } @@ -2654,18 +2300,6 @@ impl State { pub fn take_ad(&mut self) -> Ad { self.ad.take().unwrap_or_else(|| Ad::new()) } - - pub fn get_ad(&self) -> &Ad { - self.ad.as_ref().unwrap_or_else(|| Ad::default_instance()) - } - - fn get_ad_for_reflect(&self) -> &::protobuf::SingularPtrField { - &self.ad - } - - fn mut_ad_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { - &mut self.ad - } } impl ::protobuf::Message for State { @@ -2705,11 +2339,7 @@ impl ::protobuf::Message for State { self.position_ms = ::std::option::Option::Some(tmp); }, 5 => { - if wire_type != ::protobuf::wire_format::WireTypeVarint { - return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); - } - let tmp = is.read_enum()?; - self.status = ::std::option::Option::Some(tmp); + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.status, 5, &mut self.unknown_fields)? }, 7 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -2902,27 +2532,25 @@ impl ::protobuf::Message for State { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for State { fn new() -> State { State::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -2932,78 +2560,78 @@ impl ::protobuf::MessageStatic for State { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context_uri", - State::get_context_uri_for_reflect, - State::mut_context_uri_for_reflect, + |m: &State| { &m.context_uri }, + |m: &mut State| { &mut m.context_uri }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "index", - State::get_index_for_reflect, - State::mut_index_for_reflect, + |m: &State| { &m.index }, + |m: &mut State| { &mut m.index }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "position_ms", - State::get_position_ms_for_reflect, - State::mut_position_ms_for_reflect, + |m: &State| { &m.position_ms }, + |m: &mut State| { &mut m.position_ms }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "status", - State::get_status_for_reflect, - State::mut_status_for_reflect, + |m: &State| { &m.status }, + |m: &mut State| { &mut m.status }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( "position_measured_at", - State::get_position_measured_at_for_reflect, - State::mut_position_measured_at_for_reflect, + |m: &State| { &m.position_measured_at }, + |m: &mut State| { &mut m.position_measured_at }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context_description", - State::get_context_description_for_reflect, - State::mut_context_description_for_reflect, + |m: &State| { &m.context_description }, + |m: &mut State| { &mut m.context_description }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "shuffle", - State::get_shuffle_for_reflect, - State::mut_shuffle_for_reflect, + |m: &State| { &m.shuffle }, + |m: &mut State| { &mut m.shuffle }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "repeat", - State::get_repeat_for_reflect, - State::mut_repeat_for_reflect, + |m: &State| { &m.repeat }, + |m: &mut State| { &mut m.repeat }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "last_command_ident", - State::get_last_command_ident_for_reflect, - State::mut_last_command_ident_for_reflect, + |m: &State| { &m.last_command_ident }, + |m: &mut State| { &mut m.last_command_ident }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "last_command_msgid", - State::get_last_command_msgid_for_reflect, - State::mut_last_command_msgid_for_reflect, + |m: &State| { &m.last_command_msgid }, + |m: &mut State| { &mut m.last_command_msgid }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "playing_from_fallback", - State::get_playing_from_fallback_for_reflect, - State::mut_playing_from_fallback_for_reflect, + |m: &State| { &m.playing_from_fallback }, + |m: &mut State| { &mut m.playing_from_fallback }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "row", - State::get_row_for_reflect, - State::mut_row_for_reflect, + |m: &State| { &m.row }, + |m: &mut State| { &mut m.row }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "playing_track_index", - State::get_playing_track_index_for_reflect, - State::mut_playing_track_index_for_reflect, + |m: &State| { &m.playing_track_index }, + |m: &mut State| { &mut m.playing_track_index }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - State::get_track_for_reflect, - State::mut_track_for_reflect, + |m: &State| { &m.track }, + |m: &mut State| { &mut m.track }, )); fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "ad", - State::get_ad_for_reflect, - State::mut_ad_for_reflect, + |m: &State| { &m.ad }, + |m: &mut State| { &mut m.ad }, )); ::protobuf::reflect::MessageDescriptor::new::( "State", @@ -3013,25 +2641,35 @@ impl ::protobuf::MessageStatic for State { }) } } + + fn default_instance() -> &'static State { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const State, + }; + unsafe { + instance.get(State::new) + } + } } impl ::protobuf::Clear for State { fn clear(&mut self) { - self.clear_context_uri(); - self.clear_index(); - self.clear_position_ms(); - self.clear_status(); - self.clear_position_measured_at(); - self.clear_context_description(); - self.clear_shuffle(); - self.clear_repeat(); - self.clear_last_command_ident(); - self.clear_last_command_msgid(); - self.clear_playing_from_fallback(); - self.clear_row(); - self.clear_playing_track_index(); - self.clear_track(); - self.clear_ad(); + self.context_uri.clear(); + self.index = ::std::option::Option::None; + self.position_ms = ::std::option::Option::None; + self.status = ::std::option::Option::None; + self.position_measured_at = ::std::option::Option::None; + self.context_description.clear(); + self.shuffle = ::std::option::Option::None; + self.repeat = ::std::option::Option::None; + self.last_command_ident.clear(); + self.last_command_msgid = ::std::option::Option::None; + self.playing_from_fallback = ::std::option::Option::None; + self.row = ::std::option::Option::None; + self.playing_track_index = ::std::option::Option::None; + self.track.clear(); + self.ad.clear(); self.unknown_fields.clear(); } } @@ -3056,30 +2694,30 @@ pub struct TrackRef { queued: ::std::option::Option, context: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for TrackRef {} +impl<'a> ::std::default::Default for &'a TrackRef { + fn default() -> &'a TrackRef { + ::default_instance() + } +} impl TrackRef { pub fn new() -> TrackRef { ::std::default::Default::default() } - pub fn default_instance() -> &'static TrackRef { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const TrackRef, - }; - unsafe { - instance.get(TrackRef::new) - } - } - // optional bytes gid = 1; + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } pub fn clear_gid(&mut self) { self.gid.clear(); } @@ -3107,23 +2745,15 @@ impl TrackRef { self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_gid(&self) -> &[u8] { - match self.gid.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional string uri = 2; - fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gid - } - fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gid + pub fn get_uri(&self) -> &str { + match self.uri.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string uri = 2; - pub fn clear_uri(&mut self) { self.uri.clear(); } @@ -3151,23 +2781,12 @@ impl TrackRef { self.uri.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_uri(&self) -> &str { - match self.uri.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bool queued = 3; - fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.uri - } - fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.uri + pub fn get_queued(&self) -> bool { + self.queued.unwrap_or(false) } - - // optional bool queued = 3; - pub fn clear_queued(&mut self) { self.queued = ::std::option::Option::None; } @@ -3177,24 +2796,19 @@ impl TrackRef { } // Param is passed by value, moved - pub fn set_queued(&mut self, v: bool) { - self.queued = ::std::option::Option::Some(v); - } - - pub fn get_queued(&self) -> bool { - self.queued.unwrap_or(false) - } - - fn get_queued_for_reflect(&self) -> &::std::option::Option { - &self.queued - } - - fn mut_queued_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.queued + pub fn set_queued(&mut self, v: bool) { + self.queued = ::std::option::Option::Some(v); } // optional string context = 4; + + pub fn get_context(&self) -> &str { + match self.context.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_context(&mut self) { self.context.clear(); } @@ -3221,21 +2835,6 @@ impl TrackRef { pub fn take_context(&mut self) -> ::std::string::String { self.context.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_context(&self) -> &str { - match self.context.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_context_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.context - } - - fn mut_context_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.context - } } impl ::protobuf::Message for TrackRef { @@ -3321,27 +2920,25 @@ impl ::protobuf::Message for TrackRef { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for TrackRef { fn new() -> TrackRef { TrackRef::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3351,23 +2948,23 @@ impl ::protobuf::MessageStatic for TrackRef { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - TrackRef::get_gid_for_reflect, - TrackRef::mut_gid_for_reflect, + |m: &TrackRef| { &m.gid }, + |m: &mut TrackRef| { &mut m.gid }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - TrackRef::get_uri_for_reflect, - TrackRef::mut_uri_for_reflect, + |m: &TrackRef| { &m.uri }, + |m: &mut TrackRef| { &mut m.uri }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "queued", - TrackRef::get_queued_for_reflect, - TrackRef::mut_queued_for_reflect, + |m: &TrackRef| { &m.queued }, + |m: &mut TrackRef| { &mut m.queued }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context", - TrackRef::get_context_for_reflect, - TrackRef::mut_context_for_reflect, + |m: &TrackRef| { &m.context }, + |m: &mut TrackRef| { &mut m.context }, )); ::protobuf::reflect::MessageDescriptor::new::( "TrackRef", @@ -3377,14 +2974,24 @@ impl ::protobuf::MessageStatic for TrackRef { }) } } + + fn default_instance() -> &'static TrackRef { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const TrackRef, + }; + unsafe { + instance.get(TrackRef::new) + } + } } impl ::protobuf::Clear for TrackRef { fn clear(&mut self) { - self.clear_gid(); - self.clear_uri(); - self.clear_queued(); - self.clear_context(); + self.gid.clear(); + self.uri.clear(); + self.queued = ::std::option::Option::None; + self.context.clear(); self.unknown_fields.clear(); } } @@ -3414,30 +3021,27 @@ pub struct Ad { advertiser: ::protobuf::SingularField<::std::string::String>, gid: ::protobuf::SingularField<::std::vec::Vec>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Ad {} +impl<'a> ::std::default::Default for &'a Ad { + fn default() -> &'a Ad { + ::default_instance() + } +} impl Ad { pub fn new() -> Ad { ::std::default::Default::default() } - pub fn default_instance() -> &'static Ad { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Ad, - }; - unsafe { - instance.get(Ad::new) - } - } - // optional int32 next = 1; + + pub fn get_next(&self) -> i32 { + self.next.unwrap_or(0) + } pub fn clear_next(&mut self) { self.next = ::std::option::Option::None; } @@ -3451,20 +3055,15 @@ impl Ad { self.next = ::std::option::Option::Some(v); } - pub fn get_next(&self) -> i32 { - self.next.unwrap_or(0) - } + // optional bytes ogg_fid = 2; - fn get_next_for_reflect(&self) -> &::std::option::Option { - &self.next - } - fn mut_next_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.next + pub fn get_ogg_fid(&self) -> &[u8] { + match self.ogg_fid.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes ogg_fid = 2; - pub fn clear_ogg_fid(&mut self) { self.ogg_fid.clear(); } @@ -3492,23 +3091,15 @@ impl Ad { self.ogg_fid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_ogg_fid(&self) -> &[u8] { - match self.ogg_fid.as_ref() { + // optional bytes image_fid = 3; + + + pub fn get_image_fid(&self) -> &[u8] { + match self.image_fid.as_ref() { Some(v) => &v, None => &[], } } - - fn get_ogg_fid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.ogg_fid - } - - fn mut_ogg_fid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.ogg_fid - } - - // optional bytes image_fid = 3; - pub fn clear_image_fid(&mut self) { self.image_fid.clear(); } @@ -3536,23 +3127,12 @@ impl Ad { self.image_fid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - pub fn get_image_fid(&self) -> &[u8] { - match self.image_fid.as_ref() { - Some(v) => &v, - None => &[], - } - } + // optional int32 duration = 4; - fn get_image_fid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.image_fid - } - fn mut_image_fid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.image_fid + pub fn get_duration(&self) -> i32 { + self.duration.unwrap_or(0) } - - // optional int32 duration = 4; - pub fn clear_duration(&mut self) { self.duration = ::std::option::Option::None; } @@ -3566,20 +3146,15 @@ impl Ad { self.duration = ::std::option::Option::Some(v); } - pub fn get_duration(&self) -> i32 { - self.duration.unwrap_or(0) - } + // optional string click_url = 5; - fn get_duration_for_reflect(&self) -> &::std::option::Option { - &self.duration - } - fn mut_duration_for_reflect(&mut self) -> &mut ::std::option::Option { - &mut self.duration + pub fn get_click_url(&self) -> &str { + match self.click_url.as_ref() { + Some(v) => &v, + None => "", + } } - - // optional string click_url = 5; - pub fn clear_click_url(&mut self) { self.click_url.clear(); } @@ -3607,23 +3182,15 @@ impl Ad { self.click_url.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_click_url(&self) -> &str { - match self.click_url.as_ref() { + // optional string impression_url = 6; + + + pub fn get_impression_url(&self) -> &str { + match self.impression_url.as_ref() { Some(v) => &v, None => "", } } - - fn get_click_url_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.click_url - } - - fn mut_click_url_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.click_url - } - - // optional string impression_url = 6; - pub fn clear_impression_url(&mut self) { self.impression_url.clear(); } @@ -3651,23 +3218,15 @@ impl Ad { self.impression_url.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_impression_url(&self) -> &str { - match self.impression_url.as_ref() { + // optional string product = 7; + + + pub fn get_product(&self) -> &str { + match self.product.as_ref() { Some(v) => &v, None => "", } } - - fn get_impression_url_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.impression_url - } - - fn mut_impression_url_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.impression_url - } - - // optional string product = 7; - pub fn clear_product(&mut self) { self.product.clear(); } @@ -3695,23 +3254,15 @@ impl Ad { self.product.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_product(&self) -> &str { - match self.product.as_ref() { + // optional string advertiser = 8; + + + pub fn get_advertiser(&self) -> &str { + match self.advertiser.as_ref() { Some(v) => &v, None => "", } } - - fn get_product_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.product - } - - fn mut_product_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.product - } - - // optional string advertiser = 8; - pub fn clear_advertiser(&mut self) { self.advertiser.clear(); } @@ -3739,23 +3290,15 @@ impl Ad { self.advertiser.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_advertiser(&self) -> &str { - match self.advertiser.as_ref() { - Some(v) => &v, - None => "", - } - } + // optional bytes gid = 9; - fn get_advertiser_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.advertiser - } - fn mut_advertiser_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.advertiser + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } } - - // optional bytes gid = 9; - pub fn clear_gid(&mut self) { self.gid.clear(); } @@ -3782,21 +3325,6 @@ impl Ad { pub fn take_gid(&mut self) -> ::std::vec::Vec { self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) } - - pub fn get_gid(&self) -> &[u8] { - match self.gid.as_ref() { - Some(v) => &v, - None => &[], - } - } - - fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { - &self.gid - } - - fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { - &mut self.gid - } } impl ::protobuf::Message for Ad { @@ -3931,27 +3459,25 @@ impl ::protobuf::Message for Ad { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Ad { fn new() -> Ad { Ad::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -3961,48 +3487,48 @@ impl ::protobuf::MessageStatic for Ad { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "next", - Ad::get_next_for_reflect, - Ad::mut_next_for_reflect, + |m: &Ad| { &m.next }, + |m: &mut Ad| { &mut m.next }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "ogg_fid", - Ad::get_ogg_fid_for_reflect, - Ad::mut_ogg_fid_for_reflect, + |m: &Ad| { &m.ogg_fid }, + |m: &mut Ad| { &mut m.ogg_fid }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "image_fid", - Ad::get_image_fid_for_reflect, - Ad::mut_image_fid_for_reflect, + |m: &Ad| { &m.image_fid }, + |m: &mut Ad| { &mut m.image_fid }, )); fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "duration", - Ad::get_duration_for_reflect, - Ad::mut_duration_for_reflect, + |m: &Ad| { &m.duration }, + |m: &mut Ad| { &mut m.duration }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "click_url", - Ad::get_click_url_for_reflect, - Ad::mut_click_url_for_reflect, + |m: &Ad| { &m.click_url }, + |m: &mut Ad| { &mut m.click_url }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "impression_url", - Ad::get_impression_url_for_reflect, - Ad::mut_impression_url_for_reflect, + |m: &Ad| { &m.impression_url }, + |m: &mut Ad| { &mut m.impression_url }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "product", - Ad::get_product_for_reflect, - Ad::mut_product_for_reflect, + |m: &Ad| { &m.product }, + |m: &mut Ad| { &mut m.product }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "advertiser", - Ad::get_advertiser_for_reflect, - Ad::mut_advertiser_for_reflect, + |m: &Ad| { &m.advertiser }, + |m: &mut Ad| { &mut m.advertiser }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Ad::get_gid_for_reflect, - Ad::mut_gid_for_reflect, + |m: &Ad| { &m.gid }, + |m: &mut Ad| { &mut m.gid }, )); ::protobuf::reflect::MessageDescriptor::new::( "Ad", @@ -4012,19 +3538,29 @@ impl ::protobuf::MessageStatic for Ad { }) } } + + fn default_instance() -> &'static Ad { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Ad, + }; + unsafe { + instance.get(Ad::new) + } + } } impl ::protobuf::Clear for Ad { fn clear(&mut self) { - self.clear_next(); - self.clear_ogg_fid(); - self.clear_image_fid(); - self.clear_duration(); - self.clear_click_url(); - self.clear_impression_url(); - self.clear_product(); - self.clear_advertiser(); - self.clear_gid(); + self.next = ::std::option::Option::None; + self.ogg_fid.clear(); + self.image_fid.clear(); + self.duration = ::std::option::Option::None; + self.click_url.clear(); + self.impression_url.clear(); + self.product.clear(); + self.advertiser.clear(); + self.gid.clear(); self.unknown_fields.clear(); } } @@ -4047,30 +3583,30 @@ pub struct Metadata { field_type: ::protobuf::SingularField<::std::string::String>, metadata: ::protobuf::SingularField<::std::string::String>, // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, } -// see codegen.rs for the explanation why impl Sync explicitly -unsafe impl ::std::marker::Sync for Metadata {} +impl<'a> ::std::default::Default for &'a Metadata { + fn default() -> &'a Metadata { + ::default_instance() + } +} impl Metadata { pub fn new() -> Metadata { ::std::default::Default::default() } - pub fn default_instance() -> &'static Metadata { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Metadata, - }; - unsafe { - instance.get(Metadata::new) - } - } - // optional string type = 1; + + pub fn get_field_type(&self) -> &str { + match self.field_type.as_ref() { + Some(v) => &v, + None => "", + } + } pub fn clear_field_type(&mut self) { self.field_type.clear(); } @@ -4098,23 +3634,15 @@ impl Metadata { self.field_type.take().unwrap_or_else(|| ::std::string::String::new()) } - pub fn get_field_type(&self) -> &str { - match self.field_type.as_ref() { + // optional string metadata = 2; + + + pub fn get_metadata(&self) -> &str { + match self.metadata.as_ref() { Some(v) => &v, None => "", } } - - fn get_field_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.field_type - } - - fn mut_field_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.field_type - } - - // optional string metadata = 2; - pub fn clear_metadata(&mut self) { self.metadata.clear(); } @@ -4141,21 +3669,6 @@ impl Metadata { pub fn take_metadata(&mut self) -> ::std::string::String { self.metadata.take().unwrap_or_else(|| ::std::string::String::new()) } - - pub fn get_metadata(&self) -> &str { - match self.metadata.as_ref() { - Some(v) => &v, - None => "", - } - } - - fn get_metadata_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { - &self.metadata - } - - fn mut_metadata_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { - &mut self.metadata - } } impl ::protobuf::Message for Metadata { @@ -4219,27 +3732,25 @@ impl ::protobuf::Message for Metadata { &mut self.unknown_fields } - fn as_any(&self) -> &::std::any::Any { - self as &::std::any::Any + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { + fn into_any(self: Box) -> ::std::boxed::Box { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - ::protobuf::MessageStatic::descriptor_static(None::) + Self::descriptor_static() } -} -impl ::protobuf::MessageStatic for Metadata { fn new() -> Metadata { Metadata::new() } - fn descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::MessageDescriptor { + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, @@ -4249,13 +3760,13 @@ impl ::protobuf::MessageStatic for Metadata { let mut fields = ::std::vec::Vec::new(); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "type", - Metadata::get_field_type_for_reflect, - Metadata::mut_field_type_for_reflect, + |m: &Metadata| { &m.field_type }, + |m: &mut Metadata| { &mut m.field_type }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "metadata", - Metadata::get_metadata_for_reflect, - Metadata::mut_metadata_for_reflect, + |m: &Metadata| { &m.metadata }, + |m: &mut Metadata| { &mut m.metadata }, )); ::protobuf::reflect::MessageDescriptor::new::( "Metadata", @@ -4265,12 +3776,22 @@ impl ::protobuf::MessageStatic for Metadata { }) } } + + fn default_instance() -> &'static Metadata { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Metadata, + }; + unsafe { + instance.get(Metadata::new) + } + } } impl ::protobuf::Clear for Metadata { fn clear(&mut self) { - self.clear_field_type(); - self.clear_metadata(); + self.field_type.clear(); + self.metadata.clear(); self.unknown_fields.clear(); } } @@ -4371,7 +3892,7 @@ impl ::protobuf::ProtobufEnum for MessageType { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -4387,6 +3908,13 @@ impl ::protobuf::ProtobufEnum for MessageType { impl ::std::marker::Copy for MessageType { } +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for MessageType { + fn default() -> Self { + MessageType::kMessageTypeHello + } +} + impl ::protobuf::reflect::ProtobufValue for MessageType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -4407,6 +3935,8 @@ pub enum CapabilityType { kCommandAcks = 10, kSupportsRename = 11, kHidden = 12, + kSupportsPlaylistV2 = 13, + kSupportsExternalEpisodes = 14, } impl ::protobuf::ProtobufEnum for CapabilityType { @@ -4428,6 +3958,8 @@ impl ::protobuf::ProtobufEnum for CapabilityType { 10 => ::std::option::Option::Some(CapabilityType::kCommandAcks), 11 => ::std::option::Option::Some(CapabilityType::kSupportsRename), 12 => ::std::option::Option::Some(CapabilityType::kHidden), + 13 => ::std::option::Option::Some(CapabilityType::kSupportsPlaylistV2), + 14 => ::std::option::Option::Some(CapabilityType::kSupportsExternalEpisodes), _ => ::std::option::Option::None } } @@ -4446,11 +3978,13 @@ impl ::protobuf::ProtobufEnum for CapabilityType { CapabilityType::kCommandAcks, CapabilityType::kSupportsRename, CapabilityType::kHidden, + CapabilityType::kSupportsPlaylistV2, + CapabilityType::kSupportsExternalEpisodes, ]; values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -4466,6 +4000,13 @@ impl ::protobuf::ProtobufEnum for CapabilityType { impl ::std::marker::Copy for CapabilityType { } +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for CapabilityType { + fn default() -> Self { + CapabilityType::kSupportedContexts + } +} + impl ::protobuf::reflect::ProtobufValue for CapabilityType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -4505,7 +4046,7 @@ impl ::protobuf::ProtobufEnum for PlayStatus { values } - fn enum_descriptor_static(_: ::std::option::Option) -> &'static ::protobuf::reflect::EnumDescriptor { + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, @@ -4521,6 +4062,12 @@ impl ::protobuf::ProtobufEnum for PlayStatus { impl ::std::marker::Copy for PlayStatus { } +impl ::std::default::Default for PlayStatus { + fn default() -> Self { + PlayStatus::kPlayStatusStop + } +} + impl ::protobuf::reflect::ProtobufValue for PlayStatus { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) @@ -4528,362 +4075,72 @@ impl ::protobuf::reflect::ProtobufValue for PlayStatus { } static file_descriptor_proto_data: &'static [u8] = b"\ - \n\x0bspirc.proto\"\xfa\x03\n\x05Frame\x12\x18\n\x07version\x18\x01\x20\ - \x01(\rR\x07version\x12\x14\n\x05ident\x18\x02\x20\x01(\tR\x05ident\x12)\ - \n\x10protocol_version\x18\x03\x20\x01(\tR\x0fprotocolVersion\x12\x15\n\ - \x06seq_nr\x18\x04\x20\x01(\rR\x05seqNr\x12\x1e\n\x03typ\x18\x05\x20\x01\ - (\x0e2\x0c.MessageTypeR\x03typ\x12/\n\x0cdevice_state\x18\x07\x20\x01(\ - \x0b2\x0c.DeviceStateR\x0bdeviceState\x12\"\n\x07goodbye\x18\x0b\x20\x01\ - (\x0b2\x08.GoodbyeR\x07goodbye\x12\x1c\n\x05state\x18\x0c\x20\x01(\x0b2\ - \x06.StateR\x05state\x12\x1a\n\x08position\x18\r\x20\x01(\rR\x08position\ - \x12\x16\n\x06volume\x18\x0e\x20\x01(\rR\x06volume\x12&\n\x0fstate_updat\ - e_id\x18\x11\x20\x01(\x03R\rstateUpdateId\x12\x1c\n\trecipient\x18\x12\ - \x20\x03(\tR\trecipient\x120\n\x14context_player_state\x18\x13\x20\x01(\ - \x0cR\x12contextPlayerState\x12\x19\n\x08new_name\x18\x14\x20\x01(\tR\ - \x07newName\x12%\n\x08metadata\x18\x19\x20\x01(\x0b2\t.MetadataR\x08meta\ - data\"\x88\x03\n\x0bDeviceState\x12\x1d\n\nsw_version\x18\x01\x20\x01(\t\ - R\tswVersion\x12\x1b\n\tis_active\x18\n\x20\x01(\x08R\x08isActive\x12\ - \x19\n\x08can_play\x18\x0b\x20\x01(\x08R\x07canPlay\x12\x16\n\x06volume\ - \x18\x0c\x20\x01(\rR\x06volume\x12\x12\n\x04name\x18\r\x20\x01(\tR\x04na\ - me\x12\x1d\n\nerror_code\x18\x0e\x20\x01(\rR\terrorCode\x12(\n\x10became\ - _active_at\x18\x0f\x20\x01(\x03R\x0ebecameActiveAt\x12#\n\rerror_message\ - \x18\x10\x20\x01(\tR\x0cerrorMessage\x12/\n\x0ccapabilities\x18\x11\x20\ - \x03(\x0b2\x0b.CapabilityR\x0ccapabilities\x120\n\x14context_player_erro\ - r\x18\x14\x20\x01(\tR\x12contextPlayerError\x12%\n\x08metadata\x18\x19\ - \x20\x03(\x0b2\t.MetadataR\x08metadata\"m\n\nCapability\x12!\n\x03typ\ - \x18\x01\x20\x01(\x0e2\x0f.CapabilityTypeR\x03typ\x12\x1a\n\x08intValue\ - \x18\x02\x20\x03(\x03R\x08intValue\x12\x20\n\x0bstringValue\x18\x03\x20\ - \x03(\tR\x0bstringValue\"!\n\x07Goodbye\x12\x16\n\x06reason\x18\x01\x20\ - \x01(\tR\x06reason\"\xa1\x04\n\x05State\x12\x1f\n\x0bcontext_uri\x18\x02\ - \x20\x01(\tR\ncontextUri\x12\x14\n\x05index\x18\x03\x20\x01(\rR\x05index\ - \x12\x1f\n\x0bposition_ms\x18\x04\x20\x01(\rR\npositionMs\x12#\n\x06stat\ - us\x18\x05\x20\x01(\x0e2\x0b.PlayStatusR\x06status\x120\n\x14position_me\ - asured_at\x18\x07\x20\x01(\x04R\x12positionMeasuredAt\x12/\n\x13context_\ - description\x18\x08\x20\x01(\tR\x12contextDescription\x12\x18\n\x07shuff\ - le\x18\r\x20\x01(\x08R\x07shuffle\x12\x16\n\x06repeat\x18\x0e\x20\x01(\ - \x08R\x06repeat\x12,\n\x12last_command_ident\x18\x14\x20\x01(\tR\x10last\ - CommandIdent\x12,\n\x12last_command_msgid\x18\x15\x20\x01(\rR\x10lastCom\ - mandMsgid\x122\n\x15playing_from_fallback\x18\x18\x20\x01(\x08R\x13playi\ - ngFromFallback\x12\x10\n\x03row\x18\x19\x20\x01(\rR\x03row\x12.\n\x13pla\ - ying_track_index\x18\x1a\x20\x01(\rR\x11playingTrackIndex\x12\x1f\n\x05t\ - rack\x18\x1b\x20\x03(\x0b2\t.TrackRefR\x05track\x12\x13\n\x02ad\x18\x1c\ - \x20\x01(\x0b2\x03.AdR\x02ad\"`\n\x08TrackRef\x12\x10\n\x03gid\x18\x01\ - \x20\x01(\x0cR\x03gid\x12\x10\n\x03uri\x18\x02\x20\x01(\tR\x03uri\x12\ - \x16\n\x06queued\x18\x03\x20\x01(\x08R\x06queued\x12\x18\n\x07context\ - \x18\x04\x20\x01(\tR\x07context\"\xfa\x01\n\x02Ad\x12\x12\n\x04next\x18\ - \x01\x20\x01(\x05R\x04next\x12\x17\n\x07ogg_fid\x18\x02\x20\x01(\x0cR\ - \x06oggFid\x12\x1b\n\timage_fid\x18\x03\x20\x01(\x0cR\x08imageFid\x12\ - \x1a\n\x08duration\x18\x04\x20\x01(\x05R\x08duration\x12\x1b\n\tclick_ur\ - l\x18\x05\x20\x01(\tR\x08clickUrl\x12%\n\x0eimpression_url\x18\x06\x20\ - \x01(\tR\rimpressionUrl\x12\x18\n\x07product\x18\x07\x20\x01(\tR\x07prod\ - uct\x12\x1e\n\nadvertiser\x18\x08\x20\x01(\tR\nadvertiser\x12\x10\n\x03g\ - id\x18\t\x20\x01(\x0cR\x03gid\":\n\x08Metadata\x12\x12\n\x04type\x18\x01\ - \x20\x01(\tR\x04type\x12\x1a\n\x08metadata\x18\x02\x20\x01(\tR\x08metada\ - ta*\x8d\x04\n\x0bMessageType\x12\x15\n\x11kMessageTypeHello\x10\x01\x12\ - \x17\n\x13kMessageTypeGoodbye\x10\x02\x12\x15\n\x11kMessageTypeProbe\x10\ - \x03\x12\x16\n\x12kMessageTypeNotify\x10\n\x12\x14\n\x10kMessageTypeLoad\ - \x10\x14\x12\x14\n\x10kMessageTypePlay\x10\x15\x12\x15\n\x11kMessageType\ - Pause\x10\x16\x12\x19\n\x15kMessageTypePlayPause\x10\x17\x12\x14\n\x10kM\ - essageTypeSeek\x10\x18\x12\x14\n\x10kMessageTypePrev\x10\x19\x12\x14\n\ - \x10kMessageTypeNext\x10\x1a\x12\x16\n\x12kMessageTypeVolume\x10\x1b\x12\ - \x17\n\x13kMessageTypeShuffle\x10\x1c\x12\x16\n\x12kMessageTypeRepeat\ - \x10\x1d\x12\x1a\n\x16kMessageTypeVolumeDown\x10\x1f\x12\x18\n\x14kMessa\ - geTypeVolumeUp\x10\x20\x12\x17\n\x13kMessageTypeReplace\x10!\x12\x16\n\ - \x12kMessageTypeLogout\x10\"\x12\x16\n\x12kMessageTypeAction\x10#\x12\ - \x16\n\x12kMessageTypeRename\x10$\x12\x1f\n\x1akMessageTypeUpdateMetadat\ - a\x10\x80\x01*\xfa\x01\n\x0eCapabilityType\x12\x16\n\x12kSupportedContex\ - ts\x10\x01\x12\x10\n\x0ckCanBePlayer\x10\x02\x12\x14\n\x10kRestrictToLoc\ - al\x10\x03\x12\x0f\n\x0bkDeviceType\x10\x04\x12\x14\n\x10kGaiaEqConnectI\ - d\x10\x05\x12\x13\n\x0fkSupportsLogout\x10\x06\x12\x11\n\rkIsObservable\ - \x10\x07\x12\x10\n\x0ckVolumeSteps\x10\x08\x12\x13\n\x0fkSupportedTypes\ - \x10\t\x12\x10\n\x0ckCommandAcks\x10\n\x12\x13\n\x0fkSupportsRename\x10\ - \x0b\x12\x0b\n\x07kHidden\x10\x0c*d\n\nPlayStatus\x12\x13\n\x0fkPlayStat\ - usStop\x10\0\x12\x13\n\x0fkPlayStatusPlay\x10\x01\x12\x14\n\x10kPlayStat\ - usPause\x10\x02\x12\x16\n\x12kPlayStatusLoading\x10\x03J\xbf.\n\x07\x12\ - \x05\0\0\x82\x01\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\ - \x04\x02\0\x12\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\r\n\x0b\n\x04\x04\ - \0\x02\0\x12\x03\x03\x04\"\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x04\ - \x0c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\r\x13\n\x0c\n\x05\x04\0\x02\ - \0\x01\x12\x03\x03\x14\x1b\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1e!\ - \n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x20\n\x0c\n\x05\x04\0\x02\x01\ - \x04\x12\x03\x04\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\r\x13\ - \n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x14\x19\n\x0c\n\x05\x04\0\x02\ - \x01\x03\x12\x03\x04\x1c\x1f\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04+\ - \n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\x05\x04\x0c\n\x0c\n\x05\x04\0\x02\ - \x02\x05\x12\x03\x05\r\x13\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x14\ - $\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05'*\n\x0b\n\x04\x04\0\x02\x03\ - \x12\x03\x06\x04!\n\x0c\n\x05\x04\0\x02\x03\x04\x12\x03\x06\x04\x0c\n\ - \x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x06\r\x13\n\x0c\n\x05\x04\0\x02\x03\ - \x01\x12\x03\x06\x14\x1a\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x06\x1d\ - \x20\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x04#\n\x0c\n\x05\x04\0\x02\ - \x04\x04\x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x06\x12\x03\x07\r\ - \x18\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\x19\x1c\n\x0c\n\x05\x04\0\ - \x02\x04\x03\x12\x03\x07\x1f\"\n\x0b\n\x04\x04\0\x02\x05\x12\x03\x08\x04\ - ,\n\x0c\n\x05\x04\0\x02\x05\x04\x12\x03\x08\x04\x0c\n\x0c\n\x05\x04\0\ - \x02\x05\x06\x12\x03\x08\r\x18\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x08\ - \x19%\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x08(+\n\x0b\n\x04\x04\0\x02\ - \x06\x12\x03\t\x04#\n\x0c\n\x05\x04\0\x02\x06\x04\x12\x03\t\x04\x0c\n\ - \x0c\n\x05\x04\0\x02\x06\x06\x12\x03\t\r\x14\n\x0c\n\x05\x04\0\x02\x06\ - \x01\x12\x03\t\x15\x1c\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\t\x1f\"\n\ - \x0b\n\x04\x04\0\x02\x07\x12\x03\n\x04\x1f\n\x0c\n\x05\x04\0\x02\x07\x04\ - \x12\x03\n\x04\x0c\n\x0c\n\x05\x04\0\x02\x07\x06\x12\x03\n\r\x12\n\x0c\n\ - \x05\x04\0\x02\x07\x01\x12\x03\n\x13\x18\n\x0c\n\x05\x04\0\x02\x07\x03\ - \x12\x03\n\x1b\x1e\n\x0b\n\x04\x04\0\x02\x08\x12\x03\x0b\x04#\n\x0c\n\ - \x05\x04\0\x02\x08\x04\x12\x03\x0b\x04\x0c\n\x0c\n\x05\x04\0\x02\x08\x05\ - \x12\x03\x0b\r\x13\n\x0c\n\x05\x04\0\x02\x08\x01\x12\x03\x0b\x14\x1c\n\ - \x0c\n\x05\x04\0\x02\x08\x03\x12\x03\x0b\x1f\"\n\x0b\n\x04\x04\0\x02\t\ - \x12\x03\x0c\x04!\n\x0c\n\x05\x04\0\x02\t\x04\x12\x03\x0c\x04\x0c\n\x0c\ - \n\x05\x04\0\x02\t\x05\x12\x03\x0c\r\x13\n\x0c\n\x05\x04\0\x02\t\x01\x12\ - \x03\x0c\x14\x1a\n\x0c\n\x05\x04\0\x02\t\x03\x12\x03\x0c\x1d\x20\n\x0b\n\ - \x04\x04\0\x02\n\x12\x03\r\x04*\n\x0c\n\x05\x04\0\x02\n\x04\x12\x03\r\ - \x04\x0c\n\x0c\n\x05\x04\0\x02\n\x05\x12\x03\r\r\x12\n\x0c\n\x05\x04\0\ - \x02\n\x01\x12\x03\r\x13\"\n\x0c\n\x05\x04\0\x02\n\x03\x12\x03\r%)\n\x0b\ - \n\x04\x04\0\x02\x0b\x12\x03\x0e\x04%\n\x0c\n\x05\x04\0\x02\x0b\x04\x12\ - \x03\x0e\x04\x0c\n\x0c\n\x05\x04\0\x02\x0b\x05\x12\x03\x0e\r\x13\n\x0c\n\ - \x05\x04\0\x02\x0b\x01\x12\x03\x0e\x14\x1d\n\x0c\n\x05\x04\0\x02\x0b\x03\ - \x12\x03\x0e\x20$\n\x0b\n\x04\x04\0\x02\x0c\x12\x03\x0f\x04/\n\x0c\n\x05\ - \x04\0\x02\x0c\x04\x12\x03\x0f\x04\x0c\n\x0c\n\x05\x04\0\x02\x0c\x05\x12\ - \x03\x0f\r\x12\n\x0c\n\x05\x04\0\x02\x0c\x01\x12\x03\x0f\x13'\n\x0c\n\ - \x05\x04\0\x02\x0c\x03\x12\x03\x0f*.\n\x0b\n\x04\x04\0\x02\r\x12\x03\x10\ - \x04$\n\x0c\n\x05\x04\0\x02\r\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\0\ - \x02\r\x05\x12\x03\x10\r\x13\n\x0c\n\x05\x04\0\x02\r\x01\x12\x03\x10\x14\ - \x1c\n\x0c\n\x05\x04\0\x02\r\x03\x12\x03\x10\x1f#\n\x0b\n\x04\x04\0\x02\ - \x0e\x12\x03\x11\x04&\n\x0c\n\x05\x04\0\x02\x0e\x04\x12\x03\x11\x04\x0c\ - \n\x0c\n\x05\x04\0\x02\x0e\x06\x12\x03\x11\r\x15\n\x0c\n\x05\x04\0\x02\ - \x0e\x01\x12\x03\x11\x16\x1e\n\x0c\n\x05\x04\0\x02\x0e\x03\x12\x03\x11!%\ - \n\n\n\x02\x05\0\x12\x04\x14\0*\x01\n\n\n\x03\x05\0\x01\x12\x03\x14\x05\ - \x10\n\x0b\n\x04\x05\0\x02\0\x12\x03\x15\x04\x1c\n\x0c\n\x05\x05\0\x02\0\ - \x01\x12\x03\x15\x04\x15\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x15\x18\x1b\ - \n\x0b\n\x04\x05\0\x02\x01\x12\x03\x16\x04\x1e\n\x0c\n\x05\x05\0\x02\x01\ - \x01\x12\x03\x16\x04\x17\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x16\x1a\ - \x1d\n\x0b\n\x04\x05\0\x02\x02\x12\x03\x17\x04\x1c\n\x0c\n\x05\x05\0\x02\ - \x02\x01\x12\x03\x17\x04\x15\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x17\ - \x18\x1b\n\x0b\n\x04\x05\0\x02\x03\x12\x03\x18\x04\x1d\n\x0c\n\x05\x05\0\ - \x02\x03\x01\x12\x03\x18\x04\x16\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\ - \x18\x19\x1c\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x19\x04\x1c\n\x0c\n\x05\ - \x05\0\x02\x04\x01\x12\x03\x19\x04\x14\n\x0c\n\x05\x05\0\x02\x04\x02\x12\ - \x03\x19\x17\x1b\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x1a\x04\x1c\n\x0c\n\ - \x05\x05\0\x02\x05\x01\x12\x03\x1a\x04\x14\n\x0c\n\x05\x05\0\x02\x05\x02\ - \x12\x03\x1a\x17\x1b\n\x0b\n\x04\x05\0\x02\x06\x12\x03\x1b\x04\x1d\n\x0c\ - \n\x05\x05\0\x02\x06\x01\x12\x03\x1b\x04\x15\n\x0c\n\x05\x05\0\x02\x06\ - \x02\x12\x03\x1b\x18\x1c\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x1c\x04!\n\ - \x0c\n\x05\x05\0\x02\x07\x01\x12\x03\x1c\x04\x19\n\x0c\n\x05\x05\0\x02\ - \x07\x02\x12\x03\x1c\x1c\x20\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x1d\x04\ - \x1c\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x1d\x04\x14\n\x0c\n\x05\x05\0\ - \x02\x08\x02\x12\x03\x1d\x17\x1b\n\x0b\n\x04\x05\0\x02\t\x12\x03\x1e\x04\ - \x1c\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03\x1e\x04\x14\n\x0c\n\x05\x05\0\ - \x02\t\x02\x12\x03\x1e\x17\x1b\n\x0b\n\x04\x05\0\x02\n\x12\x03\x1f\x04\ - \x1c\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03\x1f\x04\x14\n\x0c\n\x05\x05\0\ - \x02\n\x02\x12\x03\x1f\x17\x1b\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x20\x04\ - \x1e\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\x20\x04\x16\n\x0c\n\x05\x05\0\ - \x02\x0b\x02\x12\x03\x20\x19\x1d\n\x0b\n\x04\x05\0\x02\x0c\x12\x03!\x04\ - \x1f\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\x03!\x04\x17\n\x0c\n\x05\x05\0\ - \x02\x0c\x02\x12\x03!\x1a\x1e\n\x0b\n\x04\x05\0\x02\r\x12\x03\"\x04\x1e\ - \n\x0c\n\x05\x05\0\x02\r\x01\x12\x03\"\x04\x16\n\x0c\n\x05\x05\0\x02\r\ - \x02\x12\x03\"\x19\x1d\n\x0b\n\x04\x05\0\x02\x0e\x12\x03#\x04\"\n\x0c\n\ - \x05\x05\0\x02\x0e\x01\x12\x03#\x04\x1a\n\x0c\n\x05\x05\0\x02\x0e\x02\ - \x12\x03#\x1d!\n\x0b\n\x04\x05\0\x02\x0f\x12\x03$\x04\x20\n\x0c\n\x05\ - \x05\0\x02\x0f\x01\x12\x03$\x04\x18\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\ - \x03$\x1b\x1f\n\x0b\n\x04\x05\0\x02\x10\x12\x03%\x04\x1f\n\x0c\n\x05\x05\ - \0\x02\x10\x01\x12\x03%\x04\x17\n\x0c\n\x05\x05\0\x02\x10\x02\x12\x03%\ - \x1a\x1e\n\x0b\n\x04\x05\0\x02\x11\x12\x03&\x04\x1e\n\x0c\n\x05\x05\0\ - \x02\x11\x01\x12\x03&\x04\x16\n\x0c\n\x05\x05\0\x02\x11\x02\x12\x03&\x19\ - \x1d\n\x0b\n\x04\x05\0\x02\x12\x12\x03'\x04\x1e\n\x0c\n\x05\x05\0\x02\ - \x12\x01\x12\x03'\x04\x16\n\x0c\n\x05\x05\0\x02\x12\x02\x12\x03'\x19\x1d\ - \n\x0b\n\x04\x05\0\x02\x13\x12\x03(\x04\x1e\n\x0c\n\x05\x05\0\x02\x13\ - \x01\x12\x03(\x04\x16\n\x0c\n\x05\x05\0\x02\x13\x02\x12\x03(\x19\x1d\n\ - \x0b\n\x04\x05\0\x02\x14\x12\x03)\x04&\n\x0c\n\x05\x05\0\x02\x14\x01\x12\ - \x03)\x04\x1e\n\x0c\n\x05\x05\0\x02\x14\x02\x12\x03)!%\n\n\n\x02\x04\x01\ - \x12\x04,\08\x01\n\n\n\x03\x04\x01\x01\x12\x03,\x08\x13\n\x0b\n\x04\x04\ - \x01\x02\0\x12\x03-\x04%\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03-\x04\x0c\ - \n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03-\r\x13\n\x0c\n\x05\x04\x01\x02\0\ - \x01\x12\x03-\x14\x1e\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03-!$\n\x0b\n\ - \x04\x04\x01\x02\x01\x12\x03.\x04\"\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\ - \x03.\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03.\r\x11\n\x0c\n\x05\ - \x04\x01\x02\x01\x01\x12\x03.\x12\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\ - \x12\x03.\x1e!\n\x0b\n\x04\x04\x01\x02\x02\x12\x03/\x04!\n\x0c\n\x05\x04\ - \x01\x02\x02\x04\x12\x03/\x04\x0c\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\ - \x03/\r\x11\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03/\x12\x1a\n\x0c\n\x05\ - \x04\x01\x02\x02\x03\x12\x03/\x1d\x20\n\x0b\n\x04\x04\x01\x02\x03\x12\ - \x030\x04!\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\x030\x04\x0c\n\x0c\n\x05\ - \x04\x01\x02\x03\x05\x12\x030\r\x13\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\ - \x030\x14\x1a\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x030\x1d\x20\n\x0b\n\ - \x04\x04\x01\x02\x04\x12\x031\x04\x1f\n\x0c\n\x05\x04\x01\x02\x04\x04\ - \x12\x031\x04\x0c\n\x0c\n\x05\x04\x01\x02\x04\x05\x12\x031\r\x13\n\x0c\n\ - \x05\x04\x01\x02\x04\x01\x12\x031\x14\x18\n\x0c\n\x05\x04\x01\x02\x04\ - \x03\x12\x031\x1b\x1e\n\x0b\n\x04\x04\x01\x02\x05\x12\x032\x04%\n\x0c\n\ - \x05\x04\x01\x02\x05\x04\x12\x032\x04\x0c\n\x0c\n\x05\x04\x01\x02\x05\ - \x05\x12\x032\r\x13\n\x0c\n\x05\x04\x01\x02\x05\x01\x12\x032\x14\x1e\n\ - \x0c\n\x05\x04\x01\x02\x05\x03\x12\x032!$\n\x0b\n\x04\x04\x01\x02\x06\ - \x12\x033\x04*\n\x0c\n\x05\x04\x01\x02\x06\x04\x12\x033\x04\x0c\n\x0c\n\ - \x05\x04\x01\x02\x06\x05\x12\x033\r\x12\n\x0c\n\x05\x04\x01\x02\x06\x01\ - \x12\x033\x13#\n\x0c\n\x05\x04\x01\x02\x06\x03\x12\x033&)\n\x0b\n\x04\ - \x04\x01\x02\x07\x12\x034\x04)\n\x0c\n\x05\x04\x01\x02\x07\x04\x12\x034\ - \x04\x0c\n\x0c\n\x05\x04\x01\x02\x07\x05\x12\x034\r\x13\n\x0c\n\x05\x04\ - \x01\x02\x07\x01\x12\x034\x14!\n\x0c\n\x05\x04\x01\x02\x07\x03\x12\x034$\ - (\n\x0b\n\x04\x04\x01\x02\x08\x12\x035\x04,\n\x0c\n\x05\x04\x01\x02\x08\ - \x04\x12\x035\x04\x0c\n\x0c\n\x05\x04\x01\x02\x08\x06\x12\x035\r\x17\n\ - \x0c\n\x05\x04\x01\x02\x08\x01\x12\x035\x18$\n\x0c\n\x05\x04\x01\x02\x08\ - \x03\x12\x035'+\n\x0b\n\x04\x04\x01\x02\t\x12\x036\x040\n\x0c\n\x05\x04\ - \x01\x02\t\x04\x12\x036\x04\x0c\n\x0c\n\x05\x04\x01\x02\t\x05\x12\x036\r\ - \x13\n\x0c\n\x05\x04\x01\x02\t\x01\x12\x036\x14(\n\x0c\n\x05\x04\x01\x02\ - \t\x03\x12\x036+/\n\x0b\n\x04\x04\x01\x02\n\x12\x037\x04&\n\x0c\n\x05\ - \x04\x01\x02\n\x04\x12\x037\x04\x0c\n\x0c\n\x05\x04\x01\x02\n\x06\x12\ - \x037\r\x15\n\x0c\n\x05\x04\x01\x02\n\x01\x12\x037\x16\x1e\n\x0c\n\x05\ - \x04\x01\x02\n\x03\x12\x037!%\n\n\n\x02\x04\x02\x12\x04:\0>\x01\n\n\n\ - \x03\x04\x02\x01\x12\x03:\x08\x12\n\x0b\n\x04\x04\x02\x02\0\x12\x03;\x04\ - &\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03;\x04\x0c\n\x0c\n\x05\x04\x02\x02\ - \0\x06\x12\x03;\r\x1b\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03;\x1c\x1f\n\ - \x0c\n\x05\x04\x02\x02\0\x03\x12\x03;\"%\n\x0b\n\x04\x04\x02\x02\x01\x12\ - \x03<\x04\"\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03<\x04\x0c\n\x0c\n\x05\ - \x04\x02\x02\x01\x05\x12\x03<\r\x12\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\ - \x03<\x13\x1b\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03<\x1e!\n\x0b\n\x04\ - \x04\x02\x02\x02\x12\x03=\x04&\n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03=\ - \x04\x0c\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03=\r\x13\n\x0c\n\x05\x04\ - \x02\x02\x02\x01\x12\x03=\x14\x1f\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\ - \x03=\"%\n\n\n\x02\x05\x01\x12\x04@\0M\x01\n\n\n\x03\x05\x01\x01\x12\x03\ - @\x05\x13\n\x0b\n\x04\x05\x01\x02\0\x12\x03A\x04\x1d\n\x0c\n\x05\x05\x01\ - \x02\0\x01\x12\x03A\x04\x16\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03A\x19\ - \x1c\n\x0b\n\x04\x05\x01\x02\x01\x12\x03B\x04\x17\n\x0c\n\x05\x05\x01\ - \x02\x01\x01\x12\x03B\x04\x10\n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03B\ - \x13\x16\n\x0b\n\x04\x05\x01\x02\x02\x12\x03C\x04\x1b\n\x0c\n\x05\x05\ - \x01\x02\x02\x01\x12\x03C\x04\x14\n\x0c\n\x05\x05\x01\x02\x02\x02\x12\ - \x03C\x17\x1a\n\x0b\n\x04\x05\x01\x02\x03\x12\x03D\x04\x16\n\x0c\n\x05\ - \x05\x01\x02\x03\x01\x12\x03D\x04\x0f\n\x0c\n\x05\x05\x01\x02\x03\x02\ - \x12\x03D\x12\x15\n\x0b\n\x04\x05\x01\x02\x04\x12\x03E\x04\x1b\n\x0c\n\ - \x05\x05\x01\x02\x04\x01\x12\x03E\x04\x14\n\x0c\n\x05\x05\x01\x02\x04\ - \x02\x12\x03E\x17\x1a\n\x0b\n\x04\x05\x01\x02\x05\x12\x03F\x04\x1a\n\x0c\ - \n\x05\x05\x01\x02\x05\x01\x12\x03F\x04\x13\n\x0c\n\x05\x05\x01\x02\x05\ - \x02\x12\x03F\x16\x19\n\x0b\n\x04\x05\x01\x02\x06\x12\x03G\x04\x18\n\x0c\ - \n\x05\x05\x01\x02\x06\x01\x12\x03G\x04\x11\n\x0c\n\x05\x05\x01\x02\x06\ - \x02\x12\x03G\x14\x17\n\x0b\n\x04\x05\x01\x02\x07\x12\x03H\x04\x17\n\x0c\ - \n\x05\x05\x01\x02\x07\x01\x12\x03H\x04\x10\n\x0c\n\x05\x05\x01\x02\x07\ - \x02\x12\x03H\x13\x16\n\x0b\n\x04\x05\x01\x02\x08\x12\x03I\x04\x1a\n\x0c\ - \n\x05\x05\x01\x02\x08\x01\x12\x03I\x04\x13\n\x0c\n\x05\x05\x01\x02\x08\ - \x02\x12\x03I\x16\x19\n\x0b\n\x04\x05\x01\x02\t\x12\x03J\x04\x17\n\x0c\n\ - \x05\x05\x01\x02\t\x01\x12\x03J\x04\x10\n\x0c\n\x05\x05\x01\x02\t\x02\ - \x12\x03J\x13\x16\n\x0b\n\x04\x05\x01\x02\n\x12\x03K\x04\x1a\n\x0c\n\x05\ - \x05\x01\x02\n\x01\x12\x03K\x04\x13\n\x0c\n\x05\x05\x01\x02\n\x02\x12\ - \x03K\x16\x19\n\x0b\n\x04\x05\x01\x02\x0b\x12\x03L\x04\x12\n\x0c\n\x05\ - \x05\x01\x02\x0b\x01\x12\x03L\x04\x0b\n\x0c\n\x05\x05\x01\x02\x0b\x02\ - \x12\x03L\x0e\x11\n\n\n\x02\x04\x03\x12\x04O\0Q\x01\n\n\n\x03\x04\x03\ - \x01\x12\x03O\x08\x0f\n\x0b\n\x04\x04\x03\x02\0\x12\x03P\x04!\n\x0c\n\ - \x05\x04\x03\x02\0\x04\x12\x03P\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x05\ - \x12\x03P\r\x13\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03P\x14\x1a\n\x0c\n\ - \x05\x04\x03\x02\0\x03\x12\x03P\x1d\x20\n\n\n\x02\x04\x04\x12\x04S\0c\ - \x01\n\n\n\x03\x04\x04\x01\x12\x03S\x08\r\n\x0b\n\x04\x04\x04\x02\0\x12\ - \x03T\x04&\n\x0c\n\x05\x04\x04\x02\0\x04\x12\x03T\x04\x0c\n\x0c\n\x05\ - \x04\x04\x02\0\x05\x12\x03T\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03T\ - \x14\x1f\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03T\"%\n\x0b\n\x04\x04\x04\ - \x02\x01\x12\x03U\x04\x20\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03U\x04\ - \x0c\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03U\r\x13\n\x0c\n\x05\x04\x04\ - \x02\x01\x01\x12\x03U\x14\x19\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03U\ - \x1c\x1f\n\x0b\n\x04\x04\x04\x02\x02\x12\x03V\x04&\n\x0c\n\x05\x04\x04\ - \x02\x02\x04\x12\x03V\x04\x0c\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03V\r\ - \x13\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03V\x14\x1f\n\x0c\n\x05\x04\ - \x04\x02\x02\x03\x12\x03V\"%\n\x0b\n\x04\x04\x04\x02\x03\x12\x03W\x04%\n\ - \x0c\n\x05\x04\x04\x02\x03\x04\x12\x03W\x04\x0c\n\x0c\n\x05\x04\x04\x02\ - \x03\x06\x12\x03W\r\x17\n\x0c\n\x05\x04\x04\x02\x03\x01\x12\x03W\x18\x1e\ - \n\x0c\n\x05\x04\x04\x02\x03\x03\x12\x03W!$\n\x0b\n\x04\x04\x04\x02\x04\ - \x12\x03X\x04/\n\x0c\n\x05\x04\x04\x02\x04\x04\x12\x03X\x04\x0c\n\x0c\n\ - \x05\x04\x04\x02\x04\x05\x12\x03X\r\x13\n\x0c\n\x05\x04\x04\x02\x04\x01\ - \x12\x03X\x14(\n\x0c\n\x05\x04\x04\x02\x04\x03\x12\x03X+.\n\x0b\n\x04\ - \x04\x04\x02\x05\x12\x03Y\x04.\n\x0c\n\x05\x04\x04\x02\x05\x04\x12\x03Y\ - \x04\x0c\n\x0c\n\x05\x04\x04\x02\x05\x05\x12\x03Y\r\x13\n\x0c\n\x05\x04\ - \x04\x02\x05\x01\x12\x03Y\x14'\n\x0c\n\x05\x04\x04\x02\x05\x03\x12\x03Y*\ - -\n\x0b\n\x04\x04\x04\x02\x06\x12\x03Z\x04\x20\n\x0c\n\x05\x04\x04\x02\ - \x06\x04\x12\x03Z\x04\x0c\n\x0c\n\x05\x04\x04\x02\x06\x05\x12\x03Z\r\x11\ - \n\x0c\n\x05\x04\x04\x02\x06\x01\x12\x03Z\x12\x19\n\x0c\n\x05\x04\x04\ - \x02\x06\x03\x12\x03Z\x1c\x1f\n\x0b\n\x04\x04\x04\x02\x07\x12\x03[\x04\ - \x1f\n\x0c\n\x05\x04\x04\x02\x07\x04\x12\x03[\x04\x0c\n\x0c\n\x05\x04\ - \x04\x02\x07\x05\x12\x03[\r\x11\n\x0c\n\x05\x04\x04\x02\x07\x01\x12\x03[\ - \x12\x18\n\x0c\n\x05\x04\x04\x02\x07\x03\x12\x03[\x1b\x1e\n\x0b\n\x04\ - \x04\x04\x02\x08\x12\x03\\\x04.\n\x0c\n\x05\x04\x04\x02\x08\x04\x12\x03\ - \\\x04\x0c\n\x0c\n\x05\x04\x04\x02\x08\x05\x12\x03\\\r\x13\n\x0c\n\x05\ - \x04\x04\x02\x08\x01\x12\x03\\\x14&\n\x0c\n\x05\x04\x04\x02\x08\x03\x12\ - \x03\\)-\n\x0b\n\x04\x04\x04\x02\t\x12\x03]\x04.\n\x0c\n\x05\x04\x04\x02\ - \t\x04\x12\x03]\x04\x0c\n\x0c\n\x05\x04\x04\x02\t\x05\x12\x03]\r\x13\n\ - \x0c\n\x05\x04\x04\x02\t\x01\x12\x03]\x14&\n\x0c\n\x05\x04\x04\x02\t\x03\ - \x12\x03])-\n\x0b\n\x04\x04\x04\x02\n\x12\x03^\x04/\n\x0c\n\x05\x04\x04\ - \x02\n\x04\x12\x03^\x04\x0c\n\x0c\n\x05\x04\x04\x02\n\x05\x12\x03^\r\x11\ - \n\x0c\n\x05\x04\x04\x02\n\x01\x12\x03^\x12'\n\x0c\n\x05\x04\x04\x02\n\ - \x03\x12\x03^*.\n\x0b\n\x04\x04\x04\x02\x0b\x12\x03_\x04\x1f\n\x0c\n\x05\ - \x04\x04\x02\x0b\x04\x12\x03_\x04\x0c\n\x0c\n\x05\x04\x04\x02\x0b\x05\ - \x12\x03_\r\x13\n\x0c\n\x05\x04\x04\x02\x0b\x01\x12\x03_\x14\x17\n\x0c\n\ - \x05\x04\x04\x02\x0b\x03\x12\x03_\x1a\x1e\n\x0b\n\x04\x04\x04\x02\x0c\ - \x12\x03`\x04/\n\x0c\n\x05\x04\x04\x02\x0c\x04\x12\x03`\x04\x0c\n\x0c\n\ - \x05\x04\x04\x02\x0c\x05\x12\x03`\r\x13\n\x0c\n\x05\x04\x04\x02\x0c\x01\ - \x12\x03`\x14'\n\x0c\n\x05\x04\x04\x02\x0c\x03\x12\x03`*.\n\x0b\n\x04\ - \x04\x04\x02\r\x12\x03a\x04#\n\x0c\n\x05\x04\x04\x02\r\x04\x12\x03a\x04\ - \x0c\n\x0c\n\x05\x04\x04\x02\r\x06\x12\x03a\r\x15\n\x0c\n\x05\x04\x04\ - \x02\r\x01\x12\x03a\x16\x1b\n\x0c\n\x05\x04\x04\x02\r\x03\x12\x03a\x1e\"\ - \n\x0b\n\x04\x04\x04\x02\x0e\x12\x03b\x04\x1a\n\x0c\n\x05\x04\x04\x02\ - \x0e\x04\x12\x03b\x04\x0c\n\x0c\n\x05\x04\x04\x02\x0e\x06\x12\x03b\r\x0f\ - \n\x0c\n\x05\x04\x04\x02\x0e\x01\x12\x03b\x10\x12\n\x0c\n\x05\x04\x04\ - \x02\x0e\x03\x12\x03b\x15\x19\n\n\n\x02\x05\x02\x12\x04e\0j\x01\n\n\n\ - \x03\x05\x02\x01\x12\x03e\x05\x0f\n\x0b\n\x04\x05\x02\x02\0\x12\x03f\x04\ - \x1a\n\x0c\n\x05\x05\x02\x02\0\x01\x12\x03f\x04\x13\n\x0c\n\x05\x05\x02\ - \x02\0\x02\x12\x03f\x16\x19\n\x0b\n\x04\x05\x02\x02\x01\x12\x03g\x04\x1a\ - \n\x0c\n\x05\x05\x02\x02\x01\x01\x12\x03g\x04\x13\n\x0c\n\x05\x05\x02\ - \x02\x01\x02\x12\x03g\x16\x19\n\x0b\n\x04\x05\x02\x02\x02\x12\x03h\x04\ - \x1b\n\x0c\n\x05\x05\x02\x02\x02\x01\x12\x03h\x04\x14\n\x0c\n\x05\x05\ - \x02\x02\x02\x02\x12\x03h\x17\x1a\n\x0b\n\x04\x05\x02\x02\x03\x12\x03i\ - \x04\x1d\n\x0c\n\x05\x05\x02\x02\x03\x01\x12\x03i\x04\x16\n\x0c\n\x05\ - \x05\x02\x02\x03\x02\x12\x03i\x19\x1c\n\n\n\x02\x04\x05\x12\x04l\0q\x01\ - \n\n\n\x03\x04\x05\x01\x12\x03l\x08\x10\n\x0b\n\x04\x04\x05\x02\0\x12\ - \x03m\x04\x1d\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03m\x04\x0c\n\x0c\n\x05\ - \x04\x05\x02\0\x05\x12\x03m\r\x12\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03m\ - \x13\x16\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03m\x19\x1c\n\x0b\n\x04\x04\ - \x05\x02\x01\x12\x03n\x04\x1e\n\x0c\n\x05\x04\x05\x02\x01\x04\x12\x03n\ - \x04\x0c\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\x03n\r\x13\n\x0c\n\x05\x04\ - \x05\x02\x01\x01\x12\x03n\x14\x17\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\ - \x03n\x1a\x1d\n\x0b\n\x04\x04\x05\x02\x02\x12\x03o\x04\x1f\n\x0c\n\x05\ - \x04\x05\x02\x02\x04\x12\x03o\x04\x0c\n\x0c\n\x05\x04\x05\x02\x02\x05\ - \x12\x03o\r\x11\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\x03o\x12\x18\n\x0c\n\ - \x05\x04\x05\x02\x02\x03\x12\x03o\x1b\x1e\n\x0b\n\x04\x04\x05\x02\x03\ - \x12\x03p\x04\"\n\x0c\n\x05\x04\x05\x02\x03\x04\x12\x03p\x04\x0c\n\x0c\n\ - \x05\x04\x05\x02\x03\x05\x12\x03p\r\x13\n\x0c\n\x05\x04\x05\x02\x03\x01\ - \x12\x03p\x14\x1b\n\x0c\n\x05\x04\x05\x02\x03\x03\x12\x03p\x1e!\n\n\n\ - \x02\x04\x06\x12\x04s\0}\x01\n\n\n\x03\x04\x06\x01\x12\x03s\x08\n\n\x0b\ - \n\x04\x04\x06\x02\0\x12\x03t\x04\x1e\n\x0c\n\x05\x04\x06\x02\0\x04\x12\ - \x03t\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\x12\x03t\r\x12\n\x0c\n\x05\ - \x04\x06\x02\0\x01\x12\x03t\x13\x17\n\x0c\n\x05\x04\x06\x02\0\x03\x12\ - \x03t\x1a\x1d\n\x0b\n\x04\x04\x06\x02\x01\x12\x03u\x04!\n\x0c\n\x05\x04\ - \x06\x02\x01\x04\x12\x03u\x04\x0c\n\x0c\n\x05\x04\x06\x02\x01\x05\x12\ - \x03u\r\x12\n\x0c\n\x05\x04\x06\x02\x01\x01\x12\x03u\x13\x1a\n\x0c\n\x05\ - \x04\x06\x02\x01\x03\x12\x03u\x1d\x20\n\x0b\n\x04\x04\x06\x02\x02\x12\ - \x03v\x04#\n\x0c\n\x05\x04\x06\x02\x02\x04\x12\x03v\x04\x0c\n\x0c\n\x05\ - \x04\x06\x02\x02\x05\x12\x03v\r\x12\n\x0c\n\x05\x04\x06\x02\x02\x01\x12\ - \x03v\x13\x1c\n\x0c\n\x05\x04\x06\x02\x02\x03\x12\x03v\x1f\"\n\x0b\n\x04\ - \x04\x06\x02\x03\x12\x03w\x04\"\n\x0c\n\x05\x04\x06\x02\x03\x04\x12\x03w\ - \x04\x0c\n\x0c\n\x05\x04\x06\x02\x03\x05\x12\x03w\r\x12\n\x0c\n\x05\x04\ - \x06\x02\x03\x01\x12\x03w\x13\x1b\n\x0c\n\x05\x04\x06\x02\x03\x03\x12\ - \x03w\x1e!\n\x0b\n\x04\x04\x06\x02\x04\x12\x03x\x04$\n\x0c\n\x05\x04\x06\ - \x02\x04\x04\x12\x03x\x04\x0c\n\x0c\n\x05\x04\x06\x02\x04\x05\x12\x03x\r\ - \x13\n\x0c\n\x05\x04\x06\x02\x04\x01\x12\x03x\x14\x1d\n\x0c\n\x05\x04\ - \x06\x02\x04\x03\x12\x03x\x20#\n\x0b\n\x04\x04\x06\x02\x05\x12\x03y\x04)\ - \n\x0c\n\x05\x04\x06\x02\x05\x04\x12\x03y\x04\x0c\n\x0c\n\x05\x04\x06\ - \x02\x05\x05\x12\x03y\r\x13\n\x0c\n\x05\x04\x06\x02\x05\x01\x12\x03y\x14\ - \"\n\x0c\n\x05\x04\x06\x02\x05\x03\x12\x03y%(\n\x0b\n\x04\x04\x06\x02\ - \x06\x12\x03z\x04\"\n\x0c\n\x05\x04\x06\x02\x06\x04\x12\x03z\x04\x0c\n\ - \x0c\n\x05\x04\x06\x02\x06\x05\x12\x03z\r\x13\n\x0c\n\x05\x04\x06\x02\ - \x06\x01\x12\x03z\x14\x1b\n\x0c\n\x05\x04\x06\x02\x06\x03\x12\x03z\x1e!\ - \n\x0b\n\x04\x04\x06\x02\x07\x12\x03{\x04%\n\x0c\n\x05\x04\x06\x02\x07\ - \x04\x12\x03{\x04\x0c\n\x0c\n\x05\x04\x06\x02\x07\x05\x12\x03{\r\x13\n\ - \x0c\n\x05\x04\x06\x02\x07\x01\x12\x03{\x14\x1e\n\x0c\n\x05\x04\x06\x02\ - \x07\x03\x12\x03{!$\n\x0b\n\x04\x04\x06\x02\x08\x12\x03|\x04\x1d\n\x0c\n\ - \x05\x04\x06\x02\x08\x04\x12\x03|\x04\x0c\n\x0c\n\x05\x04\x06\x02\x08\ - \x05\x12\x03|\r\x12\n\x0c\n\x05\x04\x06\x02\x08\x01\x12\x03|\x13\x16\n\ - \x0c\n\x05\x04\x06\x02\x08\x03\x12\x03|\x19\x1c\n\x0b\n\x02\x04\x07\x12\ - \x05\x7f\0\x82\x01\x01\n\n\n\x03\x04\x07\x01\x12\x03\x7f\x08\x10\n\x0c\n\ - \x04\x04\x07\x02\0\x12\x04\x80\x01\x04\x1f\n\r\n\x05\x04\x07\x02\0\x04\ - \x12\x04\x80\x01\x04\x0c\n\r\n\x05\x04\x07\x02\0\x05\x12\x04\x80\x01\r\ - \x13\n\r\n\x05\x04\x07\x02\0\x01\x12\x04\x80\x01\x14\x18\n\r\n\x05\x04\ - \x07\x02\0\x03\x12\x04\x80\x01\x1b\x1e\n\x0c\n\x04\x04\x07\x02\x01\x12\ - \x04\x81\x01\x04#\n\r\n\x05\x04\x07\x02\x01\x04\x12\x04\x81\x01\x04\x0c\ - \n\r\n\x05\x04\x07\x02\x01\x05\x12\x04\x81\x01\r\x13\n\r\n\x05\x04\x07\ - \x02\x01\x01\x12\x04\x81\x01\x14\x1c\n\r\n\x05\x04\x07\x02\x01\x03\x12\ - \x04\x81\x01\x1f\"\ + \n\x0bspirc.proto\x12\0\"\xfd\x02\n\x05Frame\x12\x11\n\x07version\x18\ + \x01\x20\x01(\rB\0\x12\x0f\n\x05ident\x18\x02\x20\x01(\tB\0\x12\x1a\n\ + \x10protocol_version\x18\x03\x20\x01(\tB\0\x12\x10\n\x06seq_nr\x18\x04\ + \x20\x01(\rB\0\x12\x1b\n\x03typ\x18\x05\x20\x01(\x0e2\x0c.MessageTypeB\0\ + \x12$\n\x0cdevice_state\x18\x07\x20\x01(\x0b2\x0c.DeviceStateB\0\x12\x1b\ + \n\x07goodbye\x18\x0b\x20\x01(\x0b2\x08.GoodbyeB\0\x12\x17\n\x05state\ + \x18\x0c\x20\x01(\x0b2\x06.StateB\0\x12\x12\n\x08position\x18\r\x20\x01(\ + \rB\0\x12\x10\n\x06volume\x18\x0e\x20\x01(\rB\0\x12\x19\n\x0fstate_updat\ + e_id\x18\x11\x20\x01(\x03B\0\x12\x13\n\trecipient\x18\x12\x20\x03(\tB\0\ + \x12\x1e\n\x14context_player_state\x18\x13\x20\x01(\x0cB\0\x12\x12\n\x08\ + new_name\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x01(\ + \x0b2\t.MetadataB\0:\0\"\x9f\x02\n\x0bDeviceState\x12\x14\n\nsw_version\ + \x18\x01\x20\x01(\tB\0\x12\x13\n\tis_active\x18\n\x20\x01(\x08B\0\x12\ + \x12\n\x08can_play\x18\x0b\x20\x01(\x08B\0\x12\x10\n\x06volume\x18\x0c\ + \x20\x01(\rB\0\x12\x0e\n\x04name\x18\r\x20\x01(\tB\0\x12\x14\n\nerror_co\ + de\x18\x0e\x20\x01(\rB\0\x12\x1a\n\x10became_active_at\x18\x0f\x20\x01(\ + \x03B\0\x12\x17\n\rerror_message\x18\x10\x20\x01(\tB\0\x12#\n\x0ccapabil\ + ities\x18\x11\x20\x03(\x0b2\x0b.CapabilityB\0\x12\x1e\n\x14context_playe\ + r_error\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x03(\x0b\ + 2\t.MetadataB\0:\0\"Y\n\nCapability\x12\x1e\n\x03typ\x18\x01\x20\x01(\ + \x0e2\x0f.CapabilityTypeB\0\x12\x12\n\x08intValue\x18\x02\x20\x03(\x03B\ + \0\x12\x15\n\x0bstringValue\x18\x03\x20\x03(\tB\0:\0\"\x1d\n\x07Goodbye\ + \x12\x10\n\x06reason\x18\x01\x20\x01(\tB\0:\0\"\x85\x03\n\x05State\x12\ + \x15\n\x0bcontext_uri\x18\x02\x20\x01(\tB\0\x12\x0f\n\x05index\x18\x03\ + \x20\x01(\rB\0\x12\x15\n\x0bposition_ms\x18\x04\x20\x01(\rB\0\x12\x1d\n\ + \x06status\x18\x05\x20\x01(\x0e2\x0b.PlayStatusB\0\x12\x1e\n\x14position\ + _measured_at\x18\x07\x20\x01(\x04B\0\x12\x1d\n\x13context_description\ + \x18\x08\x20\x01(\tB\0\x12\x11\n\x07shuffle\x18\r\x20\x01(\x08B\0\x12\ + \x10\n\x06repeat\x18\x0e\x20\x01(\x08B\0\x12\x1c\n\x12last_command_ident\ + \x18\x14\x20\x01(\tB\0\x12\x1c\n\x12last_command_msgid\x18\x15\x20\x01(\ + \rB\0\x12\x1f\n\x15playing_from_fallback\x18\x18\x20\x01(\x08B\0\x12\r\n\ + \x03row\x18\x19\x20\x01(\rB\0\x12\x1d\n\x13playing_track_index\x18\x1a\ + \x20\x01(\rB\0\x12\x1a\n\x05track\x18\x1b\x20\x03(\x0b2\t.TrackRefB\0\ + \x12\x11\n\x02ad\x18\x1c\x20\x01(\x0b2\x03.AdB\0:\0\"O\n\x08TrackRef\x12\ + \r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\r\n\x03uri\x18\x02\x20\x01(\tB\0\ + \x12\x10\n\x06queued\x18\x03\x20\x01(\x08B\0\x12\x11\n\x07context\x18\ + \x04\x20\x01(\tB\0:\0\"\xb9\x01\n\x02Ad\x12\x0e\n\x04next\x18\x01\x20\ + \x01(\x05B\0\x12\x11\n\x07ogg_fid\x18\x02\x20\x01(\x0cB\0\x12\x13\n\tima\ + ge_fid\x18\x03\x20\x01(\x0cB\0\x12\x12\n\x08duration\x18\x04\x20\x01(\ + \x05B\0\x12\x13\n\tclick_url\x18\x05\x20\x01(\tB\0\x12\x18\n\x0eimpressi\ + on_url\x18\x06\x20\x01(\tB\0\x12\x11\n\x07product\x18\x07\x20\x01(\tB\0\ + \x12\x14\n\nadvertiser\x18\x08\x20\x01(\tB\0\x12\r\n\x03gid\x18\t\x20\ + \x01(\x0cB\0:\0\"0\n\x08Metadata\x12\x0e\n\x04type\x18\x01\x20\x01(\tB\0\ + \x12\x12\n\x08metadata\x18\x02\x20\x01(\tB\0:\0*\x8f\x04\n\x0bMessageTyp\ + e\x12\x15\n\x11kMessageTypeHello\x10\x01\x12\x17\n\x13kMessageTypeGoodby\ + e\x10\x02\x12\x15\n\x11kMessageTypeProbe\x10\x03\x12\x16\n\x12kMessageTy\ + peNotify\x10\n\x12\x14\n\x10kMessageTypeLoad\x10\x14\x12\x14\n\x10kMessa\ + geTypePlay\x10\x15\x12\x15\n\x11kMessageTypePause\x10\x16\x12\x19\n\x15k\ + MessageTypePlayPause\x10\x17\x12\x14\n\x10kMessageTypeSeek\x10\x18\x12\ + \x14\n\x10kMessageTypePrev\x10\x19\x12\x14\n\x10kMessageTypeNext\x10\x1a\ + \x12\x16\n\x12kMessageTypeVolume\x10\x1b\x12\x17\n\x13kMessageTypeShuffl\ + e\x10\x1c\x12\x16\n\x12kMessageTypeRepeat\x10\x1d\x12\x1a\n\x16kMessageT\ + ypeVolumeDown\x10\x1f\x12\x18\n\x14kMessageTypeVolumeUp\x10\x20\x12\x17\ + \n\x13kMessageTypeReplace\x10!\x12\x16\n\x12kMessageTypeLogout\x10\"\x12\ + \x16\n\x12kMessageTypeAction\x10#\x12\x16\n\x12kMessageTypeRename\x10$\ + \x12\x1f\n\x1akMessageTypeUpdateMetadata\x10\x80\x01\x1a\0*\xb4\x02\n\ + \x0eCapabilityType\x12\x16\n\x12kSupportedContexts\x10\x01\x12\x10\n\x0c\ + kCanBePlayer\x10\x02\x12\x14\n\x10kRestrictToLocal\x10\x03\x12\x0f\n\x0b\ + kDeviceType\x10\x04\x12\x14\n\x10kGaiaEqConnectId\x10\x05\x12\x13\n\x0fk\ + SupportsLogout\x10\x06\x12\x11\n\rkIsObservable\x10\x07\x12\x10\n\x0ckVo\ + lumeSteps\x10\x08\x12\x13\n\x0fkSupportedTypes\x10\t\x12\x10\n\x0ckComma\ + ndAcks\x10\n\x12\x13\n\x0fkSupportsRename\x10\x0b\x12\x0b\n\x07kHidden\ + \x10\x0c\x12\x17\n\x13kSupportsPlaylistV2\x10\r\x12\x1d\n\x19kSupportsEx\ + ternalEpisodes\x10\x0e\x1a\0*f\n\nPlayStatus\x12\x13\n\x0fkPlayStatusSto\ + p\x10\0\x12\x13\n\x0fkPlayStatusPlay\x10\x01\x12\x14\n\x10kPlayStatusPau\ + se\x10\x02\x12\x16\n\x12kPlayStatusLoading\x10\x03\x1a\0B\0b\x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..627f7c40 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,4 @@ +max_width = 105 +reorder_imports = true +reorder_imports_in_group = true +reorder_modules = true diff --git a/src/audio_backend/alsa.rs b/src/audio_backend/alsa.rs deleted file mode 100644 index ce459380..00000000 --- a/src/audio_backend/alsa.rs +++ /dev/null @@ -1,38 +0,0 @@ -use super::{Open, Sink}; -use std::io; -use alsa::{PCM, Stream, Mode, Format, Access}; - -pub struct AlsaSink(Option, String); - -impl Open for AlsaSink { - fn open(device: Option) -> AlsaSink { - info!("Using alsa sink"); - - let name = device.unwrap_or("default".to_string()); - - AlsaSink(None, name) - } -} - -impl Sink for AlsaSink { - fn start(&mut self) -> io::Result<()> { - if self.0.is_some() { - } else { - self.0 = Some(PCM::open(&*self.1, - Stream::Playback, Mode::Blocking, - Format::Signed16, Access::Interleaved, - 2, 44100).ok().unwrap()); - } - Ok(()) - } - - fn stop(&mut self) -> io::Result<()> { - self.0 = None; - Ok(()) - } - - fn write(&mut self, data: &[i16]) -> io::Result<()> { - self.0.as_mut().unwrap().write_interleaved(&data).unwrap(); - Ok(()) - } -} diff --git a/src/audio_backend/pulseaudio.rs b/src/audio_backend/pulseaudio.rs deleted file mode 100644 index 3b9a09b3..00000000 --- a/src/audio_backend/pulseaudio.rs +++ /dev/null @@ -1,67 +0,0 @@ -use super::{Open, Sink}; -use std::io; -use libpulse_sys::*; -use std::ptr::{null, null_mut}; -use std::mem::{transmute}; -use std::ffi::CString; - -pub struct PulseAudioSink(*mut pa_simple); - -impl Open for PulseAudioSink { - fn open(device: Option) -> PulseAudioSink { - debug!("Using PulseAudio sink"); - - if device.is_some() { - panic!("pulseaudio sink does not support specifying a device name"); - } - - let ss = pa_sample_spec { - format: PA_SAMPLE_S16LE, - channels: 2, // stereo - rate: 44100 - }; - - let name = CString::new("librespot").unwrap(); - let description = CString::new("A spoty client library").unwrap(); - - let s = unsafe { - pa_simple_new(null(), // Use the default server. - name.as_ptr(), // Our application's name. - PA_STREAM_PLAYBACK, - null(), // Use the default device. - description.as_ptr(), // Description of our stream. - &ss, // Our sample format. - null(), // Use default channel map - null(), // Use default buffering attributes. - null_mut(), // Ignore error code. - ) - }; - assert!(s != null_mut()); - - PulseAudioSink(s) - } -} - -impl Sink for PulseAudioSink { - fn start(&mut self) -> io::Result<()> { - Ok(()) - } - - fn stop(&mut self) -> io::Result<()> { - Ok(()) - } - - fn write(&mut self, data: &[i16]) -> io::Result<()> { - unsafe { - let ptr = transmute(data.as_ptr()); - let bytes = data.len() as usize * 2; - pa_simple_write(self.0, ptr, bytes, null_mut()); - }; - - Ok(()) - } -} - - - - diff --git a/src/discovery.rs b/src/discovery.rs deleted file mode 100644 index 3eaa5f0a..00000000 --- a/src/discovery.rs +++ /dev/null @@ -1,251 +0,0 @@ -use base64; -use crypto::digest::Digest; -use crypto::mac::Mac; -use crypto; -use futures::sync::mpsc; -use futures::{Future, Stream, BoxFuture, Poll, Async}; -use hyper::server::{Service, NewService, Request, Response, Http}; -use hyper::{self, Get, Post, StatusCode}; -use mdns; -use num_bigint::BigUint; -use rand; -use std::collections::BTreeMap; -use std::io; -use std::sync::Arc; -use tokio_core::net::TcpListener; -use tokio_core::reactor::Handle; -use url; - -use core::diffie_hellman::{DH_GENERATOR, DH_PRIME}; -use core::authentication::Credentials; -use core::util; -use core::config::ConnectConfig; - -#[derive(Clone)] -struct Discovery(Arc); -struct DiscoveryInner { - config: ConnectConfig, - device_id: String, - private_key: BigUint, - public_key: BigUint, - tx: mpsc::UnboundedSender, -} - -impl Discovery { - pub fn new(config: ConnectConfig, device_id: String) - -> (Discovery, mpsc::UnboundedReceiver) - { - let (tx, rx) = mpsc::unbounded(); - - let key_data = util::rand_vec(&mut rand::thread_rng(), 95); - let private_key = BigUint::from_bytes_be(&key_data); - let public_key = util::powm(&DH_GENERATOR, &private_key, &DH_PRIME); - - let discovery = Discovery(Arc::new(DiscoveryInner { - config: config, - device_id: device_id, - private_key: private_key, - public_key: public_key, - tx: tx, - })); - - (discovery, rx) - } -} - -impl Discovery { - fn handle_get_info(&self, _params: &BTreeMap) - -> ::futures::Finished - { - let public_key = self.0.public_key.to_bytes_be(); - let public_key = base64::encode(&public_key); - - let result = json!({ - "status": 101, - "statusString": "ERROR-OK", - "spotifyError": 0, - "version": "2.1.0", - "deviceID": (self.0.device_id), - "remoteName": (self.0.config.name), - "activeUser": "", - "publicKey": (public_key), - "deviceType": (self.0.config.device_type.to_string().to_uppercase()), - "libraryVersion": "0.1.0", - "accountReq": "PREMIUM", - "brandDisplayName": "librespot", - "modelDisplayName": "librespot", - }); - - let body = result.to_string(); - ::futures::finished(Response::new().with_body(body)) - } - - fn handle_add_user(&self, params: &BTreeMap) - -> ::futures::Finished - { - let username = params.get("userName").unwrap(); - let encrypted_blob = params.get("blob").unwrap(); - let client_key = params.get("clientKey").unwrap(); - - let encrypted_blob = base64::decode(encrypted_blob).unwrap(); - - let client_key = base64::decode(client_key).unwrap(); - let client_key = BigUint::from_bytes_be(&client_key); - - let shared_key = util::powm(&client_key, &self.0.private_key, &DH_PRIME); - - let iv = &encrypted_blob[0..16]; - let encrypted = &encrypted_blob[16..encrypted_blob.len() - 20]; - let cksum = &encrypted_blob[encrypted_blob.len() - 20..encrypted_blob.len()]; - - let base_key = { - let mut data = [0u8; 20]; - let mut h = crypto::sha1::Sha1::new(); - h.input(&shared_key.to_bytes_be()); - h.result(&mut data); - data[..16].to_owned() - }; - - let checksum_key = { - let mut h = crypto::hmac::Hmac::new(crypto::sha1::Sha1::new(), &base_key); - h.input(b"checksum"); - h.result().code().to_owned() - }; - - let encryption_key = { - let mut h = crypto::hmac::Hmac::new(crypto::sha1::Sha1::new(), &base_key); - h.input(b"encryption"); - h.result().code().to_owned() - }; - - let mac = { - let mut h = crypto::hmac::Hmac::new(crypto::sha1::Sha1::new(), &checksum_key); - h.input(encrypted); - h.result().code().to_owned() - }; - - assert_eq!(&mac[..], cksum); - - let decrypted = { - let mut data = vec![0u8; encrypted.len()]; - let mut cipher = crypto::aes::ctr(crypto::aes::KeySize::KeySize128, - &encryption_key[0..16], iv); - cipher.process(encrypted, &mut data); - String::from_utf8(data).unwrap() - }; - - let credentials = Credentials::with_blob(username.to_owned(), &decrypted, &self.0.device_id); - - self.0.tx.send(credentials).unwrap(); - - let result = json!({ - "status": 101, - "spotifyError": 0, - "statusString": "ERROR-OK" - }); - - let body = result.to_string(); - ::futures::finished(Response::new().with_body(body)) - } - - fn not_found(&self) - -> ::futures::Finished - { - ::futures::finished(Response::new().with_status(StatusCode::NotFound)) - } -} - -impl Service for Discovery { - type Request = Request; - type Response = Response; - type Error = hyper::Error; - type Future = BoxFuture; - - fn call(&self, request: Request) -> Self::Future { - let mut params = BTreeMap::new(); - - let (method, uri, _, _, body) = request.deconstruct(); - if let Some(query) = uri.query() { - params.extend(url::form_urlencoded::parse(query.as_bytes()).into_owned()); - } - - if method != Get { - debug!("{:?} {:?} {:?}", method, uri.path(), params); - } - - let this = self.clone(); - body.fold(Vec::new(), |mut acc, chunk| { - acc.extend_from_slice(chunk.as_ref()); - Ok::<_, hyper::Error>(acc) - }).map(move |body| { - params.extend(url::form_urlencoded::parse(&body).into_owned()); - params - }).and_then(move |params| { - match (method, params.get("action").map(AsRef::as_ref)) { - (Get, Some("getInfo")) => this.handle_get_info(¶ms), - (Post, Some("addUser")) => this.handle_add_user(¶ms), - _ => this.not_found(), - } - }).boxed() - } -} - -impl NewService for Discovery { - type Request = Request; - type Response = Response; - type Error = hyper::Error; - type Instance = Self; - - fn new_service(&self) -> io::Result { - Ok(self.clone()) - } -} - -pub struct DiscoveryStream { - credentials: mpsc::UnboundedReceiver, - _svc: mdns::Service, - task: Box>, -} - -pub fn discovery(handle: &Handle, config: ConnectConfig, device_id: String) - -> io::Result -{ - let (discovery, creds_rx) = Discovery::new(config.clone(), device_id); - - let listener = TcpListener::bind(&"0.0.0.0:0".parse().unwrap(), handle)?; - let addr = listener.local_addr()?; - - let http = Http::new(); - let handle_ = handle.clone(); - let task = Box::new(listener.incoming().for_each(move |(socket, addr)| { - http.bind_connection(&handle_, socket, addr, discovery.clone()); - Ok(()) - })); - - let responder = mdns::Responder::spawn(&handle)?; - let svc = responder.register( - "_spotify-connect._tcp".to_owned(), - config.name, - addr.port(), - &["VERSION=1.0", "CPath=/"]); - - Ok(DiscoveryStream { - credentials: creds_rx, - _svc: svc, - task: task, - }) -} - -impl Stream for DiscoveryStream { - type Item = Credentials; - type Error = io::Error; - - fn poll(&mut self) -> Poll, Self::Error> { - match self.task.poll()? { - Async::Ready(()) => unreachable!(), - Async::NotReady => (), - } - - Ok(self.credentials.poll().unwrap()) - } -} diff --git a/src/keymaster.rs b/src/keymaster.rs deleted file mode 100644 index 6ed11fd7..00000000 --- a/src/keymaster.rs +++ /dev/null @@ -1,26 +0,0 @@ -use futures::{Future, BoxFuture}; -use serde_json; - -use core::mercury::MercuryError; -use core::session::Session; - -#[derive(Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Token { - pub access_token: String, - pub expires_in: u32, - pub token_type: String, - pub scope: Vec, -} - -pub fn get_token(session: &Session, client_id: &str, scopes: &str) -> BoxFuture { - let url = format!("hm://keymaster/token/authenticated?client_id={}&scope={}", - client_id, scopes); - session.mercury().get(url).map(move |response| { - let data = response.payload.first().expect("Empty payload"); - let data = String::from_utf8(data.clone()).unwrap(); - let token : Token = serde_json::from_str(&data).unwrap(); - - token - }).boxed() -} diff --git a/src/lib.in.rs b/src/lib.in.rs deleted file mode 100644 index be92c5d8..00000000 --- a/src/lib.in.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod spirc; diff --git a/src/lib.rs b/src/lib.rs index b9c920ec..f73db1ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,9 @@ #![crate_name = "librespot"] - #![cfg_attr(feature = "cargo-clippy", allow(unused_io_amount))] -// TODO: many items from tokio-core::io have been deprecated in favour of tokio-io -#![allow(deprecated)] - -#[macro_use] extern crate log; -#[macro_use] extern crate serde_json; -#[macro_use] extern crate serde_derive; - extern crate base64; -extern crate crypto; extern crate futures; extern crate hyper; -extern crate mdns; extern crate num_bigint; extern crate protobuf; extern crate rand; @@ -21,23 +11,8 @@ extern crate tokio_core; extern crate url; pub extern crate librespot_audio as audio; +pub extern crate librespot_connect as connect; pub extern crate librespot_core as core; -pub extern crate librespot_protocol as protocol; pub extern crate librespot_metadata as metadata; - -#[cfg(feature = "alsa-backend")] -extern crate alsa; - -#[cfg(feature = "portaudio-rs")] -extern crate portaudio_rs; - -#[cfg(feature = "libpulse-sys")] -extern crate libpulse_sys; - -pub mod audio_backend; -pub mod discovery; -pub mod keymaster; -pub mod mixer; -pub mod player; - -include!(concat!(env!("OUT_DIR"), "/lib.rs")); +pub extern crate librespot_playback as playback; +pub extern crate librespot_protocol as protocol; diff --git a/src/main.rs b/src/main.rs index c2850cdf..796746d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,36 +1,45 @@ -// TODO: many items from tokio-core::io have been deprecated in favour of tokio-io -#![allow(deprecated)] - -#[macro_use] extern crate log; extern crate env_logger; extern crate futures; extern crate getopts; extern crate librespot; +#[macro_use] +extern crate log; extern crate tokio_core; -extern crate tokio_signal; - -use env_logger::LogBuilder; -use futures::{Future, Async, Poll, Stream}; +extern crate tokio_process; +extern crate url; +extern crate sha1; +extern crate hex; + +use sha1::{Sha1, Digest}; +use futures::sync::mpsc::UnboundedReceiver; +use futures::{Async, Future, Poll, Stream}; use std::env; use std::io::{self, stderr, Write}; +use std::mem; use std::path::PathBuf; use std::process::exit; use std::str::FromStr; -use tokio_core::reactor::{Handle, Core}; -use tokio_core::io::IoStream; -use std::mem; +use tokio_core::reactor::{Core, Handle}; +use url::Url; use librespot::core::authentication::{get_credentials, Credentials}; use librespot::core::cache::Cache; -use librespot::core::config::{Bitrate, DeviceType, PlayerConfig, SessionConfig, ConnectConfig}; +use librespot::core::config::{ConnectConfig, DeviceType, SessionConfig}; use librespot::core::session::Session; use librespot::core::version; -use librespot::audio_backend::{self, Sink, BACKENDS}; -use librespot::discovery::{discovery, DiscoveryStream}; -use librespot::mixer::{self, Mixer}; -use librespot::player::Player; -use librespot::spirc::{Spirc, SpircTask}; +use librespot::connect::spirc::{Spirc, SpircTask}; +use librespot::playback::audio_backend::{self, Sink, BACKENDS}; +use librespot::playback::config::{Bitrate, PlayerConfig}; +use librespot::playback::mixer::{self, Mixer, MixerConfig}; +use librespot::playback::player::{Player, PlayerEvent}; + +mod player_event_handler; +use player_event_handler::run_program_on_events; + +fn device_id(name: &str) -> String { + hex::encode(Sha1::digest(name.as_bytes())) +} fn usage(program: &str, opts: &getopts::Options) -> String { let brief = format!("Usage: {} [options]", program); @@ -38,11 +47,11 @@ fn usage(program: &str, opts: &getopts::Options) -> String { } fn setup_logging(verbose: bool) { - let mut builder = LogBuilder::new(); + let mut builder = env_logger::Builder::new(); match env::var("RUST_LOG") { Ok(config) => { - builder.parse(&config); - builder.init().unwrap(); + builder.parse_filters(&config); + builder.init(); if verbose { warn!("`--verbose` flag overidden by `RUST_LOG` environment variable"); @@ -50,11 +59,11 @@ fn setup_logging(verbose: bool) { } Err(_) => { if verbose { - builder.parse("mdns=info,librespot=trace"); + builder.parse_filters("mdns=info,librespot=trace"); } else { - builder.parse("mdns=info,librespot=info"); + builder.parse_filters("mdns=info,librespot=info"); } - builder.init().unwrap(); + builder.init(); } } } @@ -75,32 +84,104 @@ struct Setup { backend: fn(Option) -> Box, device: Option, - mixer: fn() -> Box, + mixer: fn(Option) -> Box, cache: Option, player_config: PlayerConfig, session_config: SessionConfig, connect_config: ConnectConfig, + mixer_config: MixerConfig, credentials: Option, - enable_discovery: bool, + zeroconf_port: u16, + player_event_program: Option, } fn setup(args: &[String]) -> Setup { let mut opts = getopts::Options::new(); - opts.optopt("c", "cache", "Path to a directory where files will be cached.", "CACHE") - .optflag("", "disable-audio-cache", "Disable caching of the audio data.") + opts.optopt( + "c", + "cache", + "Path to a directory where files will be cached.", + "CACHE", + ).optflag("", "disable-audio-cache", "Disable caching of the audio data.") .reqopt("n", "name", "Device name", "NAME") .optopt("", "device-type", "Displayed device type", "DEVICE_TYPE") - .optopt("b", "bitrate", "Bitrate (96, 160 or 320). Defaults to 160", "BITRATE") - .optopt("", "onstart", "Run PROGRAM when playback is about to begin.", "PROGRAM") - .optopt("", "onstop", "Run PROGRAM when playback has ended.", "PROGRAM") + .optopt( + "b", + "bitrate", + "Bitrate (96, 160 or 320). Defaults to 160", + "BITRATE", + ) + .optopt( + "", + "onevent", + "Run PROGRAM when playback is about to begin.", + "PROGRAM", + ) .optflag("v", "verbose", "Enable verbose output") .optopt("u", "username", "Username to sign in with", "USERNAME") .optopt("p", "password", "Password", "PASSWORD") - .optflag("", "disable-discovery", "Disable discovery mode") - .optopt("", "backend", "Audio backend to use. Use '?' to list options", "BACKEND") - .optopt("", "device", "Audio device to use. Use '?' to list options", "DEVICE") - .optopt("", "mixer", "Mixer to use", "MIXER"); + .optopt("", "proxy", "HTTP proxy to use when connecting", "PROXY") + .optopt("", "ap-port", "Connect to AP with specified port. If no AP with that port are present fallback AP will be used. Available ports are usually 80, 443 and 4070", "AP_PORT") + .optopt( + "", + "backend", + "Audio backend to use. Use '?' to list options", + "BACKEND", + ) + .optopt( + "", + "device", + "Audio device to use. Use '?' to list options if using portaudio or alsa", + "DEVICE", + ) + .optopt("", "mixer", "Mixer to use (alsa or softmixer)", "MIXER") + .optopt( + "m", + "mixer-name", + "Alsa mixer name, e.g \"PCM\" or \"Master\". Defaults to 'PCM'", + "MIXER_NAME", + ) + .optopt( + "", + "mixer-card", + "Alsa mixer card, e.g \"hw:0\" or similar from `aplay -l`. Defaults to 'default' ", + "MIXER_CARD", + ) + .optopt( + "", + "mixer-index", + "Alsa mixer index, Index of the cards mixer. Defaults to 0", + "MIXER_INDEX", + ) + .optopt( + "", + "initial-volume", + "Initial volume in %, once connected (must be from 0 to 100)", + "VOLUME", + ) + .optopt( + "", + "zeroconf-port", + "The port the internal server advertised over zeroconf uses.", + "ZEROCONF_PORT", + ) + .optflag( + "", + "enable-volume-normalisation", + "Play all tracks at the same volume", + ) + .optopt( + "", + "normalisation-pregain", + "Pregain (dB) applied by volume normalisation", + "PREGAIN", + ) + .optflag( + "", + "linear-volume", + "increase volume linear instead of logarithmic.", + ); let matches = match opts.parse(&args[1..]) { Ok(m) => m, @@ -113,11 +194,13 @@ fn setup(args: &[String]) -> Setup { let verbose = matches.opt_present("verbose"); setup_logging(verbose); - info!("librespot {} ({}). Built on {}. Build ID: {}", - version::short_sha(), - version::commit_date(), - version::short_now(), - version::build_id()); + info!( + "librespot {} ({}). Built on {}. Build ID: {}", + version::short_sha(), + version::commit_date(), + version::short_now(), + version::build_id() + ); let backend_name = matches.opt_str("backend"); if backend_name == Some("?".into()) { @@ -125,21 +208,49 @@ fn setup(args: &[String]) -> Setup { exit(0); } - let backend = audio_backend::find(backend_name) - .expect("Invalid backend"); + let backend = audio_backend::find(backend_name).expect("Invalid backend"); let device = matches.opt_str("device"); + if device == Some("?".into()) { + backend(device); + exit(0); + } let mixer_name = matches.opt_str("mixer"); - let mixer = mixer::find(mixer_name.as_ref()) - .expect("Invalid mixer"); + let mixer = mixer::find(mixer_name.as_ref()).expect("Invalid mixer"); + + let mixer_config = MixerConfig { + card: matches.opt_str("mixer-card").unwrap_or(String::from("default")), + mixer: matches.opt_str("mixer-name").unwrap_or(String::from("PCM")), + index: matches + .opt_str("mixer-index") + .map(|index| index.parse::().unwrap()) + .unwrap_or(0), + }; - let name = matches.opt_str("name").unwrap(); let use_audio_cache = !matches.opt_present("disable-audio-cache"); - let cache = matches.opt_str("c").map(|cache_location| { - Cache::new(PathBuf::from(cache_location), use_audio_cache) - }); + let cache = matches + .opt_str("c") + .map(|cache_location| Cache::new(PathBuf::from(cache_location), use_audio_cache)); + + let initial_volume = matches + .opt_str("initial-volume") + .map(|volume| { + let volume = volume.parse::().unwrap(); + if volume > 100 { + panic!("Initial volume must be in the range 0-100"); + } + (volume as i32 * 0xFFFF / 100) as u16 + }).or_else(|| cache.as_ref().and_then(Cache::volume)) + .unwrap_or(0x8000); + + let zeroconf_port = matches + .opt_str("zeroconf-port") + .map(|port| port.parse::().unwrap()) + .unwrap_or(0); + + let name = matches.opt_str("name").unwrap(); let credentials = { let cached_credentials = cache.as_ref().and_then(Cache::credentials); @@ -147,44 +258,71 @@ fn setup(args: &[String]) -> Setup { get_credentials( matches.opt_str("username"), matches.opt_str("password"), - cached_credentials + cached_credentials, ) }; let session_config = { - let device_id = librespot::core::session::device_id(&name); + let device_id = device_id(&name); SessionConfig { user_agent: version::version_string(), device_id: device_id, + proxy: matches.opt_str("proxy").or(std::env::var("http_proxy").ok()).map( + |s| { + match Url::parse(&s) { + Ok(url) => { + if url.host().is_none() || url.port().is_none() { + panic!("Invalid proxy url, only urls on the format \"http://host:port\" are allowed"); + } + + if url.scheme() != "http" { + panic!("Only unsecure http:// proxies are supported"); + } + url + }, + Err(err) => panic!("Invalid proxy url: {}, only urls on the format \"http://host:port\" are allowed", err) + } + }, + ), + ap_port: matches + .opt_str("ap-port") + .map(|port| port.parse::().expect("Invalid port")), } }; let player_config = { - let bitrate = matches.opt_str("b").as_ref() + let bitrate = matches + .opt_str("b") + .as_ref() .map(|bitrate| Bitrate::from_str(bitrate).expect("Invalid bitrate")) .unwrap_or(Bitrate::default()); PlayerConfig { bitrate: bitrate, - onstart: matches.opt_str("onstart"), - onstop: matches.opt_str("onstop"), + normalisation: matches.opt_present("enable-volume-normalisation"), + normalisation_pregain: matches + .opt_str("normalisation-pregain") + .map(|pregain| pregain.parse::().expect("Invalid pregain float value")) + .unwrap_or(PlayerConfig::default().normalisation_pregain), } }; let connect_config = { - let device_type = matches.opt_str("device-type").as_ref() + let device_type = matches + .opt_str("device-type") + .as_ref() .map(|device_type| DeviceType::from_str(device_type).expect("Invalid device type")) .unwrap_or(DeviceType::default()); ConnectConfig { name: name, device_type: device_type, + volume: initial_volume, + linear_volume: matches.opt_present("linear-volume"), } }; - let enable_discovery = !matches.opt_present("disable-discovery"); - Setup { backend: backend, cache: cache, @@ -193,8 +331,10 @@ fn setup(args: &[String]) -> Setup { connect_config: connect_config, credentials: credentials, device: device, - enable_discovery: enable_discovery, + zeroconf_port: zeroconf_port, mixer: mixer, + mixer_config: mixer_config, + player_event_program: matches.opt_str("onevent"), } } @@ -205,17 +345,18 @@ struct Main { connect_config: ConnectConfig, backend: fn(Option) -> Box, device: Option, - mixer: fn() -> Box, + mixer: fn(Option) -> Box, + mixer_config: MixerConfig, handle: Handle, - discovery: Option, - signal: IoStream<()>, - spirc: Option, spirc_task: Option, - connect: Box>, + connect: Box>, shutdown: bool, + + player_event_channel: Option>, + player_event_program: Option, } impl Main { @@ -229,21 +370,16 @@ impl Main { backend: setup.backend, device: setup.device, mixer: setup.mixer, + mixer_config: setup.mixer_config, connect: Box::new(futures::future::empty()), - discovery: None, spirc: None, spirc_task: None, shutdown: false, - signal: tokio_signal::ctrl_c(&handle).flatten_stream().boxed(), - }; - if setup.enable_discovery { - let config = task.connect_config.clone(); - let device_id = task.session_config.device_id.clone(); - - task.discovery = Some(discovery(&handle, config, device_id).unwrap()); - } + player_event_channel: None, + player_event_program: setup.player_event_program, + }; if let Some(credentials) = setup.credentials { task.credentials(credentials); @@ -275,48 +411,41 @@ impl Future for Main { loop { let mut progress = false; - if let Some(Async::Ready(Some(creds))) = self.discovery.as_mut().map(|d| d.poll().unwrap()) { - if let Some(ref spirc) = self.spirc { - spirc.shutdown(); - } - self.credentials(creds); +// if let Some(Async::Ready(Some(creds))) = self.discovery.as_mut().map(|d| d.poll().unwrap()) { +// if let Some(ref spirc) = self.spirc { +// spirc.shutdown(); +// } +// self.credentials(creds); - progress = true; - } +// progress = true; +// } if let Async::Ready(session) = self.connect.poll().unwrap() { self.connect = Box::new(futures::future::empty()); - let device = self.device.clone(); - let mixer = (self.mixer)(); + let mixer_config = self.mixer_config.clone(); + let mixer = (self.mixer)(Some(mixer_config)); let player_config = self.player_config.clone(); let connect_config = self.connect_config.clone(); let audio_filter = mixer.get_audio_filter(); let backend = self.backend; - let player = Player::new(player_config, session.clone(), audio_filter, move || { - (backend)(device) - }); + let device = self.device.clone(); + let (player, event_channel) = + Player::new(player_config, session.clone(), audio_filter, move || { + (backend)(device) + }); let (spirc, spirc_task) = Spirc::new(connect_config, session, player, mixer); self.spirc = Some(spirc); self.spirc_task = Some(spirc_task); + self.player_event_channel = Some(event_channel); progress = true; } - if let Async::Ready(Some(())) = self.signal.poll().unwrap() { - if !self.shutdown { - if let Some(ref spirc) = self.spirc { - spirc.shutdown(); - } - self.shutdown = true; - } else { - return Ok(Async::Ready(())); - } - - progress = true; - } - + trace!("Ctrl-C received"); + } else { + return Ok(Async::Ready(())); if let Some(ref mut spirc_task) = self.spirc_task { if let Async::Ready(()) = spirc_task.poll().unwrap() { if self.shutdown { @@ -327,6 +456,22 @@ impl Future for Main { } } + if let Some(ref mut player_event_channel) = self.player_event_channel { + if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() { + if let Some(ref program) = self.player_event_program { + let child = run_program_on_events(event, program) + .expect("program failed to start") + .map(|status| if !status.success() { + error!("child exited with status {:?}", status.code()); + }) + .map_err(|e| error!("failed to wait on child process: {}", e)); + + self.handle.spawn(child); + + } + } + } + if !progress { return Ok(Async::NotReady); } @@ -335,6 +480,9 @@ impl Future for Main { } fn main() { + if env::var("RUST_BACKTRACE").is_err() { + env::set_var("RUST_BACKTRACE", "full") + } let mut core = Core::new().unwrap(); let handle = core.handle(); @@ -342,4 +490,3 @@ fn main() { core.run(Main::new(handle, setup(&args))).unwrap() } - diff --git a/src/mixer/mod.rs b/src/mixer/mod.rs deleted file mode 100644 index a33f5e54..00000000 --- a/src/mixer/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -pub trait Mixer : Send { - fn open() -> Self where Self: Sized; - fn start(&self); - fn stop(&self); - fn set_volume(&self, volume: u16); - fn volume(&self) -> u16; - fn get_audio_filter(&self) -> Option> { - None - } -} - -pub trait AudioFilter { - fn modify_stream(&self, data: &mut [i16]); -} - -pub mod softmixer; -use self::softmixer::SoftMixer; - -fn mk_sink() -> Box { - Box::new(M::open()) -} - -pub fn find>(name: Option) -> Option Box> { - match name.as_ref().map(AsRef::as_ref) { - None | Some("softvol") => Some(mk_sink::), - _ => None, - } -} diff --git a/src/player.rs b/src/player.rs deleted file mode 100644 index 29380e33..00000000 --- a/src/player.rs +++ /dev/null @@ -1,423 +0,0 @@ -use futures::sync::oneshot; -use futures::{future, Future}; -use std::borrow::Cow; -use std::mem; -use std::sync::mpsc::{RecvError, TryRecvError}; -use std::thread; -use std; - -use core::config::{Bitrate, PlayerConfig}; -use core::session::Session; -use core::util::{self, SpotifyId, Subfile}; - -use audio_backend::Sink; -use audio::{AudioFile, AudioDecrypt}; -use audio::{VorbisDecoder, VorbisPacket}; -use metadata::{FileFormat, Track, Metadata}; -use mixer::AudioFilter; - -#[derive(Clone)] -pub struct Player { - commands: std::sync::mpsc::Sender, -} - -struct PlayerInternal { - session: Session, - config: PlayerConfig, - commands: std::sync::mpsc::Receiver, - - state: PlayerState, - sink: Box, - audio_filter: Option>, -} - -enum PlayerCommand { - Load(SpotifyId, bool, u32, oneshot::Sender<()>), - Play, - Pause, - Stop, - Seek(u32), -} - -impl Player { - pub fn new(config: PlayerConfig, session: Session, - audio_filter: Option>, - sink_builder: F) -> Player - where F: FnOnce() -> Box + Send + 'static - { - let (cmd_tx, cmd_rx) = std::sync::mpsc::channel(); - - thread::spawn(move || { - debug!("new Player[{}]", session.session_id()); - - let internal = PlayerInternal { - session: session, - config: config, - commands: cmd_rx, - - state: PlayerState::Stopped, - sink: sink_builder(), - audio_filter: audio_filter, - }; - - internal.run(); - }); - - Player { - commands: cmd_tx, - } - } - - fn command(&self, cmd: PlayerCommand) { - self.commands.send(cmd).unwrap(); - } - - pub fn load(&self, track: SpotifyId, start_playing: bool, position_ms: u32) - -> oneshot::Receiver<()> - { - let (tx, rx) = oneshot::channel(); - self.command(PlayerCommand::Load(track, start_playing, position_ms, tx)); - - rx - } - - pub fn play(&self) { - self.command(PlayerCommand::Play) - } - - pub fn pause(&self) { - self.command(PlayerCommand::Pause) - } - - pub fn stop(&self) { - self.command(PlayerCommand::Stop) - } - - pub fn seek(&self, position_ms: u32) { - self.command(PlayerCommand::Seek(position_ms)); - } -} - -type Decoder = VorbisDecoder>>; -enum PlayerState { - Stopped, - Paused { - decoder: Decoder, - end_of_track: oneshot::Sender<()>, - }, - Playing { - decoder: Decoder, - end_of_track: oneshot::Sender<()>, - }, - - Invalid, -} - -impl PlayerState { - fn is_playing(&self) -> bool { - use self::PlayerState::*; - match *self { - Stopped | Paused { .. } => false, - Playing { .. } => true, - Invalid => panic!("invalid state"), - } - } - - fn decoder(&mut self) -> Option<&mut Decoder> { - use self::PlayerState::*; - match *self { - Stopped => None, - Paused { ref mut decoder, .. } | - Playing { ref mut decoder, .. } => Some(decoder), - Invalid => panic!("invalid state"), - } - } - - fn signal_end_of_track(self) { - use self::PlayerState::*; - match self { - Paused { end_of_track, .. } | - Playing { end_of_track, .. } => { - end_of_track.complete(()) - } - - Stopped => warn!("signal_end_of_track from stopped state"), - Invalid => panic!("invalid state"), - } - } - - fn paused_to_playing(&mut self) { - use self::PlayerState::*; - match ::std::mem::replace(self, Invalid) { - Paused { decoder, end_of_track } => { - *self = Playing { - decoder: decoder, - end_of_track: end_of_track, - }; - } - _ => panic!("invalid state"), - } - } - - fn playing_to_paused(&mut self) { - use self::PlayerState::*; - match ::std::mem::replace(self, Invalid) { - Playing { decoder, end_of_track } => { - *self = Paused { - decoder: decoder, - end_of_track: end_of_track, - }; - } - _ => panic!("invalid state"), - } - } -} - -impl PlayerInternal { - fn run(mut self) { - loop { - let cmd = if self.state.is_playing() { - match self.commands.try_recv() { - Ok(cmd) => Some(cmd), - Err(TryRecvError::Empty) => None, - Err(TryRecvError::Disconnected) => return, - } - } else { - match self.commands.recv() { - Ok(cmd) => Some(cmd), - Err(RecvError) => return, - } - }; - - if let Some(cmd) = cmd { - self.handle_command(cmd); - } - - let packet = if let PlayerState::Playing { ref mut decoder, .. } = self.state { - Some(decoder.next_packet().expect("Vorbis error")) - } else { None }; - - if let Some(packet) = packet { - self.handle_packet(packet); - } - } - } - - fn handle_packet(&mut self, packet: Option) { - match packet { - Some(mut packet) => { - if let Some(ref editor) = self.audio_filter { - editor.modify_stream(&mut packet.data_mut()) - }; - - self.sink.write(&packet.data()).unwrap(); - } - - None => { - self.sink.stop().unwrap(); - self.run_onstop(); - - let old_state = mem::replace(&mut self.state, PlayerState::Stopped); - old_state.signal_end_of_track(); - } - } - } - - fn handle_command(&mut self, cmd: PlayerCommand) { - debug!("command={:?}", cmd); - match cmd { - PlayerCommand::Load(track_id, play, position, end_of_track) => { - if self.state.is_playing() { - self.sink.stop().unwrap(); - } - - match self.load_track(track_id, position as i64) { - Some(decoder) => { - if play { - if !self.state.is_playing() { - self.run_onstart(); - } - self.sink.start().unwrap(); - - self.state = PlayerState::Playing { - decoder: decoder, - end_of_track: end_of_track, - }; - } else { - if self.state.is_playing() { - self.run_onstop(); - } - - self.state = PlayerState::Paused { - decoder: decoder, - end_of_track: end_of_track, - }; - } - } - - None => { - end_of_track.complete(()); - if self.state.is_playing() { - self.run_onstop(); - } - } - } - } - - PlayerCommand::Seek(position) => { - if let Some(decoder) = self.state.decoder() { - match decoder.seek(position as i64) { - Ok(_) => (), - Err(err) => error!("Vorbis error: {:?}", err), - } - } else { - warn!("Player::seek called from invalid state"); - } - } - - PlayerCommand::Play => { - if let PlayerState::Paused { .. } = self.state { - self.state.paused_to_playing(); - - self.run_onstart(); - self.sink.start().unwrap(); - } else { - warn!("Player::play called from invalid state"); - } - } - - PlayerCommand::Pause => { - if let PlayerState::Playing { .. } = self.state { - self.state.playing_to_paused(); - - self.sink.stop().unwrap(); - self.run_onstop(); - } else { - warn!("Player::pause called from invalid state"); - } - } - - PlayerCommand::Stop => { - match self.state { - PlayerState::Playing { .. } => { - self.sink.stop().unwrap(); - self.run_onstop(); - self.state = PlayerState::Stopped; - } - PlayerState::Paused { .. } => { - self.state = PlayerState::Stopped; - }, - PlayerState::Stopped => { - warn!("Player::stop called from invalid state"); - } - PlayerState::Invalid => panic!("invalid state"), - } - } - } - } - - fn run_onstart(&self) { - if let Some(ref program) = self.config.onstart { - util::run_program(program) - } - } - - fn run_onstop(&self) { - if let Some(ref program) = self.config.onstop { - util::run_program(program) - } - } - - fn find_available_alternative<'a>(&self, track: &'a Track) -> Option> { - if track.available { - Some(Cow::Borrowed(track)) - } else { - let alternatives = track.alternatives - .iter() - .map(|alt_id| { - Track::get(&self.session, *alt_id) - }); - let alternatives = future::join_all(alternatives).wait().unwrap(); - - alternatives.into_iter().find(|alt| alt.available).map(Cow::Owned) - } - } - - fn load_track(&self, track_id: SpotifyId, position: i64) -> Option { - let track = Track::get(&self.session, track_id).wait().unwrap(); - - info!("Loading track \"{}\"", track.name); - - let track = match self.find_available_alternative(&track) { - Some(track) => track, - None => { - warn!("Track \"{}\" is not available", track.name); - return None; - } - }; - - let format = match self.config.bitrate { - Bitrate::Bitrate96 => FileFormat::OGG_VORBIS_96, - Bitrate::Bitrate160 => FileFormat::OGG_VORBIS_160, - Bitrate::Bitrate320 => FileFormat::OGG_VORBIS_320, - }; - - let file_id = match track.files.get(&format) { - Some(&file_id) => file_id, - None => { - warn!("Track \"{}\" is not available in format {:?}", track.name, format); - return None; - } - }; - - let key = self.session.audio_key().request(track.id, file_id).wait().unwrap(); - - let encrypted_file = AudioFile::open(&self.session, file_id).wait().unwrap(); - let audio_file = Subfile::new(AudioDecrypt::new(key, encrypted_file), 0xa7); - - let mut decoder = VorbisDecoder::new(audio_file).unwrap(); - - match decoder.seek(position) { - Ok(_) => (), - Err(err) => error!("Vorbis error: {:?}", err), - } - - info!("Track \"{}\" loaded", track.name); - - Some(decoder) - } -} - -impl Drop for PlayerInternal { - fn drop(&mut self) { - debug!("drop Player[{}]", self.session.session_id()); - } -} - -impl ::std::fmt::Debug for PlayerCommand { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - match *self { - PlayerCommand::Load(track, play, position, _) => { - f.debug_tuple("Load") - .field(&track) - .field(&play) - .field(&position) - .finish() - } - PlayerCommand::Play => { - f.debug_tuple("Play").finish() - } - PlayerCommand::Pause => { - f.debug_tuple("Pause").finish() - } - PlayerCommand::Stop => { - f.debug_tuple("Stop").finish() - } - PlayerCommand::Seek(position) => { - f.debug_tuple("Seek") - .field(&position) - .finish() - } - } - } -} diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs new file mode 100644 index 00000000..1e682b98 --- /dev/null +++ b/src/player_event_handler.rs @@ -0,0 +1,37 @@ +use librespot::playback::player::PlayerEvent; +use tokio_process::{Child, CommandExt}; +use std::collections::HashMap; +use std::io; +use std::process::Command; + +fn run_program(program: &str, env_vars: HashMap<&str, String>) -> io::Result { + let mut v: Vec<&str> = program.split_whitespace().collect(); + info!("Running {:?} with environment variables {:?}", v, env_vars); + Command::new(&v.remove(0)) + .args(&v) + .envs(env_vars.iter()) + .spawn_async() +} + +pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> io::Result { + let mut env_vars = HashMap::new(); + match event { + PlayerEvent::Changed { + old_track_id, + new_track_id, + } => { + env_vars.insert("PLAYER_EVENT", "change".to_string()); + env_vars.insert("OLD_TRACK_ID", old_track_id.to_base62()); + env_vars.insert("TRACK_ID", new_track_id.to_base62()); + } + PlayerEvent::Started { track_id } => { + env_vars.insert("PLAYER_EVENT", "start".to_string()); + env_vars.insert("TRACK_ID", track_id.to_base62()); + } + PlayerEvent::Stopped { track_id } => { + env_vars.insert("PLAYER_EVENT", "stop".to_string()); + env_vars.insert("TRACK_ID", track_id.to_base62()); + } + } + run_program(onevent, env_vars) +} diff --git a/src/spirc.rs b/src/spirc.rs deleted file mode 100644 index 3b5fb77c..00000000 --- a/src/spirc.rs +++ /dev/null @@ -1,628 +0,0 @@ -use futures::future; -use futures::sink::BoxSink; -use futures::stream::BoxStream; -use futures::sync::{oneshot, mpsc}; -use futures::{Future, Stream, Sink, Async, Poll, BoxFuture}; -use protobuf::{self, Message}; - -use core::config::ConnectConfig; -use core::mercury::MercuryError; -use core::session::Session; -use core::util::{now_ms, SpotifyId, SeqGenerator}; -use core::version; - -use protocol; -use protocol::spirc::{PlayStatus, State, MessageType, Frame, DeviceState}; - -use mixer::Mixer; -use player::Player; - -pub struct SpircTask { - player: Player, - mixer: Box, - - sequence: SeqGenerator, - - ident: String, - device: DeviceState, - state: State, - - subscription: BoxStream, - sender: BoxSink, - commands: mpsc::UnboundedReceiver, - end_of_track: BoxFuture<(), oneshot::Canceled>, - - shutdown: bool, - session: Session, -} - -pub enum SpircCommand { - Play, - PlayPause, - Pause, - Prev, - Next, - VolumeUp, - VolumeDown, - Shutdown -} - -pub struct Spirc { - commands: mpsc::UnboundedSender, -} - -fn initial_state() -> State { - protobuf_init!(protocol::spirc::State::new(), { - repeat: false, - shuffle: false, - status: PlayStatus::kPlayStatusStop, - position_ms: 0, - position_measured_at: 0, - }) -} - -fn initial_device_state(config: ConnectConfig, volume: u16) -> DeviceState { - protobuf_init!(DeviceState::new(), { - sw_version: version::version_string(), - is_active: false, - can_play: true, - volume: volume as u32, - name: config.name, - capabilities => [ - @{ - typ: protocol::spirc::CapabilityType::kCanBePlayer, - intValue => [1] - }, - @{ - typ: protocol::spirc::CapabilityType::kDeviceType, - intValue => [config.device_type as i64] - }, - @{ - typ: protocol::spirc::CapabilityType::kGaiaEqConnectId, - intValue => [1] - }, - @{ - typ: protocol::spirc::CapabilityType::kSupportsLogout, - intValue => [0] - }, - @{ - typ: protocol::spirc::CapabilityType::kIsObservable, - intValue => [1] - }, - @{ - typ: protocol::spirc::CapabilityType::kVolumeSteps, - intValue => [64] - }, - @{ - typ: protocol::spirc::CapabilityType::kSupportedContexts, - stringValue => [ - "album", - "playlist", - "search", - "inbox", - "toplist", - "starred", - "publishedstarred", - "track", - ] - }, - @{ - typ: protocol::spirc::CapabilityType::kSupportedTypes, - stringValue => [ - "audio/local", - "audio/track", - "local", - "track", - ] - } - ], - }) -} - -impl Spirc { - pub fn new(config: ConnectConfig, session: Session, player: Player, mixer: Box) - -> (Spirc, SpircTask) - { - debug!("new Spirc[{}]", session.session_id()); - - let ident = session.device_id().to_owned(); - - let uri = format!("hm://remote/3/user/{}/", session.username()); - - let subscription = session.mercury().subscribe(&uri as &str); - let subscription = subscription.map(|stream| stream.map_err(|_| MercuryError)).flatten_stream(); - let subscription = subscription.map(|response| -> Frame { - let data = response.payload.first().unwrap(); - protobuf::parse_from_bytes(data).unwrap() - }).boxed(); - - let sender = Box::new(session.mercury().sender(uri).with(|frame: Frame| { - Ok(frame.write_to_bytes().unwrap()) - })); - - let (cmd_tx, cmd_rx) = mpsc::unbounded(); - - let volume = 0xFFFF; - let device = initial_device_state(config, volume); - mixer.set_volume(volume); - - let mut task = SpircTask { - player: player, - mixer: mixer, - - sequence: SeqGenerator::new(1), - - ident: ident, - - device: device, - state: initial_state(), - - subscription: subscription, - sender: sender, - commands: cmd_rx, - end_of_track: future::empty().boxed(), - - shutdown: false, - session: session.clone(), - }; - - let spirc = Spirc { - commands: cmd_tx, - }; - - task.hello(); - - (spirc, task) - } - - pub fn play(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Play); - } - pub fn play_pause(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::PlayPause); - } - pub fn pause(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Pause); - } - pub fn prev(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Prev); - } - pub fn next(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Next); - } - pub fn volume_up(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::VolumeUp); - } - pub fn volume_down(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::VolumeDown); - } - pub fn shutdown(&self) { - let _ = mpsc::UnboundedSender::send(&self.commands, SpircCommand::Shutdown); - } -} - -impl Future for SpircTask { - type Item = (); - type Error = (); - - fn poll(&mut self) -> Poll<(), ()> { - loop { - let mut progress = false; - - if !self.shutdown { - match self.subscription.poll().unwrap() { - Async::Ready(Some(frame)) => { - progress = true; - self.handle_frame(frame); - } - Async::Ready(None) => panic!("subscription terminated"), - Async::NotReady => (), - } - - match self.commands.poll().unwrap() { - Async::Ready(Some(command)) => { - progress = true; - self.handle_command(command); - } - Async::Ready(None) => (), - Async::NotReady => (), - } - - match self.end_of_track.poll() { - Ok(Async::Ready(())) => { - progress = true; - self.handle_end_of_track(); - } - Ok(Async::NotReady) => (), - Err(oneshot::Canceled) => { - self.end_of_track = future::empty().boxed() - } - } - } - - let poll_sender = self.sender.poll_complete().unwrap(); - - // Only shutdown once we've flushed out all our messages - if self.shutdown && poll_sender.is_ready() { - return Ok(Async::Ready(())); - } - - if !progress { - return Ok(Async::NotReady); - } - } - } -} - -impl SpircTask { - fn handle_command(&mut self, cmd: SpircCommand) { - let active = self.device.get_is_active(); - match cmd { - SpircCommand::Play => { - if active { - self.handle_play(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypePlay).send(); - } - } - SpircCommand::PlayPause => { - if active { - self.handle_play_pause(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypePlayPause).send(); - } - } - SpircCommand::Pause => { - if active { - self.handle_pause(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypePause).send(); - } - } - SpircCommand::Prev => { - if active { - self.handle_prev(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypePrev).send(); - } - } - SpircCommand::Next => { - if active { - self.handle_next(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypeNext).send(); - } - } - SpircCommand::VolumeUp => { - if active { - self.handle_volume_up(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypeVolumeUp).send(); - } - } - SpircCommand::VolumeDown => { - if active { - self.handle_volume_down(); - self.notify(None); - } else { - CommandSender::new(self, MessageType::kMessageTypeVolumeDown).send(); - } - } - SpircCommand::Shutdown => { - CommandSender::new(self, MessageType::kMessageTypeGoodbye).send(); - self.shutdown = true; - self.commands.close(); - } - } - } - - fn handle_frame(&mut self, frame: Frame) { - debug!("{:?} {:?} {} {} {}", - frame.get_typ(), - frame.get_device_state().get_name(), - frame.get_ident(), - frame.get_seq_nr(), - frame.get_state_update_id()); - - if frame.get_ident() == self.ident || - (frame.get_recipient().len() > 0 && !frame.get_recipient().contains(&self.ident)) { - return; - } - - match frame.get_typ() { - MessageType::kMessageTypeHello => { - self.notify(Some(frame.get_ident())); - } - - MessageType::kMessageTypeLoad => { - if !self.device.get_is_active() { - self.device.set_is_active(true); - self.device.set_became_active_at(now_ms()); - } - - self.update_tracks(&frame); - - if self.state.get_track().len() > 0 { - self.state.set_position_ms(frame.get_state().get_position_ms()); - self.state.set_position_measured_at(now_ms() as u64); - - let play = frame.get_state().get_status() == PlayStatus::kPlayStatusPlay; - self.load_track(play); - } else { - self.state.set_status(PlayStatus::kPlayStatusStop); - } - - self.notify(None); - } - - MessageType::kMessageTypePlay => { - self.handle_play(); - self.notify(None); - } - - MessageType::kMessageTypePlayPause => { - self.handle_play_pause(); - self.notify(None); - } - - MessageType::kMessageTypePause => { - self.handle_pause(); - self.notify(None); - } - - MessageType::kMessageTypeNext => { - self.handle_next(); - self.notify(None); - } - - MessageType::kMessageTypePrev => { - self.handle_prev(); - self.notify(None); - } - - MessageType::kMessageTypeVolumeUp => { - self.handle_volume_up(); - self.notify(None); - } - - MessageType::kMessageTypeVolumeDown => { - self.handle_volume_down(); - self.notify(None); - } - - MessageType::kMessageTypeSeek => { - let position = frame.get_position(); - - self.state.set_position_ms(position); - self.state.set_position_measured_at(now_ms() as u64); - self.player.seek(position); - self.notify(None); - } - - MessageType::kMessageTypeReplace => { - self.update_tracks(&frame); - self.notify(None); - } - - MessageType::kMessageTypeVolume => { - let volume = frame.get_volume(); - self.device.set_volume(volume); - self.mixer.set_volume(frame.get_volume() as u16); - self.notify(None); - } - - MessageType::kMessageTypeNotify => { - if self.device.get_is_active() && - frame.get_device_state().get_is_active() - { - self.device.set_is_active(false); - self.state.set_status(PlayStatus::kPlayStatusStop); - self.player.stop(); - self.mixer.stop(); - } - } - - _ => (), - } - } - - fn handle_play(&mut self) { - if self.state.get_status() == PlayStatus::kPlayStatusPause { - self.mixer.start(); - self.player.play(); - self.state.set_status(PlayStatus::kPlayStatusPlay); - self.state.set_position_measured_at(now_ms() as u64); - } - } - - fn handle_play_pause(&mut self) { - match self.state.get_status() { - PlayStatus::kPlayStatusPlay => self.handle_pause(), - PlayStatus::kPlayStatusPause => self.handle_play(), - _ => (), - } - } - - fn handle_pause(&mut self) { - if self.state.get_status() == PlayStatus::kPlayStatusPlay { - self.player.pause(); - self.mixer.stop(); - self.state.set_status(PlayStatus::kPlayStatusPause); - - let now = now_ms() as u64; - let position = self.state.get_position_ms(); - - let diff = now - self.state.get_position_measured_at(); - - self.state.set_position_ms(position + diff as u32); - self.state.set_position_measured_at(now); - } - } - - fn handle_next(&mut self) { - let current_index = self.state.get_playing_track_index(); - let new_index = (current_index + 1) % (self.state.get_track().len() as u32); - - self.state.set_playing_track_index(new_index); - self.state.set_position_ms(0); - self.state.set_position_measured_at(now_ms() as u64); - - self.load_track(true); - } - - fn handle_prev(&mut self) { - // Previous behaves differently based on the position - // Under 3s it goes to the previous song - // Over 3s it seeks to zero - if self.position() < 3000 { - let current_index = self.state.get_playing_track_index(); - - let new_index = if current_index == 0 { - self.state.get_track().len() as u32 - 1 - } else { - current_index - 1 - }; - - self.state.set_playing_track_index(new_index); - self.state.set_position_ms(0); - self.state.set_position_measured_at(now_ms() as u64); - - self.load_track(true); - } else { - self.state.set_position_ms(0); - self.state.set_position_measured_at(now_ms() as u64); - self.player.seek(0); - } - } - - fn handle_volume_up(&mut self) { - let mut volume: u32 = self.mixer.volume() as u32 + 4096; - if volume > 0xFFFF { - volume = 0xFFFF; - } - self.device.set_volume(volume); - self.mixer.set_volume(volume as u16); - } - - fn handle_volume_down(&mut self) { - let mut volume: i32 = self.mixer.volume() as i32 - 4096; - if volume < 0 { - volume = 0; - } - self.device.set_volume(volume as u32); - self.mixer.set_volume(volume as u16); - } - - fn handle_end_of_track(&mut self) { - let current_index = self.state.get_playing_track_index(); - let new_index = (current_index + 1) % (self.state.get_track().len() as u32); - - self.state.set_playing_track_index(new_index); - self.state.set_position_ms(0); - self.state.set_position_measured_at(now_ms() as u64); - - self.load_track(true); - self.notify(None); - } - - fn position(&mut self) -> u32 { - let diff = now_ms() as u64 - self.state.get_position_measured_at(); - self.state.get_position_ms() + diff as u32 - } - - fn update_tracks(&mut self, frame: &protocol::spirc::Frame) { - let index = frame.get_state().get_playing_track_index(); - let tracks = frame.get_state().get_track(); - - self.state.set_playing_track_index(index); - self.state.set_track(tracks.into_iter().cloned().collect()); - } - - fn load_track(&mut self, play: bool) { - let index = self.state.get_playing_track_index(); - let track = { - let gid = self.state.get_track()[index as usize].get_gid(); - SpotifyId::from_raw(gid) - }; - let position = self.state.get_position_ms(); - - let end_of_track = self.player.load(track, play, position); - - if play { - self.state.set_status(PlayStatus::kPlayStatusPlay); - } else { - self.state.set_status(PlayStatus::kPlayStatusPause); - } - - self.end_of_track = end_of_track.boxed(); - } - - fn hello(&mut self) { - CommandSender::new(self, MessageType::kMessageTypeHello).send(); - } - - fn notify(&mut self, recipient: Option<&str>) { - let mut cs = CommandSender::new(self, MessageType::kMessageTypeNotify); - if let Some(s) = recipient { - cs = cs.recipient(&s); - } - cs.send(); - } -} - -impl Drop for SpircTask { - fn drop(&mut self) { - debug!("drop Spirc[{}]", self.session.session_id()); - } -} - -struct CommandSender<'a> { - spirc: &'a mut SpircTask, - frame: protocol::spirc::Frame, -} - -impl<'a> CommandSender<'a> { - fn new(spirc: &'a mut SpircTask, cmd: MessageType) -> CommandSender { - let frame = protobuf_init!(protocol::spirc::Frame::new(), { - version: 1, - protocol_version: "2.0.0", - ident: spirc.ident.clone(), - seq_nr: spirc.sequence.get(), - typ: cmd, - - device_state: spirc.device.clone(), - state_update_id: now_ms(), - }); - - CommandSender { - spirc: spirc, - frame: frame, - } - } - - fn recipient(mut self, recipient: &'a str) -> CommandSender { - self.frame.mut_recipient().push(recipient.to_owned()); - self - } - - #[allow(dead_code)] - fn state(mut self, state: protocol::spirc::State) -> CommandSender<'a> { - self.frame.set_state(state); - self - } - - fn send(mut self) { - if !self.frame.has_state() && self.spirc.device.get_is_active() { - self.frame.set_state(self.spirc.state.clone()); - } - - let send = self.spirc.sender.start_send(self.frame).unwrap(); - assert!(send.is_ready()); - } -}