diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..711b788d --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,11 @@ +[env] +# Make sure to keep this version in line with the `.github/workflows/release.yml` +# action for releaseing stremio-core-kotlin! +NDK_VERSION = "27.2.12479018" + +# Set the same RANLIB binary location for all the 4 targets: +# armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android +RANLIB_armv7_linux_androideabi = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" +RANLIB_aarch64_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" +RANLIB_i686_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" +RANLIB_x86_64_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..3bfddcb8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +# Check for outdated actions +updates: + - package-ecosystem: "github-actions" + directory: "/" + # Check for updates every Monday + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 447bd69b..cb526f26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,23 +5,46 @@ on: branches: - '**' +# Stops the running workflow of previous pushes +concurrency: + group: ${{ github.ref }}-android + cancel-in-progress: true + +env: + # For the confusing protoc versioning check out these docs: + # https://protobuf.dev/support/version-support/ + # v3.26.x, where `.x` is a wildcard + # + # For stremio-core-android we use version 3.21 + # Check build.gradle.kts + PROTOC_VERSION: '21.x' + jobs: build: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - - name: Set default rust toolchain - run: rustup default 1.67.1 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Install clippy - run: rustup component add clippy + uses: actions/checkout@v4 + + # add protoc because of stremio-core-csharp + - name: Install Protoc + uses: arduino/setup-protoc@v3 + with: + version: "${{ env.PROTOC_VERSION }}" + + - name: Rust setup (1.70.0) + uses: dtolnay/rust-toolchain@1.70.0 + with: + components: rustfmt, clippy + - name: Rust cache uses: Swatinem/rust-cache@v2 + - name: Build code - run: cargo build + run: cargo build -p stremio-core-android + - name: Lint code format run: cargo fmt --all -- --check + - name: Lint code run: cargo clippy --all -- -D warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8be13a7b..9667bb16 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,41 +1,47 @@ -name: Release +name: Release stremio-core-android on: release: types: [published] +env: + # Make sure to keep this version in line with `.config/cargo.toml` file for + # stremio-core-kotlin! + NDK_VERSION: '27.2.12479018' + jobs: release: runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: "11" distribution: "adopt" - name: Setup Android SDK + # newer version of the 2 actions will cause a LinkageError + # Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli + # java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli + # has been compiled by a more recent version of the Java Runtime (class file version 61.0), + # this version of the Java Runtime only recognizes class file versions up to 55.0 + # uses: android-actions/setup-android@v3 uses: android-actions/setup-android@v2 - - name: Setup Android NDK - run: yes | sdkmanager "ndk;21.4.7075529" >/dev/null - - name: Set default rust toolchain - run: rustup default 1.67.1 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Install clippy - run: rustup component add clippy - - name: Add armv7 target - run: rustup target add armv7-linux-androideabi - - name: Add aarch64 target - run: rustup target add aarch64-linux-android - - name: Add i686 target - run: rustup target add i686-linux-android - - name: Add x86_64 target - run: rustup target add x86_64-linux-android - - name: Rust cache - uses: Swatinem/rust-cache@v2 + - name: Setup Android NDK (${{ env.NDK_VERSION }}) + run: yes | sdkmanager "ndk;${{ env.NDK_VERSION }}" >/dev/null + + # use MSRV + - name: Set Rust version to MSRV 1.70 + uses: dtolnay/rust-toolchain@1.70 + with: + # Add armv7, aarch64, i686, x86_64 targets + targets: armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android + components: rust-std + + - uses: Swatinem/rust-cache@v2 + - name: Build aar run: ./gradlew -Pversion=${GITHUB_REF##*/} publishToMavenLocal - name: Archive artifacts diff --git a/.gitignore b/.gitignore index ea2e8800..c4e793f3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ /.gradle /src/debug /src/release -/**/rust/protobuf/* -!/**/rust/protobuf/README.md /.idea/ /local.properties + +/stremio-core-protobuf/src/protobuf/* +!/stremio-core-protobuf/src/protobuf/README.md \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9bf72938..40aeefb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,32 +8,32 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ - "lazy_static", - "regex", + "lazy_static", + "regex", ] [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ - "memchr", + "memchr", ] [[package]] @@ -48,14 +48,14 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ - "libc", + "libc", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "array-init" @@ -63,7 +63,7 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" dependencies = [ - "nodrop", + "nodrop", ] [[package]] @@ -72,36 +72,34 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", ] [[package]] name = "async-channel" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ - "concurrent-queue", - "event-listener 4.0.0", - "event-listener-strategy", - "futures-core", - "pin-project-lite", + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ - "async-lock 3.2.0", - "async-task", - "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.1.0", - "slab", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", ] [[package]] @@ -110,151 +108,124 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel 2.1.1", - "async-executor", - "async-io 2.2.2", - "async-lock 3.2.0", - "blocking", - "futures-lite 2.1.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", + "async-channel 2.3.1", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", ] [[package]] name = "async-io" -version = "2.2.2" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock 3.2.0", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-io", - "futures-lite 2.1.0", - "parking", - "polling 3.3.1", - "rustix 0.38.28", - "slab", - "tracing", - "windows-sys 0.52.0", + "async-lock", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", ] [[package]] name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.0", - "event-listener-strategy", - "pin-project-lite", + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-process" -version = "1.8.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if 1.0.0", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.28", - "windows-sys 0.48.0", + "async-channel 2.3.1", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if 1.0.0", + "event-listener 5.3.1", + "futures-lite", + "rustix", + "tracing", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.2.2", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if 1.0.0", - "futures-core", - "futures-io", - "rustix 0.38.28", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", + "async-io", + "async-lock", + "atomic-waker", + "cfg-if 1.0.0", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", ] [[package]] name = "async-std" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", +checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", ] [[package]] name = "async-task" -version = "4.5.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -269,31 +240,31 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -302,7 +273,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" dependencies = [ - "byteorder", + "byteorder", ] [[package]] @@ -313,9 +284,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "beef" @@ -329,7 +306,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde", + "serde", ] [[package]] @@ -340,9 +317,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -350,10 +327,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", ] [[package]] @@ -362,7 +339,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.7", ] [[package]] @@ -371,7 +348,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.7", ] [[package]] @@ -380,23 +357,20 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" dependencies = [ - "byte-tools", + "byte-tools", ] [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.2.0", - "async-task", - "fastrand 2.0.1", - "futures-io", - "futures-lite 2.1.0", - "piper", - "tracing", + "async-channel 2.3.1", + "async-task", + "futures-io", + "futures-lite", + "piper", ] [[package]] @@ -407,9 +381,9 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-tools" @@ -425,9 +399,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cacache" @@ -435,21 +409,21 @@ version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c13caedf5b624de6448b78e980320a27266557350198dc67cf64bc8561c27e8" dependencies = [ - "async-std", - "digest 0.9.0", - "either", - "futures", - "hex 0.4.3", - "memmap2", - "serde", - "serde_derive", - "serde_json", - "sha-1 0.9.8", - "sha2 0.9.9", - "ssri", - "tempfile", - "thiserror", - "walkdir", + "async-std", + "digest 0.9.0", + "either", + "futures", + "hex 0.4.3", + "memmap2", + "serde", + "serde_derive", + "serde_json", + "sha-1 0.9.8", + "sha2 0.9.9", + "ssri", + "tempfile", + "thiserror", + "walkdir", ] [[package]] @@ -460,11 +434,11 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.83" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -487,36 +461,36 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.48.5", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.6", ] [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bytes", - "memchr", + "bytes", + "memchr", ] [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "crossbeam-utils", + "crossbeam-utils", ] [[package]] @@ -531,42 +505,39 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "core-foundation-sys", - "libc", + "core-foundation-sys", + "libc", ] [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ - "libc", + "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.0", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -574,53 +545,53 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", - "typenum", + "generic-array 0.14.7", + "typenum", ] [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core", - "darling_macro", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.41", + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.85", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core", - "quote", - "syn 2.0.41", + "darling_core", + "quote", + "syn 2.0.85", ] [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ - "powerfmt", - "serde", + "powerfmt", + "serde", ] [[package]] @@ -629,22 +600,22 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.85", ] [[package]] @@ -653,7 +624,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array 0.12.4", + "generic-array 0.12.4", ] [[package]] @@ -662,7 +633,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array 0.14.7", ] [[package]] @@ -671,15 +642,15 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", - "crypto-common", + "block-buffer 0.10.4", + "crypto-common", ] [[package]] name = "either" -version = "1.6.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "enclose" @@ -689,11 +660,11 @@ checksum = "1056f553da426e9c025a662efa48b52e62e0a3a7648aa2d15aeaaf7f0d329357" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 1.0.0", ] [[package]] @@ -704,12 +675,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "libc", - "windows-sys 0.52.0", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -720,34 +691,23 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.1.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.0", - "pin-project-lite", + "event-listener 5.3.1", + "pin-project-lite", ] [[package]] @@ -758,18 +718,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fixedbitset" @@ -779,12 +730,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ - "crc32fast", - "miniz_oxide", + "crc32fast", + "miniz_oxide", ] [[package]] @@ -799,7 +750,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared", ] [[package]] @@ -814,7 +765,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "percent-encoding", + "percent-encoding", ] [[package]] @@ -825,119 +776,104 @@ checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ - "futures-core", - "futures-sink", + "futures-core", + "futures-sink", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ - "futures-core", - "futures-task", - "futures-util", + "futures-core", + "futures-task", + "futures-util", ] [[package]] name = "futures-io" -version = "0.3.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" - -[[package]] -name = "futures-lite" -version = "1.13.0" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", ] [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] @@ -946,7 +882,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ - "byteorder", + "byteorder", ] [[package]] @@ -955,7 +891,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum", + "typenum", ] [[package]] @@ -964,26 +900,26 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum", - "version_check", + "typenum", + "version_check", ] [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", + "cfg-if 1.0.0", + "libc", + "wasi", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -993,33 +929,33 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-timers" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", ] [[package]] name = "h2" -version = "0.3.22" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 2.1.0", - "slab", - "tokio", - "tokio-util", - "tracing", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.6.0", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] @@ -1030,9 +966,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -1040,7 +976,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ - "unicode-segmentation", + "unicode-segmentation", ] [[package]] @@ -1049,11 +985,23 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -1067,24 +1015,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes", - "fnv", - "itoa", + "bytes", + "fnv", + "itoa", ] [[package]] @@ -1093,9 +1032,9 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes", - "http", - "pin-project-lite", + "bytes", + "http", + "pin-project-lite", ] [[package]] @@ -1104,17 +1043,17 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4454aac149336202b5fc06a4451ffd0f032419ae3b3e98212cf38a47b29c548" dependencies = [ - "anyhow", - "async-trait", - "bincode", - "cacache", - "http", - "http-cache-semantics", - "httpdate", - "miette 4.7.1", - "serde", - "thiserror", - "url", + "anyhow", + "async-trait", + "bincode", + "cacache", + "http", + "http-cache-semantics", + "httpdate", + "miette 4.7.1", + "serde", + "thiserror", + "url", ] [[package]] @@ -1123,16 +1062,16 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c5229affa77eaf70b605f56fe5b66a3e1f5f2c9df063e94acdc82f321319667" dependencies = [ - "anyhow", - "async-trait", - "http", - "http-cache", - "http-cache-semantics", - "reqwest", - "reqwest-middleware", - "serde", - "task-local-extensions", - "url", + "anyhow", + "async-trait", + "http", + "http-cache", + "http-cache-semantics", + "reqwest", + "reqwest-middleware", + "serde", + "task-local-extensions", + "url", ] [[package]] @@ -1141,10 +1080,10 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7aec9f678bca3f4a15194b980f20ed9bfe0dd38e8d298c65c559a93dfbd6380a" dependencies = [ - "http", - "http-serde", - "serde", - "time", + "http", + "http-serde", + "serde", + "time", ] [[package]] @@ -1153,15 +1092,15 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f560b665ad9f1572cfcaf034f7fb84338a7ce945216d64a90fd81f046a3caee" dependencies = [ - "http", - "serde", + "http", + "serde", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1171,26 +1110,26 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.10", - "tokio", - "tower-service", - "tracing", - "want", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", ] [[package]] @@ -1199,12 +1138,12 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ - "futures-util", - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", ] [[package]] @@ -1213,25 +1152,25 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", ] [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", ] [[package]] @@ -1240,7 +1179,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cc", + "cc", ] [[package]] @@ -1255,8 +1194,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1265,71 +1204,60 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", + "autocfg", + "hashbrown 0.12.3", + "serde", ] [[package]] name = "indexmap" -version = "2.1.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ - "equivalent", - "hashbrown 0.14.3", - "serde", + "equivalent", + "hashbrown 0.15.0", + "serde", ] [[package]] -name = "instant" -version = "0.1.12" +name = "ipnet" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "itertools" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "either", ] -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ - "either", + "either", ] [[package]] name = "itertools" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "either", + "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -1337,12 +1265,12 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", ] [[package]] @@ -1353,11 +1281,11 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ - "wasm-bindgen", + "wasm-bindgen", ] [[package]] @@ -1366,14 +1294,14 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" dependencies = [ - "log", + "log", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazysort" @@ -1383,40 +1311,34 @@ checksum = "d0e22ff43b231e0e2f87d74984e53ebc73b90ae13397e041214fb07efc64168f" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "localsearch" version = "0.1.0" source = "git+https://github.com/Stremio/local-search?branch=main#74fefe1da2fa17d2b4ef7e3e629da00f3946ee72" dependencies = [ - "fst", - "fxhash", - "num-traits", - "utf8-ranges", + "fst", + "fxhash", + "num-traits", + "utf8-ranges", ] [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ - "value-bag", + "value-bag", ] [[package]] @@ -1425,7 +1347,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" dependencies = [ - "logos-derive", + "logos-derive", ] [[package]] @@ -1434,12 +1356,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" dependencies = [ - "beef", - "fnv", - "proc-macro2", - "quote", - "regex-syntax 0.6.29", - "syn 2.0.41", + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn 2.0.85", ] [[package]] @@ -1448,7 +1370,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" dependencies = [ - "logos-codegen", + "logos-codegen", ] [[package]] @@ -1457,8 +1379,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b4c4004e88aca00cc0c60782e5642c8fc628deca19e530ce58aa76e737d74" dependencies = [ - "lazy_static", - "regex", + "lazy_static", + "regex", ] [[package]] @@ -1469,9 +1391,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -1479,7 +1401,7 @@ version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "libc", + "libc", ] [[package]] @@ -1488,10 +1410,10 @@ version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" dependencies = [ - "miette-derive 4.7.1", - "once_cell", - "thiserror", - "unicode-width", + "miette-derive 4.7.1", + "once_cell", + "thiserror", + "unicode-width", ] [[package]] @@ -1500,10 +1422,10 @@ version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ - "miette-derive 5.10.0", - "once_cell", - "thiserror", - "unicode-width", + "miette-derive 5.10.0", + "once_cell", + "thiserror", + "unicode-width", ] [[package]] @@ -1512,9 +1434,9 @@ version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -1523,9 +1445,9 @@ version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -1536,56 +1458,56 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ - "mime", - "unicase", + "mime", + "unicase", ] [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.10" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", ] [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -1596,91 +1518,85 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "num" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", ] [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "num-traits", + "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", - "num-traits", + "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "autocfg", + "num-integer", + "num-traits", ] [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "num-integer", + "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", + "autocfg", ] [[package]] name = "object" -version = "0.32.1" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ - "memchr", + "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -1690,23 +1606,23 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.40" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 1.3.2", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", + "bitflags 2.6.0", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] @@ -1715,9 +1631,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -1728,32 +1644,31 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.0+1.1.1t" +version = "300.4.0+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" dependencies = [ - "cc", + "cc", ] [[package]] name = "openssl-sys" -version = "0.9.74" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ - "autocfg", - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", ] [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "percent-encoding" @@ -1763,19 +1678,19 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", - "indexmap 2.1.0", + "fixedbitset", + "indexmap 2.6.0", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1785,49 +1700,34 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ - "atomic-waker", - "fastrand 2.0.1", - "futures-io", + "atomic-waker", + "fastrand", + "futures-io", ] [[package]] name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "polling" -version = "2.8.0" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" -version = "3.3.1" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ - "cfg-if 1.0.0", - "concurrent-queue", - "pin-project-lite", - "rustix 0.38.28", - "tracing", - "windows-sys 0.52.0", + "cfg-if 1.0.0", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", ] [[package]] @@ -1838,12 +1738,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ - "proc-macro2", - "syn 2.0.41", + "proc-macro2", + "syn 2.0.85", ] [[package]] @@ -1852,8 +1752,8 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "once_cell", - "toml_edit", + "once_cell", + "toml_edit", ] [[package]] @@ -1862,11 +1762,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", ] [[package]] @@ -1875,18 +1775,18 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "proc-macro2", + "quote", + "version_check", ] [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ - "unicode-ident", + "unicode-ident", ] [[package]] @@ -1895,54 +1795,53 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0c2a098cd8aaa29f66da27a684ad19f4b7bc886f576abf12f7df4a7391071c7" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] name = "prost" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ - "bytes", - "prost-derive", + "bytes", + "prost-derive", ] [[package]] name = "prost-build" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ - "bytes", - "heck 0.4.1", - "itertools 0.10.5", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.41", - "tempfile", - "which", + "bytes", + "heck 0.5.0", + "itertools 0.12.1", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.85", + "tempfile", ] [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 2.0.41", + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -1951,20 +1850,20 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" dependencies = [ - "logos", - "miette 5.10.0", - "once_cell", - "prost", - "prost-types", + "logos", + "miette 5.10.0", + "once_cell", + "prost", + "prost-types", ] [[package]] name = "prost-types" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost", + "prost", ] [[package]] @@ -1973,13 +1872,13 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00bb76c5f6221de491fe2c8f39b106330bbd9762c6511119c07940e10eb9ff11" dependencies = [ - "bytes", - "miette 5.10.0", - "prost", - "prost-reflect", - "prost-types", - "protox-parse", - "thiserror", + "bytes", + "miette 5.10.0", + "prost", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", ] [[package]] @@ -1988,51 +1887,42 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b4581f441c58863525a3e6bec7b8de98188cf75239a56c725a3e7288450a33f" dependencies = [ - "logos", - "miette 5.10.0", - "prost-types", - "thiserror", + "logos", + "miette 5.10.0", + "prost-types", + "thiserror", ] [[package]] name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "bitflags 1.3.2", + "proc-macro2", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax 0.8.2", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", ] [[package]] @@ -2043,52 +1933,53 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" -dependencies = [ - "base64 0.21.5", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "winreg", +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", ] [[package]] @@ -2097,82 +1988,69 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69539cea4148dce683bec9dc95be3f0397a9bb2c248a49c8296a9d21659a8cdd" dependencies = [ - "anyhow", - "async-trait", - "futures", - "http", - "reqwest", - "serde", - "task-local-extensions", - "thiserror", + "anyhow", + "async-trait", + "futures", + "http", + "reqwest", + "serde", + "task-local-extensions", + "thiserror", ] [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ - "cc", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", + "cc", + "cfg-if 1.0.0", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "semver", ] [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys 0.4.12", - "windows-sys 0.52.0", + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", + "log", + "ring", + "rustls-webpki", + "sct", ] [[package]] @@ -2181,7 +2059,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -2190,21 +2068,21 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2212,16 +2090,16 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "winapi-util", + "winapi-util", ] [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2230,49 +2108,49 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring", + "untrusted", ] [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ - "core-foundation-sys", - "libc", + "core-foundation-sys", + "libc", ] [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ - "serde", + "serde", ] [[package]] name = "serde" -version = "1.0.193" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ - "serde_derive", + "serde_derive", ] [[package]] @@ -2281,49 +2159,50 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a70dfc7b7438b99896e7f8992363ab8e2c4ba26aa5ec675d32d1c3c2c33d413e" dependencies = [ - "serde", - "serde_bytes", + "serde", + "serde_bytes", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ - "serde", + "serde", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "itoa", - "ryu", - "serde", + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ - "itoa", - "serde", + "itoa", + "serde", ] [[package]] @@ -2332,8 +2211,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c43307d0640738af32fe8d01e47119bc0fc8a686be470a44a586caff76dfb34" dependencies = [ - "serde", - "url", + "serde", + "url", ] [[package]] @@ -2342,40 +2221,40 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", + "form_urlencoded", + "itoa", + "ryu", + "serde", ] [[package]] name = "serde_with" -version = "3.7.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ - "base64 0.21.5", - "chrono", - "hex 0.4.3", - "indexmap 1.9.3", - "indexmap 2.1.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", + "base64 0.22.1", + "chrono", + "hex 0.4.3", + "indexmap 1.9.3", + "indexmap 2.6.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", ] [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.41", + "darling", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -2384,10 +2263,10 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", ] [[package]] @@ -2396,11 +2275,11 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.1", ] [[package]] @@ -2409,9 +2288,9 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", ] [[package]] @@ -2420,10 +2299,10 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", ] [[package]] @@ -2432,11 +2311,11 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.1", ] [[package]] @@ -2445,18 +2324,24 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ - "libc", + "libc", ] [[package]] @@ -2465,7 +2350,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg", + "autocfg", ] [[package]] @@ -2474,27 +2359,17 @@ version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ - "maybe-uninit", + "maybe-uninit", ] [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -2509,114 +2384,130 @@ version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9cec0d388f39fbe79d7aa600e8d38053bf97b1bc8d350da7c0ba800d0f423f2" dependencies = [ - "base64 0.10.1", - "digest 0.8.1", - "hex 0.3.2", - "serde", - "sha-1 0.8.2", - "sha2 0.8.2", - "thiserror", + "base64 0.10.1", + "digest 0.8.1", + "hex 0.3.2", + "serde", + "sha-1 0.8.2", + "sha2 0.8.2", + "thiserror", ] [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#f74c212752443ef625a17d48ce4dc955f2300bc7" -dependencies = [ - "anyhow", - "base64 0.21.5", - "boolinator", - "chrono", - "derivative", - "derive_more", - "either", - "enclose", - "flate2", - "futures", - "hex 0.4.3", - "http", - "itertools 0.11.0", - "lazy_static", - "lazysort", - "localsearch", - "magnet-url", - "num", - "once_cell", - "percent-encoding", - "regex", - "semver", - "serde", - "serde_bencode", - "serde_json", - "serde_path_to_error", - "serde_url_params", - "serde_with", - "sha1", - "sha2 0.10.8", - "stremio-derive", - "stremio-official-addons", - "stremio-serde-hex", - "stremio-watched-bitfield", - "strum 0.25.0", - "thiserror", - "tracing", - "url", +source = "git+https://github.com/Stremio/stremio-core?branch=development#02a1460fa8f02341469ce29113afce7d96276aa6" +dependencies = [ + "anyhow", + "base64 0.21.7", + "boolinator", + "chrono", + "derivative", + "derive_more", + "either", + "enclose", + "flate2", + "futures", + "hex 0.4.3", + "http", + "itertools 0.11.0", + "lazysort", + "localsearch", + "magnet-url", + "num", + "once_cell", + "percent-encoding", + "regex", + "semver", + "serde", + "serde_bencode", + "serde_json", + "serde_path_to_error", + "serde_url_params", + "serde_with", + "sha1", + "sha2 0.10.8", + "stremio-derive", + "stremio-official-addons", + "stremio-serde-hex", + "stremio-watched-bitfield", + "strum 0.25.0", + "thiserror", + "tracing", + "url", ] [[package]] name = "stremio-core-android" version = "1.2.6" dependencies = [ - "Inflector", - "auto_impl", - "base64 0.13.1", - "boolinator", - "bytes", - "cfg-if 0.1.10", - "chrono", - "either", - "enclose", - "flate2", - "futures", - "getrandom", - "glob", - "hex 0.4.3", - "http", - "http-cache-reqwest", - "itertools 0.10.5", - "jni", - "lazy_static", - "once_cell", - "openssl", - "percent-encoding", - "prost", - "prost-build", - "prost-types", - "protox", - "reqwest", - "reqwest-middleware", - "semver", - "serde", - "serde_json", - "serde_path_to_error", - "stremio-core", - "stremio-watched-bitfield", - "strum 0.22.0", - "tokio", - "url", + "Inflector", + "auto_impl", + "base64 0.13.1", + "boolinator", + "bytes", + "cfg-if 0.1.10", + "chrono", + "enclose", + "flate2", + "futures", + "getrandom", + "glob", + "hex 0.4.3", + "http", + "http-cache-reqwest", + "itertools 0.13.0", + "jni", + "once_cell", + "openssl", + "percent-encoding", + "prost", + "prost-build", + "prost-types", + "protox", + "reqwest", + "reqwest-middleware", + "semver", + "serde", + "serde_json", + "serde_path_to_error", + "stremio-core", + "stremio-core-protobuf", + "strum 0.22.0", + "tokio", + "url", +] + +[[package]] +name = "stremio-core-protobuf" +version = "0.1.0" +dependencies = [ + "Inflector", + "boolinator", + "chrono", + "glob", + "hex 0.4.3", + "itertools 0.13.0", + "prost", + "prost-build", + "prost-types", + "protox", + "semver", + "stremio-core", + "url", ] [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#f74c212752443ef625a17d48ce4dc955f2300bc7" +source = "git+https://github.com/Stremio/stremio-core?branch=development#02a1460fa8f02341469ce29113afce7d96276aa6" dependencies = [ - "case", - "proc-macro-crate", - "proc-macro2", - "proc_macro_roids", - "quote", - "syn 2.0.41", + "case", + "proc-macro-crate", + "proc-macro2", + "proc_macro_roids", + "quote", + "syn 2.0.85", ] [[package]] @@ -2625,8 +2516,8 @@ version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b03b5836f294463f2ad0eeebac3bcde05dcbecfefa4fc6da2029c5e15d17ad9" dependencies = [ - "once_cell", - "serde_json", + "once_cell", + "serde_json", ] [[package]] @@ -2635,26 +2526,26 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5600c4d6b97a1e6b4c0a9fa6e14d94eba885f2aa7610fc52a1557a9a140e69" dependencies = [ - "array-init", - "serde", - "smallvec", + "array-init", + "serde", + "smallvec", ] [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#f74c212752443ef625a17d48ce4dc955f2300bc7" +source = "git+https://github.com/Stremio/stremio-core?branch=development#02a1460fa8f02341469ce29113afce7d96276aa6" dependencies = [ - "base64 0.13.1", - "flate2", - "serde", + "base64 0.13.1", + "flate2", + "serde", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -2662,7 +2553,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" dependencies = [ - "strum_macros 0.22.0", + "strum_macros 0.22.0", ] [[package]] @@ -2671,7 +2562,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.25.3", + "strum_macros 0.25.3", ] [[package]] @@ -2680,10 +2571,10 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb" dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -2692,11 +2583,11 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.41", + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.85", ] [[package]] @@ -2705,31 +2596,37 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.41" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "proc-macro2", + "quote", + "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] @@ -2738,8 +2635,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "core-foundation-sys", - "libc", + "core-foundation-sys", + "libc", ] [[package]] @@ -2748,54 +2645,55 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" dependencies = [ - "pin-utils", + "pin-utils", ] [[package]] name = "tempfile" -version = "3.8.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ - "cfg-if 1.0.0", - "fastrand 2.0.1", - "redox_syscall", - "rustix 0.38.28", - "windows-sys 0.48.0", + "cfg-if 1.0.0", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ - "thiserror-impl", + "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "deranged", - "itoa", - "powerfmt", - "serde", - "time-core", - "time-macros", + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", ] [[package]] @@ -2806,20 +2704,21 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ - "time-core", + "num-conv", + "time-core", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ - "tinyvec_macros", + "tinyvec_macros", ] [[package]] @@ -2830,18 +2729,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2 0.5.5", - "windows-sys 0.48.0", + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", ] [[package]] @@ -2850,8 +2748,8 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "native-tls", - "tokio", + "native-tls", + "tokio", ] [[package]] @@ -2860,29 +2758,28 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", - "tokio", + "rustls", + "tokio", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" @@ -2890,16 +2787,16 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", + "indexmap 2.6.0", + "toml_datetime", + "winnow", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -2907,9 +2804,9 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] @@ -2918,9 +2815,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", + "proc-macro2", + "quote", + "syn 2.0.85", ] [[package]] @@ -2929,7 +2826,7 @@ version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "once_cell", + "once_cell", ] [[package]] @@ -2946,45 +2843,42 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ - "tinyvec", + "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "untrusted" @@ -2994,14 +2888,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", + "form_urlencoded", + "idna", + "percent-encoding", + "serde", ] [[package]] @@ -3012,9 +2906,9 @@ checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" [[package]] name = "value-bag" -version = "1.4.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" [[package]] name = "vcpkg" @@ -3024,24 +2918,18 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "waker-fn" -version = "1.1.1" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ - "same-file", - "winapi-util", + "same-file", + "winapi-util", ] [[package]] @@ -3050,7 +2938,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "try-lock", + "try-lock", ] [[package]] @@ -3061,136 +2949,103 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", + "cfg-if 1.0.0", + "once_cell", + "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.41", - "wasm-bindgen-shared", + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.85", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "quote", + "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.41", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "proc-macro2", + "quote", + "syn 2.0.85", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ - "js-sys", - "wasm-bindgen", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.28", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3199,7 +3054,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.48.5", ] [[package]] @@ -3208,7 +3063,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3217,28 +3081,29 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3249,9 +3114,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3261,9 +3126,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3273,9 +3138,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3285,9 +3156,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3297,9 +3168,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3309,9 +3180,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3321,17 +3192,17 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.28" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ - "memchr", + "memchr", ] [[package]] @@ -3340,6 +3211,6 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 4cb572f1..8273e51d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,64 +3,133 @@ name = "stremio-core-android" version = "1.2.6" authors = ["Smart Code OOD"] edition = "2021" -resolver = "2" -rust-version = "1.67.1" +rust-version = "1.70.0" + +[features] +default = ["kotlin"] +kotlin = [ + # for fetch (making requests): + "dep:http", + "dep:reqwest", + "dep:openssl", + "dep:http-cache-reqwest", + "dep:reqwest-middleware", + # executors + "dep:tokio", + # java bindings + "dep:jni", + "dep:getrandom", +] [lib] -crate_type = ["staticlib", "dylib"] path = "src/commonMain/rust/lib.rs" -[profile.release] -lto = true -opt-level = 3 +[workspace] +resolver = "2" +members = ["stremio-core-protobuf"] -[dependencies] -stremio-core = { git = "https://github.com/Stremio/stremio-core", branch = "development", features = [ +[workspace.dependencies] +stremio-core = { version = "0.1", git = "https://github.com/Stremio/stremio-core", branch = "development", features = [ "derive", "analytics", "env-future-send", ] } +# For share UI models +stremio-core-web = { version = "0.47", git = "https://github.com/Stremio/stremio-core", branch = "development", default-features = false } +stremio-core-protobuf = { version = "0.1", path = "stremio-core-protobuf", default-features = false } -stremio-watched-bitfield = { git = "https://github.com/Stremio/stremio-core", branch = "development" } +# Protobuf +prost = "0.12" +prost-types = "0.12" + +# Protobuf for codegen, e.g. build.rs +prost-build = "0.12" +protox = "0.5" +glob = "0.3.0" + +# Http Request handling +http = { version = "0.2.*" } +reqwest = { version = "0.11" } +openssl = { version = "=0.10.68" } +http-cache-reqwest = { version = "0.4.5" } +reqwest-middleware = { version = "0.1.6" } + +# Serialization serde = "1.0.*" serde_json = "1.0.*" -futures = "0.3.*" -http = "0.2.*" -url = { version = "2.4", features = ["serde"] } -percent-encoding = "2.1" -chrono = "0.4.*" +serde_path_to_error = "0.1.*" + +# Utils +once_cell = "1" +itertools = "0.13" +getrandom = "0.2" +chrono = "0.4" +hex = "0.4" + +# Futures +futures = "0.3" + +[profile.release] +lto = true +opt-level = 3 + +[dependencies] +stremio-core.workspace = true +# stremio-core-web.workspace = true +stremio-core-protobuf.workspace = true + +serde.workspace = true +serde_json.workspace = true +serde_path_to_error.workspace = true + +strum = { version = "0.22.*", features = ["derive"] } + +# Utils +once_cell.workspace = true semver = { version = "1", features = ["serde"] } -base64 = "0.13.*" -hex = "0.4.*" -flate2 = "1.0.*" -either = "1.6.*" -lazy_static = "1.4.*" enclose = "1.1.*" -itertools = "0.10.*" -strum = { version = "0.22.*", features = ["derive"] } +itertools.workspace = true +chrono.workspace = true boolinator = "2.4.*" Inflector = "0.11.*" -getrandom = "0.2.*" cfg-if = "0.1.*" auto_impl = "0.5.*" -serde_path_to_error = "0.1.*" -jni = "0.19.*" -reqwest = { version = "0.11", features = ["json", "rustls-tls"] } -tokio = { version = "1", features = ["rt", "rt-multi-thread"] } -openssl = { version = "=0.10.40", features = ["vendored"] } + +base64 = "0.13.*" +hex.workspace = true +flate2 = "1.0.*" +url = { version = "2.4", features = ["serde"] } +percent-encoding = "2.1" + +# kotlin specific + Env impl +getrandom = { workspace = true, optional = true } + +jni = { version = "0.19.*", optional = true } + +# Async executor +tokio = { version = "1", features = ["rt", "rt-multi-thread"], optional = true } +# Futures +futures.workspace = true + +# Http Request handling +http = { workspace = true, optional = true } +reqwest = { workspace = true, features = ["json", "rustls-tls"], optional = true } +openssl = { workspace = true, features = ["vendored"], optional = true } +http-cache-reqwest = { workspace = true, optional = true } +reqwest-middleware = { workspace = true, optional = true } + +# Bytes / Protobuf bytes = "1.1.0" -prost = "0.12" -prost-types = "0.12" -http-cache-reqwest = "0.4.5" -reqwest-middleware = "0.1.6" -once_cell = "1.12.0" +prost.workspace = true +prost-types.workspace = true [build-dependencies] -prost-build = "0.12" -protox = "0.5" -glob = "0.3.0" +prost-build.workspace = true +protox.workspace = true +glob.workspace = true # A way to quickly test with local version of `core` crates # [patch.'https://github.com/Stremio/stremio-core'] -# stremio-core = { path = "../stremio-core" } +# stremio-core = { path = "../core" } +# stremio-core-web = { path = "../core/stremio-core-web" } diff --git a/README.md b/README.md index 259c7944..86ee2c3d 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,22 @@ [![](https://jitpack.io/v/Stremio/stremio-core-kotlin.svg)](https://jitpack.io/#Stremio/stremio-core-kotlin) -# Setup +## Setup -## Gradle +Prerequisite: +- Android NDK `27.2.12479018` + - The Linkers bin path needs to be added to your `$PATH` env. variable -### Add the JitPack repository to your root build.gradle + E.g.: `$ANDROID_HOME/ndk/$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin` (where ANDROID_HOME is installation folder for Android studio and `NDK_VERSION` is an env. variable set to `27.2.12479018`) + + - **Updating:** Needs to be updated in `.cargo/config.toml` for the + `stremio-core-kotlin` build, the [`.github/workflows/release.yml`](.github/workflows/release.yml) and [`build.gradle.kts`](build.gradle.kts) + +## Using the kotlin library + +### Gradle + +#### Add the JitPack repository to your root build.gradle ```gradle allprojects { @@ -17,7 +28,7 @@ allprojects { } ``` -### Add the stremio-core-kotlin dependency +#### Add the stremio-core-kotlin dependency ```gradle dependencies { diff --git a/build.gradle.kts b/build.gradle.kts index 2fbea8c2..14f67d64 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import com.android.build.api.dsl.AndroidSourceSet import com.google.protobuf.gradle.* import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -15,7 +16,7 @@ plugins { kotlin("multiplatform") version "1.8.0" id("maven-publish") id("com.android.library") version "7.2.2" - id("org.mozilla.rust-android-gradle.rust-android") version "0.9.0" + id("org.mozilla.rust-android-gradle.rust-android") version "0.9.4" id("com.google.protobuf") version "0.8.18" } @@ -46,6 +47,14 @@ buildscript { } } +fun AndroidSourceSet.proto(action: SourceDirectorySet.() -> Unit) { + (this as? ExtensionAware) + ?.extensions + ?.getByName("proto") + ?.let { it as? SourceDirectorySet } + ?.apply(action) +} + kotlin { android { // TODO: Adding a "debug" variant here results in failing imports in KMM projects. Figure out why. @@ -69,7 +78,7 @@ kotlin { android { compileSdk = 33 - ndkVersion = "21.4.7075529" + ndkVersion = "27.2.12479018" // configure in .cargo/config.toml and workflows/release.yml as well defaultConfig { minSdk = 21 @@ -78,6 +87,9 @@ android { sourceSets { getByName("main") { + proto { + srcDirs("stremio-core-protobuf/proto") + } manifest.srcFile("src/androidMain/AndroidManifest.xml") } } diff --git a/build.rs b/build.rs deleted file mode 100644 index ea016eb9..00000000 --- a/build.rs +++ /dev/null @@ -1,22 +0,0 @@ -use glob::glob; -use prost_build::Config; - -fn main() { - let proto_dir = "src/main/proto"; - let proto_paths = glob(format!("{proto_dir}/**/*.proto").as_str()) - .unwrap() - .filter_map(Result::ok) - .collect::>(); - for path in &proto_paths { - let display_path = path.display(); - println!("cargo:rerun-if-changed={display_path}"); - } - let file_descriptors = - protox::compile(proto_paths, [proto_dir]).expect("Expected file descriptors"); - Config::new() - .compile_well_known_types() - .out_dir("src/commonMain/rust/protobuf") - .include_file("mod.rs") - .compile_fds(file_descriptors) - .expect("Expected successful protobuf codegen"); -} diff --git a/src/commonMain/rust/bridge.rs b/src/commonMain/rust/bridge.rs new file mode 100644 index 00000000..5500f26f --- /dev/null +++ b/src/commonMain/rust/bridge.rs @@ -0,0 +1,12 @@ +//! This module contains all the bridge impls which take [`stremio_core`] types +//! and allow `FromProtobuf` and `ToProtobuf` for Protobuf generates structs and enums. +//! +//! # Bridge + +// Re-export the FromProtobuf and ToProtobuf from stremio_core_protobuf +pub use stremio_core_protobuf::{FromProtobuf, ToProtobuf}; + +mod android_model_field; + +mod to_jni_byte_array; +pub use to_jni_byte_array::*; diff --git a/src/commonMain/rust/bridge/android_model_field.rs b/src/commonMain/rust/bridge/android_model_field.rs index c092f882..37218496 100644 --- a/src/commonMain/rust/bridge/android_model_field.rs +++ b/src/commonMain/rust/bridge/android_model_field.rs @@ -1,20 +1,38 @@ +use stremio_core::runtime::Env; + use crate::bridge::{FromProtobuf, ToProtobuf}; +use crate::env::AndroidEnv; use crate::model::AndroidModelField; use crate::protobuf::stremio::core::runtime::Field; +impl From for AndroidModelField { + fn from(android_field: Field) -> Self { + android_field.from_protobuf() + } +} + +impl From for Field { + fn from(field: AndroidModelField) -> Self { + field.to_protobuf::(&()) + } +} + impl FromProtobuf for Field { fn from_protobuf(&self) -> AndroidModelField { match self { Field::Ctx => AndroidModelField::Ctx, Field::AuthLink => AndroidModelField::AuthLink, + Field::DataExport => AndroidModelField::DataExport, Field::ContinueWatchingPreview => AndroidModelField::ContinueWatchingPreview, + Field::Board => AndroidModelField::Board, Field::Discover => AndroidModelField::Discover, Field::Library => AndroidModelField::Library, Field::LibraryByType => AndroidModelField::LibraryByType, - Field::Board => AndroidModelField::Board, + Field::ContinueWatching => AndroidModelField::ContinueWatching, Field::Search => AndroidModelField::Search, - Field::MetaDetails => AndroidModelField::MetaDetails, + Field::LocalSearch => AndroidModelField::LocalSearch, Field::Addons => AndroidModelField::Addons, + Field::MetaDetails => AndroidModelField::MetaDetails, Field::AddonDetails => AndroidModelField::AddonDetails, Field::StreamingServer => AndroidModelField::StreamingServer, Field::Player => AndroidModelField::Player, @@ -23,18 +41,21 @@ impl FromProtobuf for Field { } impl ToProtobuf for AndroidModelField { - fn to_protobuf(&self, _args: &()) -> Field { + fn to_protobuf(&self, _args: &()) -> Field { match self { AndroidModelField::Ctx => Field::Ctx, AndroidModelField::AuthLink => Field::AuthLink, + AndroidModelField::DataExport => Field::DataExport, AndroidModelField::ContinueWatchingPreview => Field::ContinueWatchingPreview, + AndroidModelField::Board => Field::Board, AndroidModelField::Discover => Field::Discover, AndroidModelField::Library => Field::Library, AndroidModelField::LibraryByType => Field::LibraryByType, - AndroidModelField::Board => Field::Board, + AndroidModelField::ContinueWatching => Field::ContinueWatching, AndroidModelField::Search => Field::Search, - AndroidModelField::MetaDetails => Field::MetaDetails, + AndroidModelField::LocalSearch => Field::LocalSearch, AndroidModelField::Addons => Field::Addons, + AndroidModelField::MetaDetails => Field::MetaDetails, AndroidModelField::AddonDetails => Field::AddonDetails, AndroidModelField::StreamingServer => Field::StreamingServer, AndroidModelField::Player => Field::Player, diff --git a/src/commonMain/rust/bridge/mod.rs b/src/commonMain/rust/bridge/mod.rs deleted file mode 100644 index 87a3d635..00000000 --- a/src/commonMain/rust/bridge/mod.rs +++ /dev/null @@ -1,80 +0,0 @@ -mod action; -pub use action::*; - -mod android_model_field; -pub use android_model_field::*; - -mod auth_request; -pub use auth_request::*; - -mod date; -pub use date::*; - -mod env_error; -pub use env_error::*; - -mod event; -pub use event::*; - -mod events; -pub use events::*; - -mod extra_value; -pub use extra_value::*; - -mod library_item; -pub use library_item::*; - -mod link; -pub use link::*; - -mod list; -pub use list::*; - -mod loadable; -pub use loadable::*; - -mod manifest; -pub use manifest::*; - -mod meta_preview; -pub use meta_preview::*; - -mod option; -pub use option::*; - -mod pair; -pub use pair::*; - -mod poster_shape; -pub use poster_shape::*; - -mod profile; -pub use profile::*; - -mod resource_loadable; -pub use resource_loadable::*; - -mod resource_path; -pub use resource_path::*; - -mod resource_request; -pub use resource_request::*; - -mod stream; -pub use stream::*; - -mod string; -pub use string::*; - -mod subtitle; -pub use subtitle::*; - -mod to_protobuf; -pub use to_protobuf::*; - -mod from_protobuf; -pub use from_protobuf::*; - -mod to_jni_byte_array; -pub use to_jni_byte_array::*; diff --git a/src/commonMain/rust/bridge/to_protobuf.rs b/src/commonMain/rust/bridge/to_protobuf.rs deleted file mode 100644 index 1362ef22..00000000 --- a/src/commonMain/rust/bridge/to_protobuf.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub trait ToProtobuf { - fn to_protobuf(&self, args: &A) -> T; -} diff --git a/src/commonMain/rust/env/env.rs b/src/commonMain/rust/env/env.rs index eaae1ca6..8f8e0cbb 100644 --- a/src/commonMain/rust/env/env.rs +++ b/src/commonMain/rust/env/env.rs @@ -5,13 +5,13 @@ use std::{ }; use chrono::{DateTime, Utc}; -use futures::{Future, TryFutureExt}; +use futures::Future; use http::Request; use jni::{ objects::{GlobalRef, JObject}, JNIEnv, }; -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use serde_json::json; use strum::IntoEnumIterator; @@ -33,29 +33,32 @@ const LOG_DEBUG_PRIORITY: i32 = 3; #[cfg(debug_assertions)] const LOG_TAG: &str = "AndroidEnv"; -lazy_static! { - static ref CONCURRENT_RUNTIME: RwLock = RwLock::new( +static CONCURRENT_RUNTIME: Lazy> = Lazy::new(|| { + RwLock::new( tokio::runtime::Builder::new_multi_thread() .thread_name("CONCURRENT_RUNTIME_THREAD") .worker_threads(30) .enable_all() .build() - .expect("CONCURRENT_RUNTIME create failed") - ); - static ref SEQUENTIAL_RUNTIME: RwLock = RwLock::new( + .expect("CONCURRENT_RUNTIME create failed"), + ) +}); +static SEQUENTIAL_RUNTIME: Lazy> = Lazy::new(|| { + RwLock::new( tokio::runtime::Builder::new_multi_thread() .worker_threads(1) .thread_name("SEQUENTIAL_RUNTIME_THREAD") .enable_all() .build() - .expect("SEQUENTIAL_RUNTIME create failed") - ); - static ref KOTLIN_CLASSES: RwLock> = Default::default(); - static ref STORAGE: RwLock> = Default::default(); - static ref ANALYTICS: Analytics = Default::default(); - static ref INSTALLATION_ID: RwLock> = Default::default(); - static ref VISIT_ID: String = hex::encode(AndroidEnv::random_buffer(10)); -} + .expect("SEQUENTIAL_RUNTIME create failed"), + ) +}); +static KOTLIN_CLASSES: Lazy>> = + Lazy::new(Default::default); +static STORAGE: Lazy>> = Lazy::new(Default::default); +static ANALYTICS: Lazy> = Lazy::new(Default::default); +static INSTALLATION_ID: Lazy>> = Lazy::new(Default::default); +static VISIT_ID: Lazy = Lazy::new(|| hex::encode(AndroidEnv::random_buffer(10))); extern "C" { fn __android_log_write(prio: c_int, tag: *const c_char, text: *const c_char) -> c_int; @@ -86,15 +89,17 @@ impl AndroidEnv { load_kotlin_classes(env).expect("kotlin classes load failed"); *STORAGE.write().expect("STORAGE write failed") = Some(Storage::new(env, storage).expect("Create Storage failed")); - AndroidEnv::migrate_storage_schema() - .and_then(|_| async { - let installation_id = get_installation_id().await?; - *INSTALLATION_ID - .write() - .expect("INSTALLATION_ID write failed") = Some(installation_id); - Ok(()) - }) - .boxed_env() + + async { + Self::migrate_storage_schema().await?; + + let installation_id = get_installation_id().await?; + *INSTALLATION_ID + .write() + .expect("INSTALLATION_ID write failed") = Some(installation_id); + Ok(()) + } + .boxed_env() } pub fn kotlin_classes<'a>( ) -> LockResult>> { diff --git a/src/commonMain/rust/env/fetch.rs b/src/commonMain/rust/env/fetch.rs index f0af4e4b..3bc2624d 100644 --- a/src/commonMain/rust/env/fetch.rs +++ b/src/commonMain/rust/env/fetch.rs @@ -2,7 +2,6 @@ use std::convert::TryFrom; use std::env; use std::time::Duration; -use futures::future::Either; use futures::{future, TryFutureExt}; use http::{Method, Request}; use http_cache_reqwest::{CACacheManager, Cache, CacheMode, HttpCache}; @@ -60,32 +59,30 @@ pub fn fetch Deserialize<'de> + Se .build() }) }; - client - .execute(request) - .map_err(|error| EnvError::Fetch(error.to_string())) - .and_then(|resp| { - if !resp.status().is_success() { - Either::Right(future::err(EnvError::Fetch(format!( - "Unexpected HTTP status code {}", - resp.status().as_u16(), - )))) - } else { - Either::Left( - resp.bytes() - .map_err(|error| EnvError::Fetch(error.to_string())), - ) - } - }) - .and_then(|body| { - let mut deserializer = Deserializer::from_slice(body.as_ref()); - cfg_if::cfg_if! { - if #[cfg(debug_assertions)] { - let result = serde_path_to_error::deserialize::<_, OUT>(&mut deserializer); - } else { - let result = OUT::deserialize(&mut deserializer); - } - }; - future::ready(result.map_err(|error| EnvError::Serde(error.to_string()))) - }) - .boxed_env() + + let fut = async { + let resp = client + .execute(request) + .map_err(|error| EnvError::Fetch(error.to_string())) + .await?; + + let body = if !resp.status().is_success() { + return Err(EnvError::Fetch(format!( + "Unexpected HTTP status code {}", + resp.status().as_u16(), + ))); + } else { + resp.bytes() + .await + .map_err(|error| EnvError::Fetch(error.to_string()))? + }; + + let mut deserializer = Deserializer::from_slice(body.as_ref()); + let result = serde_path_to_error::deserialize::<_, OUT>(&mut deserializer); + + result.map_err(|error| EnvError::Serde(error.to_string())) + // .boxed_env() + }; + + fut.boxed_env() } diff --git a/src/commonMain/rust/env/mod.rs b/src/commonMain/rust/env/mod.rs deleted file mode 100644 index 7cf22e69..00000000 --- a/src/commonMain/rust/env/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod env; -pub use env::*; - -mod event; -pub use event::*; - -mod fetch; -use fetch::*; - -mod kotlin_class_name; -pub use kotlin_class_name::*; - -mod storage; -use storage::*; diff --git a/src/commonMain/rust/lib.rs b/src/commonMain/rust/lib.rs index eb91b062..2b1a116a 100644 --- a/src/commonMain/rust/lib.rs +++ b/src/commonMain/rust/lib.rs @@ -1,10 +1,45 @@ #![allow(clippy::module_inception)] -mod bridge; -mod env; -mod model; +#[cfg(feature = "kotlin")] +// Re-export the kotlin-specific impls +pub use stremio_core_android::*; + +#[cfg(feature = "kotlin")] +pub mod bridge; + +#[cfg(feature = "kotlin")] +/// Contains all android (kotlin) related implementations for the bridge between +/// Rust and Kotlin. +/// +/// - [AndroidEnv](crate::env::AndroidEnv) +/// - [Storage](crate::env::Storage) +/// - [Making requests](crate::env::fetch) +/// - [AndroidEvent](crate::env::AndroidEvent)s +pub mod env { + mod env; + pub use env::*; + + mod event; + pub use event::*; + + mod fetch; + pub use fetch::*; + + mod kotlin_class_name; + pub use kotlin_class_name::*; + + mod storage; + pub use storage::*; +} + +pub mod model; #[allow(clippy::all)] -mod protobuf; +/// Protobuf generated module +pub mod protobuf { + pub use stremio_core_protobuf::protobuf::*; +} -mod jni_ext; +#[cfg(feature = "kotlin")] +pub mod jni_ext; +#[cfg(feature = "kotlin")] mod stremio_core_android; diff --git a/src/commonMain/rust/model.rs b/src/commonMain/rust/model.rs new file mode 100644 index 00000000..95bd5f63 --- /dev/null +++ b/src/commonMain/rust/model.rs @@ -0,0 +1,7 @@ +#[cfg(feature = "kotlin")] +pub use model::*; + +#[cfg(feature = "kotlin")] +// model is only available when the feature is enabled +// because of the `AndroidEnv` impl +mod model; diff --git a/src/commonMain/rust/model/fields/addon_detail.rs b/src/commonMain/rust/model/fields/addon_detail.rs deleted file mode 100644 index 2f5630c0..00000000 --- a/src/commonMain/rust/model/fields/addon_detail.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::bridge::{FromProtobuf, ToProtobuf}; -use crate::protobuf::stremio::core::models; -use stremio_core::models::addon_details::{AddonDetails, Selected}; -use stremio_core::models::ctx::Ctx; - -impl FromProtobuf for models::addon_details::Selected { - fn from_protobuf(&self) -> Selected { - Selected { - transport_url: self.transport_url.from_protobuf(), - } - } -} - -impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::addon_details::Selected { - models::addon_details::Selected { - transport_url: self.transport_url.to_string(), - } - } -} - -impl ToProtobuf for AddonDetails { - fn to_protobuf(&self, ctx: &Ctx) -> models::AddonDetails { - models::AddonDetails { - selected: self.selected.to_protobuf(&()), - local_addon: self.local_addon.to_protobuf(ctx), - remote_addon: self.remote_addon.to_protobuf(ctx), - } - } -} diff --git a/src/commonMain/rust/model/fields/ctx.rs b/src/commonMain/rust/model/fields/ctx.rs deleted file mode 100644 index 19bfb39c..00000000 --- a/src/commonMain/rust/model/fields/ctx.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::bridge::ToProtobuf; -use crate::protobuf::stremio::core::models; -use stremio_core::models::ctx::Ctx; - -impl ToProtobuf for Ctx { - fn to_protobuf(&self, _args: &()) -> models::Ctx { - models::Ctx { - profile: self.profile.to_protobuf(&()), - events: self.events.to_protobuf(&()), - } - } -} diff --git a/src/commonMain/rust/model/fields/mod.rs b/src/commonMain/rust/model/fields/mod.rs deleted file mode 100644 index 129d57ef..00000000 --- a/src/commonMain/rust/model/fields/mod.rs +++ /dev/null @@ -1,35 +0,0 @@ -mod addon_detail; -pub use addon_detail::*; - -mod addons_with_filters; -pub use addons_with_filters::*; - -mod catalogs_with_extra; -pub use catalogs_with_extra::*; - -mod continue_watching_preview; -pub use continue_watching_preview::*; - -mod ctx; -pub use ctx::*; - -mod discover; -pub use discover::*; - -mod library; -pub use library::*; - -mod library_by_type; -pub use library_by_type::*; - -mod link; -pub use link::*; - -mod meta_details; -pub use meta_details::*; - -mod player; -pub use player::*; - -mod streaming_server; -pub use streaming_server::*; diff --git a/src/commonMain/rust/model/mod.rs b/src/commonMain/rust/model/mod.rs deleted file mode 100644 index 889644d4..00000000 --- a/src/commonMain/rust/model/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod fields; - -mod addons; -pub use addons::*; - -mod model; -pub use model::*; diff --git a/src/commonMain/rust/model/model.rs b/src/commonMain/rust/model/model.rs index 6ca00ed7..855a49e2 100644 --- a/src/commonMain/rust/model/model.rs +++ b/src/commonMain/rust/model/model.rs @@ -1,43 +1,51 @@ use prost::Message; -use stremio_core::models::addon_details::AddonDetails; -use stremio_core::models::catalog_with_filters::CatalogWithFilters; -use stremio_core::models::catalogs_with_extra::CatalogsWithExtra; -use stremio_core::models::continue_watching_preview::ContinueWatchingPreview; -use stremio_core::models::ctx::Ctx; -use stremio_core::models::library_by_type::LibraryByType; -use stremio_core::models::library_with_filters::{LibraryWithFilters, NotRemovedFilter}; -use stremio_core::models::link::Link; -use stremio_core::models::meta_details::MetaDetails; -use stremio_core::models::player::Player; -use stremio_core::models::streaming_server::StreamingServer; -use stremio_core::runtime::Effects; -use stremio_core::types::api::LinkAuthKey; -use stremio_core::types::events::DismissedEventsBucket; -use stremio_core::types::library::LibraryBucket; -use stremio_core::types::notifications::NotificationsBucket; -use stremio_core::types::profile::Profile; -use stremio_core::types::resource::MetaItemPreview; -use stremio_core::types::search_history::SearchHistoryBucket; -use stremio_core::types::streams::StreamsBucket; -use stremio_core::Model; -use crate::bridge::ToProtobuf; -use crate::env::AndroidEnv; -use crate::model::AddonsWithFilters; +use stremio_core::{ + models::{ + addon_details::AddonDetails, + catalog_with_filters::CatalogWithFilters, + catalogs_with_extra::CatalogsWithExtra, + continue_watching_preview::ContinueWatchingPreview, + ctx::Ctx, + data_export::DataExport, + library_by_type::LibraryByType, + library_with_filters::{ContinueWatchingFilter, LibraryWithFilters, NotRemovedFilter}, + link::Link, + local_search::LocalSearch, + meta_details::MetaDetails, + player::Player, + streaming_server::StreamingServer, + }, + runtime::Effects, + types::{ + api::LinkAuthKey, events::DismissedEventsBucket, library::LibraryBucket, + notifications::NotificationsBucket, profile::Profile, resource::MetaItemPreview, + search_history::SearchHistoryBucket, streams::StreamsBucket, + }, + Model, +}; +use stremio_core_protobuf::model::AddonsWithFilters; + +use crate::{bridge::ToProtobuf, env::AndroidEnv}; #[derive(Model, Clone)] #[model(AndroidEnv)] pub struct AndroidModel { pub ctx: Ctx, pub auth_link: Link, + pub data_export: DataExport, pub continue_watching_preview: ContinueWatchingPreview, + pub board: CatalogsWithExtra, pub discover: CatalogWithFilters, pub library: LibraryWithFilters, pub library_by_type: LibraryByType, - pub board: CatalogsWithExtra, + pub continue_watching: LibraryWithFilters, pub search: CatalogsWithExtra, - pub meta_details: MetaDetails, + /// Pre-loaded results for local search + pub local_search: LocalSearch, + /// contains the remote and installed addons pub addons: AddonsWithFilters, + pub meta_details: MetaDetails, pub addon_details: AddonDetails, pub streaming_server: StreamingServer, pub player: Player, @@ -55,29 +63,34 @@ impl AndroidModel { let (continue_watching_preview, continue_watching_preview_effects) = ContinueWatchingPreview::new(&library, ¬ifications); - let ctx = Ctx::new( - profile, - library, - streams, - notifications, - search_history, - dismissed_events, - ); - - let (discover, discover_effects) = CatalogWithFilters::::new(&ctx.profile); + let (discover, discover_effects) = CatalogWithFilters::::new(&profile); let (library_, library_effects) = - LibraryWithFilters::::new(&ctx.library, &ctx.notifications); + LibraryWithFilters::::new(&library, ¬ifications); let (library_by_type, library_by_type_effects) = LibraryByType::::new(); - let (addons, addons_effects) = AddonsWithFilters::new(&ctx.profile); + let (continue_watching, continue_watching_effects) = + LibraryWithFilters::::new(&library, ¬ifications); + let (addons, addons_effects) = AddonsWithFilters::new(&profile); let (streaming_server, streaming_server_effects) = - StreamingServer::new::(&ctx.profile); + StreamingServer::new::(&profile); + let (local_search, local_search_effects) = LocalSearch::new::(); + let model = AndroidModel { - ctx, + ctx: Ctx::new( + profile, + library, + streams, + notifications, + search_history, + dismissed_events, + ), auth_link: Default::default(), + data_export: Default::default(), + local_search, continue_watching_preview, discover, library: library_, library_by_type, + continue_watching, board: Default::default(), search: Default::default(), meta_details: Default::default(), @@ -92,37 +105,83 @@ impl AndroidModel { .join(discover_effects) .join(library_effects) .join(library_by_type_effects) + .join(continue_watching_effects) .join(addons_effects) - .join(streaming_server_effects), + .join(streaming_server_effects) + .join(local_search_effects), ) } pub fn get_state_binary(&self, field: &AndroidModelField) -> Vec { match field { - AndroidModelField::Ctx => self.ctx.to_protobuf(&()).encode_to_vec(), - AndroidModelField::AuthLink => self.auth_link.to_protobuf(&()).encode_to_vec(), + AndroidModelField::Ctx => self.ctx.to_protobuf::(&()).encode_to_vec(), + AndroidModelField::AuthLink => self + .auth_link + .to_protobuf::(&()) + .encode_to_vec(), + AndroidModelField::DataExport => { + unimplemented!("You've requested unimplemented field: DataExport") + // self.data_export.to_protobuf::(&()).encode_to_vec() + } AndroidModelField::ContinueWatchingPreview => self .continue_watching_preview - .to_protobuf(&self.ctx) + .to_protobuf::(&self.ctx) .encode_to_vec(), - AndroidModelField::Library => self.library.to_protobuf(&self.ctx).encode_to_vec(), - AndroidModelField::LibraryByType => { - self.library_by_type.to_protobuf(&self.ctx).encode_to_vec() - } - AndroidModelField::Board => self.board.to_protobuf(&self.ctx).encode_to_vec(), - AndroidModelField::Search => self.search.to_protobuf(&self.ctx).encode_to_vec(), - AndroidModelField::Discover => self.discover.to_protobuf(&self.ctx).encode_to_vec(), - AndroidModelField::MetaDetails => { - self.meta_details.to_protobuf(&self.ctx).encode_to_vec() - } - AndroidModelField::Addons => self.addons.to_protobuf(&self.ctx).encode_to_vec(), - AndroidModelField::AddonDetails => { - self.addon_details.to_protobuf(&self.ctx).encode_to_vec() - } - AndroidModelField::StreamingServer => { - self.streaming_server.to_protobuf(&()).encode_to_vec() + AndroidModelField::Board => self + .board + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::Discover => self + .discover + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::Library => self + .library + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::LibraryByType => self + .library_by_type + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::ContinueWatching => self + .continue_watching + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::Search => self + .search + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::LocalSearch => { + unimplemented!("You've requested unimplemented field: LocalSearch") + // self + // .local_search + // .to_protobuf::(&self.ctx) + // .encode_to_vec() } - AndroidModelField::Player => self.player.to_protobuf(&self.ctx).encode_to_vec(), + AndroidModelField::Addons => self + .addons + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::MetaDetails => self + .meta_details + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::AddonDetails => self + .addon_details + .to_protobuf::(&self.ctx) + .encode_to_vec(), + AndroidModelField::StreamingServer => self + .streaming_server + .to_protobuf::(&()) + .encode_to_vec(), + AndroidModelField::Player => self + .player + .to_protobuf::(&self.ctx) + .encode_to_vec(), + + // guard against new fields being added to the CSharp model + #[allow(unreachable_patterns)] + _ => unimplemented!("You've requested unimplemented field"), } } } diff --git a/src/commonMain/rust/protobuf/README.md b/src/commonMain/rust/protobuf/README.md deleted file mode 100644 index ef9ed9c9..00000000 --- a/src/commonMain/rust/protobuf/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Protobuf - -In this directory protobuf files are generated during build. -Files are generated inside `rust` dir and not the regular debug `out` dir so that it would be easier to integrate them -with IDEs. \ No newline at end of file diff --git a/src/commonMain/rust/stremio_core_android.rs b/src/commonMain/rust/stremio_core_android.rs index d2611ea7..9c487648 100644 --- a/src/commonMain/rust/stremio_core_android.rs +++ b/src/commonMain/rust/stremio_core_android.rs @@ -1,42 +1,48 @@ -use std::io::Cursor; -use std::os::raw::c_void; +// TODO: Add safety docs and remove suppression of linter! +#![allow(clippy::missing_safety_doc)] + #[cfg(debug_assertions)] use std::panic; -use std::sync::RwLock; +use std::{io::Cursor, os::raw::c_void, sync::RwLock}; use enclose::enclose; use futures::{future, StreamExt}; -use jni::objects::{JClass, JObject}; -use jni::sys::{jbyteArray, jint, jobject, JNI_VERSION_1_6}; -use jni::{JNIEnv, JavaVM}; -use lazy_static::lazy_static; +use jni::{ + objects::{JClass, JObject}, + sys::{jbyteArray, jint, jobject, JNI_VERSION_1_6}, + JNIEnv, JavaVM, +}; + +use once_cell::sync::Lazy; use prost::Message; -use stremio_core::constants::{ - DISMISSED_EVENTS_STORAGE_KEY, LIBRARY_RECENT_STORAGE_KEY, LIBRARY_STORAGE_KEY, - NOTIFICATIONS_STORAGE_KEY, PROFILE_STORAGE_KEY, SEARCH_HISTORY_STORAGE_KEY, - STREAMS_STORAGE_KEY, + +use stremio_core::{ + constants::{ + DISMISSED_EVENTS_STORAGE_KEY, LIBRARY_RECENT_STORAGE_KEY, LIBRARY_STORAGE_KEY, + NOTIFICATIONS_STORAGE_KEY, PROFILE_STORAGE_KEY, SEARCH_HISTORY_STORAGE_KEY, + STREAMS_STORAGE_KEY, + }, + models::common::Loadable, + runtime::{Env, EnvError, Runtime, RuntimeEvent}, + types::{ + events::DismissedEventsBucket, library::LibraryBucket, notifications::NotificationsBucket, + profile::Profile, resource::Stream, search_history::SearchHistoryBucket, + streams::StreamsBucket, + }, }; -use stremio_core::models::common::Loadable; -use stremio_core::runtime::{Env, EnvError, Runtime, RuntimeEvent}; -use stremio_core::types::events::DismissedEventsBucket; -use stremio_core::types::library::LibraryBucket; -use stremio_core::types::notifications::NotificationsBucket; -use stremio_core::types::profile::Profile; -use stremio_core::types::resource::Stream; -use stremio_core::types::search_history::SearchHistoryBucket; -use stremio_core::types::streams::StreamsBucket; +use stremio_core_protobuf::{FromProtobuf, ToProtobuf}; -use crate::bridge::{FromProtobuf, ToJNIByteArray, ToProtobuf}; -use crate::env::{AndroidEnv, AndroidEvent, KotlinClassName}; -use crate::jni_ext::ExceptionDescribeExt; -use crate::model::AndroidModel; -use crate::protobuf::stremio::core::runtime; -use crate::protobuf::stremio::core::runtime::Field; +use crate::{ + bridge::ToJNIByteArray, + env::{AndroidEnv, AndroidEvent, KotlinClassName}, + jni_ext::ExceptionDescribeExt, + model::AndroidModel, + protobuf::stremio::core::runtime::{self, Field}, +}; -lazy_static! { - static ref RUNTIME: RwLock, EnvError>>> = - Default::default(); -} +#[allow(clippy::type_complexity)] +static RUNTIME: Lazy, EnvError>>>> = + Lazy::new(Default::default); #[no_mangle] pub unsafe extern "C" fn JNI_OnLoad(_: JavaVM, _: *mut c_void) -> jint { @@ -132,7 +138,7 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_initializeNative( .attach_current_thread_as_daemon() .expect("JavaVM attach to current thread as deamon failed"); let event = event - .to_protobuf(&()) + .to_protobuf::(&()) .encode_to_vec() .to_jni_byte_array(&env); let event = env.auto_local(event); @@ -154,7 +160,7 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_initializeNative( *RUNTIME.write().expect("RUNTIME write failed") = Some(Loadable::Err(error.to_owned())); error - .to_protobuf(&()) + .to_protobuf::(&()) .encode_to_vec() .to_jni_byte_array(&env) } @@ -163,7 +169,7 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_initializeNative( Err(error) => { *RUNTIME.write().expect("RUNTIME write failed") = Some(Loadable::Err(error.to_owned())); error - .to_protobuf(&()) + .to_protobuf::(&()) .encode_to_vec() .to_jni_byte_array(&env) } @@ -231,7 +237,7 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_decodeStreamDataNative( Err(_) => return JObject::null().into_inner(), }; stream - .to_protobuf(&(None, None, None, None)) + .to_protobuf::(&(None, None, None, None)) .encode_to_vec() .to_jni_byte_array(&env) } diff --git a/src/main/proto/stremio/core/runtime/field.proto b/src/main/proto/stremio/core/runtime/field.proto deleted file mode 100644 index b475ca67..00000000 --- a/src/main/proto/stremio/core/runtime/field.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto2"; - -package stremio.core.runtime; - -option java_package = "com.stremio.core"; - -enum Field { - Ctx = 0; - AuthLink = 1; - ContinueWatchingPreview = 2; - Discover = 3; - Library = 4; - LibraryByType = 5; - Board = 6; - Search = 7; - MetaDetails = 8; - Addons = 9; - AddonDetails = 10; - StreamingServer = 11; - Player = 12; -} \ No newline at end of file diff --git a/stremio-core-protobuf/Cargo.toml b/stremio-core-protobuf/Cargo.toml new file mode 100644 index 00000000..6a9de84e --- /dev/null +++ b/stremio-core-protobuf/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "stremio-core-protobuf" +version = "0.1.0" +edition = "2021" + +authors = ["Smart Code OOD", "Lachezar Lechev "] + +[lib] +crate-type = ["rlib", "staticlib", "dylib"] + +[features] +default = [] + +[dependencies] +stremio-core.workspace = true + +# Protobuf +prost.workspace = true +prost-types.workspace = true + +# Utils +semver = { version = "1", features = ["serde"] } +chrono = "0.4.*" +boolinator = "2.4.*" +Inflector = "0.11.*" +itertools.workspace = true + +hex = "0.4.*" +url = { version = "2.4", features = ["serde"] } + +[build-dependencies] +prost-build.workspace = true +protox.workspace = true +glob.workspace = true \ No newline at end of file diff --git a/stremio-core-protobuf/build.rs b/stremio-core-protobuf/build.rs new file mode 100644 index 00000000..4b27a176 --- /dev/null +++ b/stremio-core-protobuf/build.rs @@ -0,0 +1,43 @@ +use std::{fs::DirBuilder, path::PathBuf}; + +use glob::glob; +use prost_build::Config; + +pub const CARGO_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); +fn main() { + let proto_dir = PathBuf::from(CARGO_MANIFEST_DIR).join("proto"); + + let proto_paths = glob(format!("{}/**/*.proto", proto_dir.display()).as_str()) + .unwrap() + .filter_map(|result| { + if let Err(err) = &result { + eprintln!("Glob error: {err}"); + } + + result.ok() + }) + .collect::>(); + + for path in &proto_paths { + let display_path = path.display(); + println!("cargo:rerun-if-changed={display_path}"); + } + let file_descriptors = + protox::compile(proto_paths, [proto_dir]).expect("Expected file descriptors"); + + let protobuf_gen_dir = PathBuf::from(CARGO_MANIFEST_DIR) + .join("src") + .join("protobuf"); + // create protobuf folder if it doesn't exist + DirBuilder::new() + .recursive(true) + .create(protobuf_gen_dir.clone()) + .expect("Should create src/protobuf dir if it does not exist."); + + Config::new() + .compile_well_known_types() + .out_dir(protobuf_gen_dir.display().to_string()) + .include_file("mod.rs") + .compile_fds(file_descriptors) + .expect("Expected successful protobuf codegen"); +} diff --git a/src/main/proto/stremio/core/models/addon_details.proto b/stremio-core-protobuf/proto/stremio/core/models/addon_details.proto similarity index 81% rename from src/main/proto/stremio/core/models/addon_details.proto rename to stremio-core-protobuf/proto/stremio/core/models/addon_details.proto index 6595e924..faeaa953 100644 --- a/src/main/proto/stremio/core/models/addon_details.proto +++ b/stremio-core-protobuf/proto/stremio/core/models/addon_details.proto @@ -9,7 +9,7 @@ import "stremio/core/types/manifest.proto"; message AddonDetails { optional Selected selected = 1; - optional stremio.core.types.Descriptor local_addon = 2; + optional stremio.core.types.AddonDescriptor local_addon = 2; optional LoadableDescriptor remote_addon = 3; message Selected { @@ -22,6 +22,6 @@ message LoadableDescriptor { oneof content { Loading loading = 2; Error error = 3; - stremio.core.types.Descriptor ready = 4; + stremio.core.types.AddonDescriptor ready = 4; } } \ No newline at end of file diff --git a/src/main/proto/stremio/core/models/addons_with_filters.proto b/stremio-core-protobuf/proto/stremio/core/models/addons_with_filters.proto similarity index 100% rename from src/main/proto/stremio/core/models/addons_with_filters.proto rename to stremio-core-protobuf/proto/stremio/core/models/addons_with_filters.proto diff --git a/src/main/proto/stremio/core/models/catalog_with_filters.proto b/stremio-core-protobuf/proto/stremio/core/models/catalog_with_filters.proto similarity index 100% rename from src/main/proto/stremio/core/models/catalog_with_filters.proto rename to stremio-core-protobuf/proto/stremio/core/models/catalog_with_filters.proto diff --git a/src/main/proto/stremio/core/models/catalogs_with_extra.proto b/stremio-core-protobuf/proto/stremio/core/models/catalogs_with_extra.proto similarity index 100% rename from src/main/proto/stremio/core/models/catalogs_with_extra.proto rename to stremio-core-protobuf/proto/stremio/core/models/catalogs_with_extra.proto diff --git a/src/main/proto/stremio/core/models/continue_watching_preview.proto b/stremio-core-protobuf/proto/stremio/core/models/continue_watching_preview.proto similarity index 100% rename from src/main/proto/stremio/core/models/continue_watching_preview.proto rename to stremio-core-protobuf/proto/stremio/core/models/continue_watching_preview.proto diff --git a/src/main/proto/stremio/core/models/ctx.proto b/stremio-core-protobuf/proto/stremio/core/models/ctx.proto similarity index 100% rename from src/main/proto/stremio/core/models/ctx.proto rename to stremio-core-protobuf/proto/stremio/core/models/ctx.proto diff --git a/src/main/proto/stremio/core/models/library_by_type.proto b/stremio-core-protobuf/proto/stremio/core/models/library_by_type.proto similarity index 100% rename from src/main/proto/stremio/core/models/library_by_type.proto rename to stremio-core-protobuf/proto/stremio/core/models/library_by_type.proto diff --git a/src/main/proto/stremio/core/models/library_with_filters.proto b/stremio-core-protobuf/proto/stremio/core/models/library_with_filters.proto similarity index 100% rename from src/main/proto/stremio/core/models/library_with_filters.proto rename to stremio-core-protobuf/proto/stremio/core/models/library_with_filters.proto diff --git a/src/main/proto/stremio/core/models/link.proto b/stremio-core-protobuf/proto/stremio/core/models/link.proto similarity index 100% rename from src/main/proto/stremio/core/models/link.proto rename to stremio-core-protobuf/proto/stremio/core/models/link.proto diff --git a/src/main/proto/stremio/core/models/loadable.proto b/stremio-core-protobuf/proto/stremio/core/models/loadable.proto similarity index 100% rename from src/main/proto/stremio/core/models/loadable.proto rename to stremio-core-protobuf/proto/stremio/core/models/loadable.proto diff --git a/src/main/proto/stremio/core/models/meta_details.proto b/stremio-core-protobuf/proto/stremio/core/models/meta_details.proto similarity index 100% rename from src/main/proto/stremio/core/models/meta_details.proto rename to stremio-core-protobuf/proto/stremio/core/models/meta_details.proto diff --git a/src/main/proto/stremio/core/models/player.proto b/stremio-core-protobuf/proto/stremio/core/models/player.proto similarity index 100% rename from src/main/proto/stremio/core/models/player.proto rename to stremio-core-protobuf/proto/stremio/core/models/player.proto diff --git a/src/main/proto/stremio/core/models/streaming_server.proto b/stremio-core-protobuf/proto/stremio/core/models/streaming_server.proto similarity index 88% rename from src/main/proto/stremio/core/models/streaming_server.proto rename to stremio-core-protobuf/proto/stremio/core/models/streaming_server.proto index d305cd97..866b717d 100644 --- a/src/main/proto/stremio/core/models/streaming_server.proto +++ b/stremio-core-protobuf/proto/stremio/core/models/streaming_server.proto @@ -30,12 +30,13 @@ message StreamingServer { optional string remote_https = 4; optional string transcode_profile = 5; optional double cache_size = 6; - required uint64 bt_max_connections = 7; - required uint64 bt_handshake_timeout = 8; - required uint64 bt_request_timeout = 9; - required double bt_download_speed_soft_limit = 10; - required double bt_download_speed_hard_limit = 11; - required uint64 bt_min_peers_for_stable = 12; + required bool proxy_streams_enabled = 7; + required uint64 bt_max_connections = 8; + required uint64 bt_handshake_timeout = 9; + required uint64 bt_request_timeout = 10; + required double bt_download_speed_soft_limit = 11; + required double bt_download_speed_hard_limit = 12; + required uint64 bt_min_peers_for_stable = 13; } message Statistics { required string name = 1; diff --git a/src/main/proto/stremio/core/runtime/action.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action.proto diff --git a/src/main/proto/stremio/core/runtime/action_catalog_with_filters.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_catalog_with_filters.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_catalog_with_filters.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_catalog_with_filters.proto diff --git a/src/main/proto/stremio/core/runtime/action_catalogs_with_extra.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_catalogs_with_extra.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_catalogs_with_extra.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_catalogs_with_extra.proto diff --git a/src/main/proto/stremio/core/runtime/action_ctx.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto similarity index 89% rename from src/main/proto/stremio/core/runtime/action_ctx.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto index b4f82149..d85bc5c7 100644 --- a/src/main/proto/stremio/core/runtime/action_ctx.proto +++ b/stremio-core-protobuf/proto/stremio/core/runtime/action_ctx.proto @@ -14,11 +14,11 @@ message ActionCtx { oneof args { stremio.core.types.AuthRequest authenticate = 1; google.protobuf.Empty logout = 2; - stremio.core.types.Descriptor install_addon = 3; + stremio.core.types.AddonDescriptor install_addon = 3; google.protobuf.Empty install_trakt_addon = 4; google.protobuf.Empty logout_trakt = 5; - stremio.core.types.Descriptor upgrade_addon = 6; - stremio.core.types.Descriptor uninstall_addon = 7; + stremio.core.types.AddonDescriptor upgrade_addon = 6; + stremio.core.types.AddonDescriptor uninstall_addon = 7; stremio.core.types.Profile.Settings update_settings = 8; stremio.core.types.MetaItemPreview add_to_library = 9; string remove_from_library = 10; diff --git a/src/main/proto/stremio/core/runtime/action_library_by_type.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_library_by_type.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_library_by_type.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_library_by_type.proto diff --git a/src/main/proto/stremio/core/runtime/action_library_with_filters.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_library_with_filters.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_library_with_filters.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_library_with_filters.proto diff --git a/src/main/proto/stremio/core/runtime/action_link.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_link.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_link.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_link.proto diff --git a/src/main/proto/stremio/core/runtime/action_load.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_load.proto similarity index 82% rename from src/main/proto/stremio/core/runtime/action_load.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_load.proto index 22b9124d..088d699b 100644 --- a/src/main/proto/stremio/core/runtime/action_load.proto +++ b/stremio-core-protobuf/proto/stremio/core/runtime/action_load.proto @@ -23,9 +23,10 @@ message ActionLoad { stremio.core.models.LibraryByType.Selected library_by_type = 5; stremio.core.models.LibraryWithFilters.Selected library_with_filters = 6; stremio.core.models.MetaDetails.Selected meta_details = 7; - stremio.core.models.Player.Selected player = 8; - google.protobuf.Empty link = 9; - google.protobuf.Empty data_export = 10; - google.protobuf.Empty local_search = 11; + stremio.core.models.CatalogsWithExtra.Selected search = 8; + stremio.core.models.Player.Selected player = 9; + google.protobuf.Empty link = 10; + google.protobuf.Empty data_export = 11; + google.protobuf.Empty local_search = 12; } -} \ No newline at end of file +} diff --git a/src/main/proto/stremio/core/runtime/action_meta_details.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_meta_details.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_meta_details.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_meta_details.proto diff --git a/src/main/proto/stremio/core/runtime/action_player.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_player.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_player.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_player.proto diff --git a/src/main/proto/stremio/core/runtime/action_streaming_server.proto b/stremio-core-protobuf/proto/stremio/core/runtime/action_streaming_server.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/action_streaming_server.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/action_streaming_server.proto diff --git a/src/main/proto/stremio/core/runtime/event.proto b/stremio-core-protobuf/proto/stremio/core/runtime/event.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/event.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/event.proto diff --git a/stremio-core-protobuf/proto/stremio/core/runtime/field.proto b/stremio-core-protobuf/proto/stremio/core/runtime/field.proto new file mode 100644 index 00000000..18eb33b1 --- /dev/null +++ b/stremio-core-protobuf/proto/stremio/core/runtime/field.proto @@ -0,0 +1,24 @@ +syntax = "proto2"; + +package stremio.core.runtime; + +option java_package = "com.stremio.core"; + +enum Field { + Ctx = 0; + AuthLink = 1; + DataExport = 2; + ContinueWatchingPreview = 3; + Board = 4; + Discover = 5; + Library = 6; + LibraryByType = 7; + ContinueWatching = 8; + Search = 9; + LocalSearch = 10; + Addons = 11; + MetaDetails = 12; + AddonDetails = 13; + StreamingServer = 14; + Player = 15; +} \ No newline at end of file diff --git a/src/main/proto/stremio/core/runtime/runtime.proto b/stremio-core-protobuf/proto/stremio/core/runtime/runtime.proto similarity index 100% rename from src/main/proto/stremio/core/runtime/runtime.proto rename to stremio-core-protobuf/proto/stremio/core/runtime/runtime.proto diff --git a/src/main/proto/stremio/core/types/addon.proto b/stremio-core-protobuf/proto/stremio/core/types/addon.proto similarity index 100% rename from src/main/proto/stremio/core/types/addon.proto rename to stremio-core-protobuf/proto/stremio/core/types/addon.proto diff --git a/src/main/proto/stremio/core/types/api.proto b/stremio-core-protobuf/proto/stremio/core/types/api.proto similarity index 100% rename from src/main/proto/stremio/core/types/api.proto rename to stremio-core-protobuf/proto/stremio/core/types/api.proto diff --git a/src/main/proto/stremio/core/types/auth_request.proto b/stremio-core-protobuf/proto/stremio/core/types/auth_request.proto similarity index 100% rename from src/main/proto/stremio/core/types/auth_request.proto rename to stremio-core-protobuf/proto/stremio/core/types/auth_request.proto diff --git a/src/main/proto/stremio/core/types/library.proto b/stremio-core-protobuf/proto/stremio/core/types/library.proto similarity index 100% rename from src/main/proto/stremio/core/types/library.proto rename to stremio-core-protobuf/proto/stremio/core/types/library.proto diff --git a/src/main/proto/stremio/core/types/manifest.proto b/stremio-core-protobuf/proto/stremio/core/types/manifest.proto similarity index 98% rename from src/main/proto/stremio/core/types/manifest.proto rename to stremio-core-protobuf/proto/stremio/core/types/manifest.proto index 878d0c46..5fe996c7 100644 --- a/src/main/proto/stremio/core/types/manifest.proto +++ b/stremio-core-protobuf/proto/stremio/core/types/manifest.proto @@ -4,7 +4,7 @@ package stremio.core.types; option java_package = "com.stremio.core.types.addon"; -message Descriptor { +message AddonDescriptor { required Manifest manifest = 1; required string transport_url = 2; required DescriptorFlags flags = 3; diff --git a/src/main/proto/stremio/core/types/meta_item.proto b/stremio-core-protobuf/proto/stremio/core/types/meta_item.proto similarity index 100% rename from src/main/proto/stremio/core/types/meta_item.proto rename to stremio-core-protobuf/proto/stremio/core/types/meta_item.proto diff --git a/src/main/proto/stremio/core/types/meta_item_preview.proto b/stremio-core-protobuf/proto/stremio/core/types/meta_item_preview.proto similarity index 100% rename from src/main/proto/stremio/core/types/meta_item_preview.proto rename to stremio-core-protobuf/proto/stremio/core/types/meta_item_preview.proto diff --git a/src/main/proto/stremio/core/types/profile.proto b/stremio-core-protobuf/proto/stremio/core/types/profile.proto similarity index 100% rename from src/main/proto/stremio/core/types/profile.proto rename to stremio-core-protobuf/proto/stremio/core/types/profile.proto diff --git a/src/main/proto/stremio/core/types/stream.proto b/stremio-core-protobuf/proto/stremio/core/types/stream.proto similarity index 100% rename from src/main/proto/stremio/core/types/stream.proto rename to stremio-core-protobuf/proto/stremio/core/types/stream.proto diff --git a/src/main/proto/stremio/core/types/subtitle.proto b/stremio-core-protobuf/proto/stremio/core/types/subtitle.proto similarity index 100% rename from src/main/proto/stremio/core/types/subtitle.proto rename to stremio-core-protobuf/proto/stremio/core/types/subtitle.proto diff --git a/src/main/proto/stremio/core/types/video.proto b/stremio-core-protobuf/proto/stremio/core/types/video.proto similarity index 100% rename from src/main/proto/stremio/core/types/video.proto rename to stremio-core-protobuf/proto/stremio/core/types/video.proto diff --git a/stremio-core-protobuf/src/bridge.rs b/stremio-core-protobuf/src/bridge.rs new file mode 100644 index 00000000..7fb611a4 --- /dev/null +++ b/stremio-core-protobuf/src/bridge.rs @@ -0,0 +1,39 @@ +//! This module contains all the bridge impls which takes [`stremio_core`] types +//! and allow `FromProtobuf` and `ToProtobuf` for Protobuf generates structs and enums. +//! +//! # Bridge + +use stremio_core::runtime::Env; + +mod action; +mod auth_request; +mod date; +mod env_error; +mod event; +mod events; +mod extra_value; +mod library_item; +mod link; +mod list; +mod loadable; +mod manifest; +mod meta_preview; +mod option; +mod pair; +mod poster_shape; +mod profile; +mod resource_loadable; +mod resource_path; +mod resource_request; +mod stream; +mod string; +mod subtitle; + +pub trait ToProtobuf { + fn to_protobuf(&self, args: &A) -> T; +} + +pub trait FromProtobuf { + #[allow(clippy::wrong_self_convention)] + fn from_protobuf(&self) -> T; +} diff --git a/src/commonMain/rust/bridge/action.rs b/stremio-core-protobuf/src/bridge/action.rs similarity index 90% rename from src/commonMain/rust/bridge/action.rs rename to stremio-core-protobuf/src/bridge/action.rs index 42a75148..ba154f5a 100644 --- a/src/commonMain/rust/bridge/action.rs +++ b/stremio-core-protobuf/src/bridge/action.rs @@ -1,20 +1,21 @@ use std::ops::Range; -use stremio_core::runtime::msg::{ - Action, ActionCatalogWithFilters, ActionCatalogsWithExtra, ActionCtx, ActionLibraryByType, - ActionLibraryWithFilters, ActionLink, ActionLoad, ActionMetaDetails, ActionPlayer, - ActionStreamingServer, CreateTorrentArgs, PlayOnDeviceArgs, +use stremio_core::runtime::{ + msg::{ + Action, ActionCatalogWithFilters, ActionCatalogsWithExtra, ActionCtx, ActionLibraryByType, + ActionLibraryWithFilters, ActionLink, ActionLoad, ActionMetaDetails, ActionPlayer, + ActionStreamingServer, CreateTorrentArgs, PlayOnDeviceArgs, + }, + RuntimeAction, }; -use stremio_core::runtime::RuntimeAction; -use crate::bridge::FromProtobuf; -use crate::env::AndroidEnv; -use crate::model::AndroidModel; -use crate::protobuf::stremio::core::runtime; -use crate::protobuf::stremio::core::runtime::{ - action_catalog_with_filters, action_catalogs_with_extra, action_ctx, action_library_by_type, - action_library_with_filters, action_link, action_load, action_meta_details, action_player, - action_streaming_server, create_torrent_args, Field, +use crate::{ + bridge::FromProtobuf, + protobuf::stremio::core::runtime::{ + self, action_catalog_with_filters, action_catalogs_with_extra, action_ctx, + action_library_by_type, action_library_with_filters, action_link, action_load, + action_meta_details, action_player, action_streaming_server, create_torrent_args, Field, + }, }; impl FromProtobuf for runtime::Action { @@ -217,9 +218,17 @@ impl FromProtobuf for runtime::Action { Some(action_load::Args::AddonDetails(selected)) => { Action::Load(ActionLoad::AddonDetails(selected.from_protobuf())) } + // Board Some(action_load::Args::CatalogsWithExtra(selected)) => { Action::Load(ActionLoad::CatalogsWithExtra(selected.from_protobuf())) } + // Search + // Needs `LoadRange` to fetch next pages + Some(action_load::Args::Search(selected)) => { + Action::Load(ActionLoad::CatalogsWithExtra(selected.from_protobuf())) + } + // Discovery + // Needs `LoadNextPage` to fetch next pages Some(action_load::Args::CatalogWithFilters(selected)) => Action::Load( ActionLoad::CatalogWithFilters(Some(selected.from_protobuf())), ), @@ -254,13 +263,17 @@ impl FromProtobuf for runtime::Action { } } -impl FromProtobuf> for runtime::RuntimeAction { - fn from_protobuf(&self) -> RuntimeAction { +impl FromProtobuf> for runtime::RuntimeAction +where + E: stremio_core::runtime::Env + 'static, + M: stremio_core::runtime::Model, + F: From, +{ + fn from_protobuf(&self) -> RuntimeAction { RuntimeAction { field: self .field - .and_then(|value| Field::try_from(value).ok()) - .from_protobuf(), + .and_then(|value| Field::try_from(value).ok().map(Into::into)), action: self.action.from_protobuf(), } } diff --git a/src/commonMain/rust/bridge/auth_request.rs b/stremio-core-protobuf/src/bridge/auth_request.rs similarity index 92% rename from src/commonMain/rust/bridge/auth_request.rs rename to stremio-core-protobuf/src/bridge/auth_request.rs index e1829fad..f41ce41e 100644 --- a/src/commonMain/rust/bridge/auth_request.rs +++ b/stremio-core-protobuf/src/bridge/auth_request.rs @@ -30,7 +30,10 @@ impl FromProtobuf for types::AuthRequest { } impl ToProtobuf for AuthRequest { - fn to_protobuf(&self, _args: &()) -> types::AuthRequest { + fn to_protobuf( + &self, + _args: &(), + ) -> types::AuthRequest { let request = match self { AuthRequest::Login { email, @@ -58,7 +61,7 @@ impl ToProtobuf for AuthRequest { } => types::auth_request::Type::Register(types::auth_request::Register { email: email.to_owned(), password: password.to_owned(), - gdpr_consent: gdpr_consent.to_protobuf(&()), + gdpr_consent: gdpr_consent.to_protobuf::(&()), }), }; types::AuthRequest { diff --git a/src/commonMain/rust/bridge/date.rs b/stremio-core-protobuf/src/bridge/date.rs similarity index 84% rename from src/commonMain/rust/bridge/date.rs rename to stremio-core-protobuf/src/bridge/date.rs index 33406630..0656371d 100644 --- a/src/commonMain/rust/bridge/date.rs +++ b/stremio-core-protobuf/src/bridge/date.rs @@ -10,7 +10,7 @@ impl FromProtobuf> for Timestamp { } impl ToProtobuf for DateTime { - fn to_protobuf(&self, _args: &()) -> Timestamp { + fn to_protobuf(&self, _args: &()) -> Timestamp { Timestamp { seconds: self.timestamp(), nanos: self.timestamp_subsec_nanos() as i32, diff --git a/src/commonMain/rust/bridge/env_error.rs b/stremio-core-protobuf/src/bridge/env_error.rs similarity index 69% rename from src/commonMain/rust/bridge/env_error.rs rename to stremio-core-protobuf/src/bridge/env_error.rs index 0b68e74c..4dfe16e9 100644 --- a/src/commonMain/rust/bridge/env_error.rs +++ b/stremio-core-protobuf/src/bridge/env_error.rs @@ -3,7 +3,10 @@ use crate::protobuf::stremio::core::runtime; use stremio_core::runtime::EnvError; impl ToProtobuf for EnvError { - fn to_protobuf(&self, _args: &()) -> runtime::EnvError { + fn to_protobuf( + &self, + _args: &(), + ) -> runtime::EnvError { runtime::EnvError { code: self.code() as i32, message: self.message(), diff --git a/src/commonMain/rust/bridge/event.rs b/stremio-core-protobuf/src/bridge/event.rs similarity index 89% rename from src/commonMain/rust/bridge/event.rs rename to stremio-core-protobuf/src/bridge/event.rs index b44aed4e..6f55c87d 100644 --- a/src/commonMain/rust/bridge/event.rs +++ b/stremio-core-protobuf/src/bridge/event.rs @@ -1,14 +1,15 @@ -use stremio_core::models::ctx::CtxError; -use stremio_core::runtime::msg::Event; -use stremio_core::runtime::RuntimeEvent; +use stremio_core::{ + models::ctx::CtxError, + runtime::{msg::Event, RuntimeEvent}, +}; -use crate::bridge::ToProtobuf; -use crate::env::AndroidEnv; -use crate::model::AndroidModel; -use crate::protobuf::stremio::core::runtime; +use crate::{ + bridge::ToProtobuf, + stremio_core_models::runtime::{self, Field}, +}; impl ToProtobuf for Event { - fn to_protobuf(&self, _args: &()) -> runtime::Event { + fn to_protobuf(&self, _args: &()) -> runtime::Event { let event = match self { Event::ProfilePushedToStorage { uid } => runtime::event::Type::ProfilePushedToStorage( runtime::event::ProfilePushedToStorage { uid: uid.clone() }, @@ -48,17 +49,17 @@ impl ToProtobuf for Event { } Event::AddonsPulledFromAPI { transport_urls } => { runtime::event::Type::AddonsPulledFromApi(runtime::event::AddonsPulledFromApi { - transport_urls: transport_urls.to_protobuf(&()), + transport_urls: transport_urls.to_protobuf::(&()), }) } Event::AddonsPushedToAPI { transport_urls } => { runtime::event::Type::AddonsPushedToApi(runtime::event::AddonsPushedToApi { - transport_urls: transport_urls.to_protobuf(&()), + transport_urls: transport_urls.to_protobuf::(&()), }) } Event::UserAuthenticated { auth_request } => { runtime::event::Type::UserAuthenticated(runtime::event::UserAuthenticated { - auth_request: auth_request.to_protobuf(&()), + auth_request: auth_request.to_protobuf::(&()), }) } Event::UserAddonsLocked { addons_locked } => { @@ -144,7 +145,7 @@ impl ToProtobuf for Event { runtime::event::Type::LibrarySyncWithApiPlanned( runtime::event::LibrarySyncWithApiPlanned { uid: uid.clone(), - plan: plan.to_protobuf(&()), + plan: plan.to_protobuf::(&()), }, ) } @@ -160,7 +161,7 @@ impl ToProtobuf for Event { } Event::SettingsUpdated { settings } => { runtime::event::Type::SettingsUpdated(runtime::event::SettingsUpdated { - settings: settings.to_protobuf(&()), + settings: settings.to_protobuf::(&()), }) } Event::PlayerPlaying { .. } => { @@ -183,7 +184,7 @@ impl ToProtobuf for Event { } Event::MagnetParsed { magnet } => { runtime::event::Type::MagnetParsed(runtime::event::MagnetParsed { - magnet: magnet.to_protobuf(&()), + magnet: magnet.to_protobuf::(&()), }) } Event::TorrentParsed { torrent } => { @@ -204,7 +205,7 @@ impl ToProtobuf for Event { }; runtime::event::Type::Error(Box::from(runtime::event::Error { error, - source: Box::from(source.to_protobuf(&())), + source: Box::from(source.to_protobuf::(&())), })) } }; @@ -214,20 +215,28 @@ impl ToProtobuf for Event { } } -impl ToProtobuf for RuntimeEvent { - fn to_protobuf(&self, _args: &()) -> runtime::RuntimeEvent { +impl ToProtobuf for RuntimeEvent +where + E: stremio_core::runtime::Env + 'static, + M: stremio_core::runtime::Model, + F: ToProtobuf, +{ + fn to_protobuf( + &self, + _args: &(), + ) -> runtime::RuntimeEvent { let event = match self { RuntimeEvent::NewState(fields, ..) => { runtime::runtime_event::Event::NewState(runtime::runtime_event::NewState { fields: fields - .to_protobuf(&()) + .to_protobuf::(&()) .iter() .map(|field| *field as i32) .collect(), }) } RuntimeEvent::CoreEvent(event) => { - runtime::runtime_event::Event::CoreEvent(event.to_protobuf(&())) + runtime::runtime_event::Event::CoreEvent(event.to_protobuf::(&())) } }; runtime::RuntimeEvent { event: Some(event) } diff --git a/src/commonMain/rust/bridge/events.rs b/stremio-core-protobuf/src/bridge/events.rs similarity index 60% rename from src/commonMain/rust/bridge/events.rs rename to stremio-core-protobuf/src/bridge/events.rs index 378b6f1a..6b88881e 100644 --- a/src/commonMain/rust/bridge/events.rs +++ b/stremio-core-protobuf/src/bridge/events.rs @@ -5,40 +5,46 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::models; impl ToProtobuf for Events { - fn to_protobuf(&self, _args: &()) -> models::Events { + fn to_protobuf(&self, _args: &()) -> models::Events { models::Events { - modal: self.modal.to_protobuf(&()), - notification: self.notification.to_protobuf(&()), + modal: self.modal.to_protobuf::(&()), + notification: self.notification.to_protobuf::(&()), } } } impl ToProtobuf for GetModalResponse { - fn to_protobuf(&self, _args: &()) -> models::EventModal { + fn to_protobuf( + &self, + _args: &(), + ) -> models::EventModal { models::EventModal { id: self.id.to_owned(), title: self.title.to_owned(), message: self.message.to_owned(), - image_url: self.image_url.to_protobuf(&()), + image_url: self.image_url.to_protobuf::(&()), addon: self .addon .as_ref() .map(|addon| models::event_modal::ModalAddon { - manifest_url: addon.manifest_url.to_protobuf(&()), + manifest_url: addon.manifest_url.to_protobuf::(&()), name: addon.name.to_owned(), }), - external_url: self.external_url.to_protobuf(&()), + external_url: self.external_url.to_protobuf::(&()), } } } impl ToProtobuf for GetNotificationResponse { - fn to_protobuf(&self, _args: &()) -> models::EventNotification { + fn to_protobuf( + &self, + _args: &(), + ) -> models::EventNotification { models::EventNotification { id: self.id.to_owned(), title: self.title.to_owned(), message: self.message.to_owned(), - external_url: self.external_url.to_protobuf(&()), + external_url: self.external_url.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/bridge/extra_value.rs b/stremio-core-protobuf/src/bridge/extra_value.rs similarity index 81% rename from src/commonMain/rust/bridge/extra_value.rs rename to stremio-core-protobuf/src/bridge/extra_value.rs index 288d3a91..90705780 100644 --- a/src/commonMain/rust/bridge/extra_value.rs +++ b/stremio-core-protobuf/src/bridge/extra_value.rs @@ -13,7 +13,10 @@ impl FromProtobuf for types::ExtraValue { } impl ToProtobuf for ExtraValue { - fn to_protobuf(&self, _args: &()) -> types::ExtraValue { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ExtraValue { types::ExtraValue { name: self.name.to_owned(), value: self.value.to_owned(), diff --git a/src/commonMain/rust/bridge/from_protobuf.rs b/stremio-core-protobuf/src/bridge/from_protobuf.rs similarity index 100% rename from src/commonMain/rust/bridge/from_protobuf.rs rename to stremio-core-protobuf/src/bridge/from_protobuf.rs diff --git a/src/commonMain/rust/bridge/library_item.rs b/stremio-core-protobuf/src/bridge/library_item.rs similarity index 88% rename from src/commonMain/rust/bridge/library_item.rs rename to stremio-core-protobuf/src/bridge/library_item.rs index 244bf606..b93870b0 100644 --- a/src/commonMain/rust/bridge/library_item.rs +++ b/stremio-core-protobuf/src/bridge/library_item.rs @@ -7,7 +7,7 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::types; impl ToProtobuf)> for LibraryItem { - fn to_protobuf( + fn to_protobuf( &self, (ctx, maybe_notifications): &(&Ctx, Option), ) -> types::LibraryItem { @@ -33,15 +33,15 @@ impl ToProtobuf)> for LibraryItem { id: self.id.to_string(), r#type: self.r#type.to_string(), name: self.name.to_string(), - poster: self.poster.to_protobuf(&()), - poster_shape: self.poster_shape.to_protobuf(&()) as i32, + poster: self.poster.to_protobuf::(&()), + poster_shape: self.poster_shape.to_protobuf::(&()) as i32, state: types::LibraryItemState { time_offset: self.state.time_offset, duration: self.state.duration, video_id: self.state.video_id.clone(), no_notif: self.state.no_notif, }, - behavior_hints: self.behavior_hints.to_protobuf(&()), + behavior_hints: self.behavior_hints.to_protobuf::(&()), deep_links: types::MetaItemDeepLinks { meta_details_videos: deep_links.meta_details_videos, meta_details_streams: deep_links.meta_details_streams, diff --git a/src/commonMain/rust/bridge/link.rs b/stremio-core-protobuf/src/bridge/link.rs similarity index 70% rename from src/commonMain/rust/bridge/link.rs rename to stremio-core-protobuf/src/bridge/link.rs index 60481d71..0a4874af 100644 --- a/src/commonMain/rust/bridge/link.rs +++ b/stremio-core-protobuf/src/bridge/link.rs @@ -4,7 +4,10 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::types; impl ToProtobuf for Link { - fn to_protobuf(&self, _args: &()) -> types::LinkPreview { + fn to_protobuf( + &self, + _args: &(), + ) -> types::LinkPreview { types::LinkPreview { name: self.name.to_string(), category: self.category.to_string(), @@ -13,7 +16,7 @@ impl ToProtobuf for Link { } impl ToProtobuf for Link { - fn to_protobuf(&self, _args: &()) -> types::Link { + fn to_protobuf(&self, _args: &()) -> types::Link { types::Link { name: self.name.to_string(), category: self.category.to_string(), diff --git a/src/commonMain/rust/bridge/list.rs b/stremio-core-protobuf/src/bridge/list.rs similarity index 61% rename from src/commonMain/rust/bridge/list.rs rename to stremio-core-protobuf/src/bridge/list.rs index d7ad8a32..5e19ed60 100644 --- a/src/commonMain/rust/bridge/list.rs +++ b/stremio-core-protobuf/src/bridge/list.rs @@ -7,7 +7,9 @@ impl, U> FromProtobuf> for Vec { } impl, U, A> ToProtobuf, A> for Vec { - fn to_protobuf(&self, args: &A) -> Vec { - self.iter().map(|item| item.to_protobuf(args)).collect() + fn to_protobuf(&self, args: &A) -> Vec { + self.iter() + .map(|item| item.to_protobuf::(args)) + .collect() } } diff --git a/src/commonMain/rust/bridge/loadable.rs b/stremio-core-protobuf/src/bridge/loadable.rs similarity index 75% rename from src/commonMain/rust/bridge/loadable.rs rename to stremio-core-protobuf/src/bridge/loadable.rs index 60a077a5..3e021278 100644 --- a/src/commonMain/rust/bridge/loadable.rs +++ b/stremio-core-protobuf/src/bridge/loadable.rs @@ -1,33 +1,45 @@ -use stremio_core::deep_links::MetaItemDeepLinks; -use stremio_core::models::common::{Loadable, ResourceError}; -use stremio_core::models::ctx::{Ctx, CtxError}; -use stremio_core::models::link::LinkError; -use stremio_core::models::streaming_server::PlaybackDevice; -use stremio_core::runtime::EnvError; -use stremio_core::types::addon::{Descriptor, DescriptorPreview, ResourcePath, ResourceRequest}; -use stremio_core::types::api::{ - GetModalResponse, GetNotificationResponse, LinkAuthKey, LinkCodeResponse, -}; -use stremio_core::types::library::LibraryItem; -use stremio_core::types::resource::{MetaItem, MetaItemPreview, Stream, Subtitles}; -use stremio_core::types::streaming_server::{Settings, Statistics}; -use stremio_watched_bitfield::WatchedBitField; +use itertools::Itertools; use url::Url; -use crate::bridge::ToProtobuf; -use crate::protobuf::stremio::core::models; -use crate::protobuf::stremio::core::models::{LoadedModal, LoadedNotification, PlaybackDevices}; +use stremio_core::{ + deep_links::MetaItemDeepLinks, + models::{ + common::{Loadable, ResourceError}, + ctx::{Ctx, CtxError}, + link::LinkError, + streaming_server::PlaybackDevice, + }, + runtime::EnvError, + types::{ + addon::{Descriptor, DescriptorPreview, ResourcePath, ResourceRequest}, + api::{GetModalResponse, GetNotificationResponse, LinkAuthKey, LinkCodeResponse}, + library::LibraryItem, + resource::{MetaItem, MetaItemPreview, Stream, Subtitles}, + streaming_server::{Settings, Statistics}, + watched_bitfield::WatchedBitField, + }, +}; + +use crate::{ + bridge::ToProtobuf, + protobuf::stremio::core::models::{self, LoadedModal, LoadedNotification, PlaybackDevices}, +}; impl ToProtobuf for Loadable, ResourceError> { - fn to_protobuf( + fn to_protobuf( &self, (ctx, request): &(&Ctx, &ResourceRequest), ) -> models::loadable_page::Content { match &self { Loadable::Ready(ready) => models::loadable_page::Content::Ready(models::Page { - meta_items: ready.to_protobuf(&(*ctx, *request)), + meta_items: ready + .iter() + .unique_by(|meta_item| &meta_item.id) + .map(|meta_item| meta_item.to_owned()) + .collect_vec() + .to_protobuf::(&(*ctx, *request)), }), Loadable::Err(error) => models::loadable_page::Content::Error(models::Error { message: error.to_string(), @@ -48,7 +60,7 @@ impl ), > for Loadable { - fn to_protobuf( + fn to_protobuf( &self, (library_item, watched, addon_name, meta_request): &( Option<&LibraryItem>, @@ -59,7 +71,7 @@ impl ) -> models::loadable_meta_item::Content { match &self { Loadable::Ready(ready) => models::loadable_meta_item::Content::Ready( - ready.to_protobuf(&(*library_item, *watched, *addon_name, *meta_request)), + ready.to_protobuf::(&(*library_item, *watched, *addon_name, *meta_request)), ), Loadable::Err(error) => models::loadable_meta_item::Content::Error(models::Error { message: error.to_string(), @@ -75,7 +87,7 @@ impl (&Ctx, &String, &ResourceRequest, Option<&ResourceRequest>), > for Loadable, ResourceError> { - fn to_protobuf( + fn to_protobuf( &self, (ctx, addon_name, stream_request, meta_request): &( &Ctx, @@ -86,7 +98,7 @@ impl ) -> models::loadable_streams::Content { match &self { Loadable::Ready(ready) => models::loadable_streams::Content::Ready(models::Streams { - streams: ready.to_protobuf(&( + streams: ready.to_protobuf::(&( Some(*ctx), Some(*addon_name), Some(*stream_request), @@ -107,7 +119,7 @@ impl (&Ctx, &String, &ResourceRequest, Option<&ResourceRequest>), > for Loadable, ResourceError> { - fn to_protobuf( + fn to_protobuf( &self, (ctx, addon_name, stream_request, meta_request): &( &Ctx, @@ -119,7 +131,7 @@ impl match &self { Loadable::Ready(ready) => { models::loadable_stream::Content::Ready(models::OptionStream { - stream: ready.to_protobuf(&( + stream: ready.to_protobuf::(&( Some(*ctx), Some(*addon_name), Some(*stream_request), @@ -138,11 +150,14 @@ impl impl ToProtobuf> for Loadable, ResourceError> { - fn to_protobuf(&self, addon_name: &Option<&String>) -> models::loadable_subtitles::Content { + fn to_protobuf( + &self, + addon_name: &Option<&String>, + ) -> models::loadable_subtitles::Content { match &self { Loadable::Ready(ready) => { models::loadable_subtitles::Content::Ready(models::Subtitles { - subtitles: ready.to_protobuf(addon_name), + subtitles: ready.to_protobuf::(addon_name), }) } Loadable::Err(error) => models::loadable_subtitles::Content::Error(models::Error { @@ -154,10 +169,13 @@ impl ToProtobuf> } impl ToProtobuf for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableSettings { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableSettings { let content = match &self { Loadable::Ready(ready) => { - models::loadable_settings::Content::Ready(ready.to_protobuf(&())) + models::loadable_settings::Content::Ready(ready.to_protobuf::(&())) } Loadable::Err(error) => models::loadable_settings::Content::Error(models::Error { message: error.to_string(), @@ -171,7 +189,10 @@ impl ToProtobuf for Loadable { } impl ToProtobuf for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableBaseUrl { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableBaseUrl { let content = match &self { Loadable::Ready(ready) => models::loadable_base_url::Content::Ready(ready.to_string()), Loadable::Err(error) => models::loadable_base_url::Content::Error(models::Error { @@ -186,9 +207,14 @@ impl ToProtobuf for Loadable { } impl ToProtobuf for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableCode { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableCode { let content = match &self { - Loadable::Ready(ready) => models::loadable_code::Content::Ready(ready.to_protobuf(&())), + Loadable::Ready(ready) => { + models::loadable_code::Content::Ready(ready.to_protobuf::(&())) + } Loadable::Err(error) => models::loadable_code::Content::Error(models::Error { message: error.to_string(), }), @@ -201,10 +227,13 @@ impl ToProtobuf for Loadable for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableAuthKey { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableAuthKey { let content = match &self { Loadable::Ready(ready) => { - models::loadable_auth_key::Content::Ready(ready.to_protobuf(&())) + models::loadable_auth_key::Content::Ready(ready.to_protobuf::(&())) } Loadable::Err(error) => models::loadable_auth_key::Content::Error(models::Error { message: error.to_string(), @@ -218,10 +247,13 @@ impl ToProtobuf for Loadable for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableTorrent { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableTorrent { let content = match &self { Loadable::Ready(ready) => { - let deeplinks = MetaItemDeepLinks::from(ready).to_protobuf(&()); + let deeplinks = MetaItemDeepLinks::from(ready).to_protobuf::(&()); models::loadable_torrent::Deeplinks::Ready(deeplinks) } Loadable::Err(error) => models::loadable_torrent::Deeplinks::Error(models::Error { @@ -236,11 +268,14 @@ impl ToProtobuf for Loadable for Loadable, EnvError> { - fn to_protobuf(&self, _args: &()) -> models::LoadablePlaybackDevices { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadablePlaybackDevices { let content = match &self { Loadable::Ready(ready) => { models::loadable_playback_devices::Content::Ready(PlaybackDevices { - devices: ready.to_protobuf(&()), + devices: ready.to_protobuf::(&()), }) } Loadable::Err(error) => { @@ -259,10 +294,13 @@ impl ToProtobuf for Loadable for Loadable { - fn to_protobuf(&self, _args: &()) -> models::LoadableStatistics { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableStatistics { let content = match &self { Loadable::Ready(ready) => { - models::loadable_statistics::Content::Ready(ready.to_protobuf(&())) + models::loadable_statistics::Content::Ready(ready.to_protobuf::(&())) } Loadable::Err(error) => models::loadable_statistics::Content::Error(models::Error { message: error.to_string(), @@ -278,11 +316,14 @@ impl ToProtobuf for Loadable for Loadable, ResourceError> { - fn to_protobuf(&self, ctx: &Ctx) -> models::loadable_addon_catalog::Content { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::loadable_addon_catalog::Content { match &self { Loadable::Ready(ready) => { models::loadable_addon_catalog::Content::Ready(models::Addons { - items: ready.to_protobuf(ctx), + items: ready.to_protobuf::(ctx), }) } Loadable::Err(error) => models::loadable_addon_catalog::Content::Error(models::Error { @@ -296,10 +337,13 @@ impl ToProtobuf } impl ToProtobuf for Loadable { - fn to_protobuf(&self, ctx: &Ctx) -> models::loadable_descriptor::Content { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::loadable_descriptor::Content { match &self { Loadable::Ready(ready) => { - models::loadable_descriptor::Content::Ready(ready.to_protobuf(ctx)) + models::loadable_descriptor::Content::Ready(ready.to_protobuf::(ctx)) } Loadable::Err(error) => models::loadable_descriptor::Content::Error(models::Error { message: error.to_string(), @@ -310,10 +354,13 @@ impl ToProtobuf for Loadable for Loadable, CtxError> { - fn to_protobuf(&self, _args: &()) -> models::LoadableModal { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableModal { let content = match &self { Loadable::Ready(ready) => models::loadable_modal::Content::Ready(LoadedModal { - modal: ready.to_protobuf(&()), + modal: ready.to_protobuf::(&()), }), Loadable::Err(error) => models::loadable_modal::Content::Error(models::Error { message: match error { @@ -333,11 +380,14 @@ impl ToProtobuf for Loadable impl ToProtobuf for Loadable, CtxError> { - fn to_protobuf(&self, _args: &()) -> models::LoadableNotification { + fn to_protobuf( + &self, + _args: &(), + ) -> models::LoadableNotification { let content = match &self { Loadable::Ready(ready) => { models::loadable_notification::Content::Ready(LoadedNotification { - notification: ready.to_protobuf(&()), + notification: ready.to_protobuf::(&()), }) } Loadable::Err(error) => models::loadable_notification::Content::Error(models::Error { diff --git a/src/commonMain/rust/bridge/manifest.rs b/stremio-core-protobuf/src/bridge/manifest.rs similarity index 74% rename from src/commonMain/rust/bridge/manifest.rs rename to stremio-core-protobuf/src/bridge/manifest.rs index 1b3bdea2..89c144bd 100644 --- a/src/commonMain/rust/bridge/manifest.rs +++ b/stremio-core-protobuf/src/bridge/manifest.rs @@ -1,13 +1,19 @@ -use semver::Version; use std::str::FromStr; -use stremio_core::models::ctx::Ctx; -use stremio_core::types::addon::{ - Descriptor, DescriptorFlags, DescriptorPreview, ExtraProp, Manifest, ManifestBehaviorHints, - ManifestCatalog, ManifestExtra, ManifestPreview, ManifestResource, OptionsLimit, + +use semver::Version; + +use stremio_core::{ + models::ctx::Ctx, + types::addon::{ + Descriptor, DescriptorFlags, DescriptorPreview, ExtraProp, Manifest, ManifestBehaviorHints, + ManifestCatalog, ManifestExtra, ManifestPreview, ManifestResource, OptionsLimit, + }, }; -use crate::bridge::{FromProtobuf, ToProtobuf}; -use crate::protobuf::stremio::core::types; +use crate::{ + bridge::{FromProtobuf, ToProtobuf}, + protobuf::stremio::core::types, +}; impl FromProtobuf for types::ExtraProp { fn from_protobuf(&self) -> ExtraProp { @@ -117,7 +123,7 @@ impl FromProtobuf for types::DescriptorFlags { } } -impl FromProtobuf for types::Descriptor { +impl FromProtobuf for types::AddonDescriptor { fn from_protobuf(&self) -> Descriptor { Descriptor { manifest: self.manifest.from_protobuf(), @@ -128,7 +134,7 @@ impl FromProtobuf for types::Descriptor { } impl ToProtobuf for ExtraProp { - fn to_protobuf(&self, _args: &()) -> types::ExtraProp { + fn to_protobuf(&self, _args: &()) -> types::ExtraProp { types::ExtraProp { name: self.name.to_owned(), is_required: self.is_required, @@ -139,7 +145,10 @@ impl ToProtobuf for ExtraProp { } impl ToProtobuf for ManifestBehaviorHints { - fn to_protobuf(&self, _args: &()) -> types::ManifestBehaviorHints { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ManifestBehaviorHints { types::ManifestBehaviorHints { adult: self.adult, p2p: self.p2p, @@ -150,11 +159,14 @@ impl ToProtobuf for ManifestBehaviorHints { } impl ToProtobuf for ManifestExtra { - fn to_protobuf(&self, _args: &()) -> types::manifest_extra::Extra { + fn to_protobuf( + &self, + _args: &(), + ) -> types::manifest_extra::Extra { match self { ManifestExtra::Full { props } => { types::manifest_extra::Extra::Full(types::FullManifestExtra { - props: props.to_protobuf(&()), + props: props.to_protobuf::(&()), }) } ManifestExtra::Short { @@ -169,20 +181,26 @@ impl ToProtobuf for ManifestExtra { } impl ToProtobuf for ManifestCatalog { - fn to_protobuf(&self, _args: &()) -> types::ManifestCatalog { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ManifestCatalog { types::ManifestCatalog { id: self.id.to_owned(), r#type: self.r#type.to_owned(), name: self.name.clone(), extra: types::ManifestExtra { - extra: Some(self.extra.to_protobuf(&())), + extra: Some(self.extra.to_protobuf::(&())), }, } } } impl ToProtobuf for ManifestResource { - fn to_protobuf(&self, _args: &()) -> types::ManifestResource { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ManifestResource { match self { ManifestResource::Short(name) => types::ManifestResource { name: name.to_owned(), @@ -203,42 +221,48 @@ impl ToProtobuf for ManifestResource { } impl ToProtobuf for ManifestPreview { - fn to_protobuf(&self, _args: &()) -> types::ManifestPreview { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ManifestPreview { types::ManifestPreview { id: self.id.to_owned(), version: self.version.to_string(), name: self.name.to_owned(), description: self.description.to_owned(), - logo: self.logo.to_protobuf(&()), - background: self.background.to_protobuf(&()), + logo: self.logo.to_protobuf::(&()), + background: self.background.to_protobuf::(&()), types: self.types.to_owned(), - behavior_hints: self.behavior_hints.to_protobuf(&()), + behavior_hints: self.behavior_hints.to_protobuf::(&()), } } } impl ToProtobuf for Manifest { - fn to_protobuf(&self, _args: &()) -> types::Manifest { + fn to_protobuf(&self, _args: &()) -> types::Manifest { types::Manifest { id: self.id.to_owned(), version: self.version.to_string(), name: self.name.to_owned(), description: self.description.to_owned(), - logo: self.logo.to_protobuf(&()), - background: self.background.to_protobuf(&()), + logo: self.logo.to_protobuf::(&()), + background: self.background.to_protobuf::(&()), types: self.types.to_owned(), contact_email: self.contact_email.to_owned(), - resources: self.resources.to_protobuf(&()), + resources: self.resources.to_protobuf::(&()), id_prefixes: self.id_prefixes.to_owned().unwrap_or_default(), - catalogs: self.catalogs.to_protobuf(&()), - addon_catalogs: self.addon_catalogs.to_protobuf(&()), - behavior_hints: self.behavior_hints.to_protobuf(&()), + catalogs: self.catalogs.to_protobuf::(&()), + addon_catalogs: self.addon_catalogs.to_protobuf::(&()), + behavior_hints: self.behavior_hints.to_protobuf::(&()), } } } impl ToProtobuf for DescriptorFlags { - fn to_protobuf(&self, _args: &()) -> types::DescriptorFlags { + fn to_protobuf( + &self, + _args: &(), + ) -> types::DescriptorFlags { types::DescriptorFlags { official: self.official, protected: self.protected, @@ -247,10 +271,13 @@ impl ToProtobuf for DescriptorFlags { } impl ToProtobuf for DescriptorPreview { - fn to_protobuf(&self, ctx: &Ctx) -> types::DescriptorPreview { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> types::DescriptorPreview { types::DescriptorPreview { - manifest: self.manifest.to_protobuf(&()), - transport_url: self.transport_url.to_protobuf(&()), + manifest: self.manifest.to_protobuf::(&()), + transport_url: self.transport_url.to_protobuf::(&()), installed: ctx .profile .addons @@ -260,17 +287,20 @@ impl ToProtobuf for DescriptorPreview { } } -impl ToProtobuf for Descriptor { - fn to_protobuf(&self, ctx: &Ctx) -> types::Descriptor { +impl ToProtobuf for Descriptor { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> types::AddonDescriptor { let installed_addon = ctx .profile .addons .iter() .find(|addon| addon.transport_url == self.transport_url); - types::Descriptor { - manifest: self.manifest.to_protobuf(&()), - transport_url: self.transport_url.to_protobuf(&()), - flags: self.flags.to_protobuf(&()), + types::AddonDescriptor { + manifest: self.manifest.to_protobuf::(&()), + transport_url: self.transport_url.to_protobuf::(&()), + flags: self.flags.to_protobuf::(&()), installed: installed_addon.is_some(), installable: installed_addon.is_none() && !self.manifest.behavior_hints.configuration_required, diff --git a/src/commonMain/rust/bridge/meta_preview.rs b/stremio-core-protobuf/src/bridge/meta_preview.rs similarity index 83% rename from src/commonMain/rust/bridge/meta_preview.rs rename to stremio-core-protobuf/src/bridge/meta_preview.rs index 52fd282f..ba670351 100644 --- a/src/commonMain/rust/bridge/meta_preview.rs +++ b/stremio-core-protobuf/src/bridge/meta_preview.rs @@ -1,4 +1,5 @@ use chrono::Duration; + use stremio_core::deep_links::MetaItemDeepLinks; use stremio_core::models::ctx::Ctx; use stremio_core::runtime::Env; @@ -6,7 +7,6 @@ use stremio_core::types::addon::ResourceRequest; use stremio_core::types::resource::{MetaItemBehaviorHints, MetaItemPreview, PosterShape}; use crate::bridge::{FromProtobuf, ToProtobuf}; -use crate::env::AndroidEnv; use crate::protobuf::stremio::core::types; impl FromProtobuf for types::MetaItemBehaviorHints { @@ -45,7 +45,7 @@ impl FromProtobuf for types::MetaItemPreview { } impl ToProtobuf for MetaItemBehaviorHints { - fn to_protobuf(&self, _args: &()) -> types::MetaItemBehaviorHints { + fn to_protobuf(&self, _args: &()) -> types::MetaItemBehaviorHints { types::MetaItemBehaviorHints { default_video_id: self.default_video_id.clone(), featured_video_id: self.featured_video_id.clone(), @@ -55,7 +55,7 @@ impl ToProtobuf for MetaItemBehaviorHints { } impl ToProtobuf for MetaItemDeepLinks { - fn to_protobuf(&self, _args: &()) -> types::MetaItemDeepLinks { + fn to_protobuf(&self, _args: &()) -> types::MetaItemDeepLinks { types::MetaItemDeepLinks { meta_details_videos: self.meta_details_videos.clone(), meta_details_streams: self.meta_details_streams.clone(), @@ -65,7 +65,7 @@ impl ToProtobuf for MetaItemDeepLinks { } impl ToProtobuf for MetaItemPreview { - fn to_protobuf( + fn to_protobuf( &self, (ctx, meta_request): &(&Ctx, &ResourceRequest), ) -> types::MetaItemPreview { @@ -73,17 +73,17 @@ impl ToProtobuf for MetaItemPr id: self.id.to_string(), r#type: self.r#type.to_string(), name: self.name.to_string(), - poster_shape: self.poster_shape.to_protobuf(&()) as i32, - poster: self.poster.to_protobuf(&()), - background: self.background.to_protobuf(&()), - logo: self.logo.to_protobuf(&()), + poster_shape: self.poster_shape.to_protobuf::(&()) as i32, + poster: self.poster.to_protobuf::(&()), + background: self.background.to_protobuf::(&()), + logo: self.logo.to_protobuf::(&()), description: self.description.clone(), release_info: self.release_info.clone(), runtime: self.runtime.clone(), - released: self.released.to_protobuf(&()), - links: self.links.to_protobuf(&()), - behavior_hints: self.behavior_hints.to_protobuf(&()), - deep_links: MetaItemDeepLinks::from((self, *meta_request)).to_protobuf(&()), + released: self.released.to_protobuf::(&()), + links: self.links.to_protobuf::(&()), + behavior_hints: self.behavior_hints.to_protobuf::(&()), + deep_links: MetaItemDeepLinks::from((self, *meta_request)).to_protobuf::(&()), in_library: ctx .library .items @@ -93,7 +93,7 @@ impl ToProtobuf for MetaItemPr in_cinema: self .released .filter(|_released| self.r#type == "movie") - .map(|released| released + Duration::days(30) > AndroidEnv::now()) + .map(|released| released + Duration::days(30) > E::now()) .unwrap_or_default(), } } diff --git a/src/commonMain/rust/bridge/option.rs b/stremio-core-protobuf/src/bridge/option.rs similarity index 66% rename from src/commonMain/rust/bridge/option.rs rename to stremio-core-protobuf/src/bridge/option.rs index 2306b4d3..daed0fd5 100644 --- a/src/commonMain/rust/bridge/option.rs +++ b/stremio-core-protobuf/src/bridge/option.rs @@ -7,7 +7,7 @@ impl, U> FromProtobuf> for Option { } impl, U, A> ToProtobuf, A> for Option { - fn to_protobuf(&self, args: &A) -> Option { - self.as_ref().map(|item| item.to_protobuf(args)) + fn to_protobuf(&self, args: &A) -> Option { + self.as_ref().map(|item| item.to_protobuf::(args)) } } diff --git a/src/commonMain/rust/bridge/pair.rs b/stremio-core-protobuf/src/bridge/pair.rs similarity index 68% rename from src/commonMain/rust/bridge/pair.rs rename to stremio-core-protobuf/src/bridge/pair.rs index 64734360..724da681 100644 --- a/src/commonMain/rust/bridge/pair.rs +++ b/stremio-core-protobuf/src/bridge/pair.rs @@ -2,7 +2,10 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::runtime; impl ToProtobuf for (Vec, Vec) { - fn to_protobuf(&self, _args: &()) -> runtime::PlanPair { + fn to_protobuf( + &self, + _args: &(), + ) -> runtime::PlanPair { runtime::PlanPair { first: self.0.clone(), second: self.1.clone(), diff --git a/src/commonMain/rust/bridge/poster_shape.rs b/stremio-core-protobuf/src/bridge/poster_shape.rs similarity index 85% rename from src/commonMain/rust/bridge/poster_shape.rs rename to stremio-core-protobuf/src/bridge/poster_shape.rs index 1b5d491d..1ad6f2d6 100644 --- a/src/commonMain/rust/bridge/poster_shape.rs +++ b/stremio-core-protobuf/src/bridge/poster_shape.rs @@ -14,7 +14,10 @@ impl FromProtobuf for types::PosterShape { } impl ToProtobuf for PosterShape { - fn to_protobuf(&self, _args: &()) -> types::PosterShape { + fn to_protobuf( + &self, + _args: &(), + ) -> types::PosterShape { match self { PosterShape::Poster => types::PosterShape::Poster, PosterShape::Landscape => types::PosterShape::Landscape, diff --git a/src/commonMain/rust/bridge/profile.rs b/stremio-core-protobuf/src/bridge/profile.rs similarity index 83% rename from src/commonMain/rust/bridge/profile.rs rename to stremio-core-protobuf/src/bridge/profile.rs index 5cffbc13..b36ead8b 100644 --- a/src/commonMain/rust/bridge/profile.rs +++ b/stremio-core-protobuf/src/bridge/profile.rs @@ -26,7 +26,10 @@ impl FromProtobuf for types::profile::FrameRateMatchi } impl ToProtobuf for FrameRateMatchingStrategy { - fn to_protobuf(&self, _args: &()) -> types::profile::FrameRateMatchingStrategy { + fn to_protobuf( + &self, + _args: &(), + ) -> types::profile::FrameRateMatchingStrategy { match self { FrameRateMatchingStrategy::Disabled => { types::profile::FrameRateMatchingStrategy::Disabled @@ -98,7 +101,10 @@ impl FromProtobuf for types::profile::Settings { } impl ToProtobuf for LinkAuthKey { - fn to_protobuf(&self, _args: &()) -> types::LinkAuthKey { + fn to_protobuf( + &self, + _args: &(), + ) -> types::LinkAuthKey { types::LinkAuthKey { auth_key: self.auth_key.to_string(), } @@ -106,7 +112,10 @@ impl ToProtobuf for LinkAuthKey { } impl ToProtobuf for LinkCodeResponse { - fn to_protobuf(&self, _args: &()) -> types::LinkCodeResponse { + fn to_protobuf( + &self, + _args: &(), + ) -> types::LinkCodeResponse { types::LinkCodeResponse { code: self.code.to_string(), link: self.link.to_string(), @@ -116,7 +125,10 @@ impl ToProtobuf for LinkCodeResponse { } impl ToProtobuf for GDPRConsent { - fn to_protobuf(&self, _args: &()) -> types::GdprConsent { + fn to_protobuf( + &self, + _args: &(), + ) -> types::GdprConsent { types::GdprConsent { tos: self.tos, privacy: self.privacy, @@ -127,31 +139,34 @@ impl ToProtobuf for GDPRConsent { } impl ToProtobuf for User { - fn to_protobuf(&self, _args: &()) -> types::User { + fn to_protobuf(&self, _args: &()) -> types::User { types::User { id: self.id.to_string(), email: self.email.to_string(), fb_id: self.fb_id.clone(), avatar: self.avatar.clone(), - gdpr_consent: self.gdpr_consent.to_protobuf(&()), - date_registered: self.date_registered.to_protobuf(&()), - last_modified: self.last_modified.to_protobuf(&()), - premium_expire: self.premium_expire.to_protobuf(&()), + gdpr_consent: self.gdpr_consent.to_protobuf::(&()), + date_registered: self.date_registered.to_protobuf::(&()), + last_modified: self.last_modified.to_protobuf::(&()), + premium_expire: self.premium_expire.to_protobuf::(&()), } } } impl ToProtobuf for Auth { - fn to_protobuf(&self, _args: &()) -> types::Auth { + fn to_protobuf(&self, _args: &()) -> types::Auth { types::Auth { key: self.key.0.to_string(), - user: self.user.to_protobuf(&()), + user: self.user.to_protobuf::(&()), } } } impl ToProtobuf for Settings { - fn to_protobuf(&self, _args: &()) -> types::profile::Settings { + fn to_protobuf( + &self, + _args: &(), + ) -> types::profile::Settings { types::profile::Settings { interface_language: self.interface_language.to_string(), streaming_server_url: self.streaming_server_url.to_string(), @@ -176,7 +191,8 @@ impl ToProtobuf for Settings { secondary_audio_language: self.secondary_audio_language.clone(), secondary_subtitles_language: self.secondary_subtitles_language.clone(), player_type: self.player_type.clone(), - frame_rate_matching_strategy: self.frame_rate_matching_strategy.to_protobuf(&()) as i32, + frame_rate_matching_strategy: self.frame_rate_matching_strategy.to_protobuf::(&()) + as i32, next_video_notification_duration: self.next_video_notification_duration as i64, surround_sound: self.surround_sound, } @@ -184,10 +200,10 @@ impl ToProtobuf for Settings { } impl ToProtobuf for Profile { - fn to_protobuf(&self, _args: &()) -> types::Profile { + fn to_protobuf(&self, _args: &()) -> types::Profile { types::Profile { - auth: self.auth.to_protobuf(&()), - settings: self.settings.to_protobuf(&()), + auth: self.auth.to_protobuf::(&()), + settings: self.settings.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/bridge/resource_loadable.rs b/stremio-core-protobuf/src/bridge/resource_loadable.rs similarity index 61% rename from src/commonMain/rust/bridge/resource_loadable.rs rename to stremio-core-protobuf/src/bridge/resource_loadable.rs index 4b6f9cb8..1973f784 100644 --- a/src/commonMain/rust/bridge/resource_loadable.rs +++ b/stremio-core-protobuf/src/bridge/resource_loadable.rs @@ -1,18 +1,27 @@ use inflector::Inflector; -use stremio_core::deep_links::DiscoverDeepLinks; -use stremio_core::models::common::{DescriptorLoadable, ResourceLoadable}; -use stremio_core::models::ctx::Ctx; -use stremio_core::types::addon::{DescriptorPreview, ResourceRequest}; -use stremio_core::types::library::LibraryItem; -use stremio_core::types::resource::{MetaItem, MetaItemPreview, Stream, Subtitles}; -use stremio_watched_bitfield::WatchedBitField; use url::Url; -use crate::bridge::ToProtobuf; -use crate::protobuf::stremio::core::models; +use stremio_core::{ + deep_links::DiscoverDeepLinks, + models::{ + common::{DescriptorLoadable, ResourceLoadable}, + ctx::Ctx, + }, + types::{ + addon::{DescriptorPreview, ResourceRequest}, + library::LibraryItem, + resource::{MetaItem, MetaItemPreview, Stream, Subtitles}, + watched_bitfield::WatchedBitField, + }, +}; + +use crate::{bridge::ToProtobuf, protobuf::stremio::core::models}; impl ToProtobuf for ResourceLoadable> { - fn to_protobuf(&self, ctx: &Ctx) -> models::LoadablePage { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LoadablePage { let title = ctx .profile .addons @@ -41,11 +50,11 @@ impl ToProtobuf for ResourceLoadable(&()); models::LoadablePage { title, - request: self.request.to_protobuf(&()), - content: self.content.to_protobuf(&(ctx, &self.request)), + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(&(ctx, &self.request)), deep_links, } } @@ -54,15 +63,15 @@ impl ToProtobuf for ResourceLoadable, Option<&WatchedBitField>)> for &ResourceLoadable { - fn to_protobuf( + fn to_protobuf( &self, (ctx, library_item, watched): &(&Ctx, Option<&LibraryItem>, Option<&WatchedBitField>), ) -> models::LoadableMetaItem { let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableMetaItem { title: addon_name.to_string(), - request: self.request.to_protobuf(&()), - content: self.content.to_protobuf(&( + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(&( *library_item, *watched, Some(&addon_name), @@ -75,17 +84,20 @@ impl ToProtobuf, Option<&W impl ToProtobuf)> for ResourceLoadable> { - fn to_protobuf( + fn to_protobuf( &self, (ctx, meta_request): &(&Ctx, Option<&ResourceRequest>), ) -> models::LoadableStreams { let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableStreams { title: addon_name.to_owned(), - request: self.request.to_protobuf(&()), - content: self - .content - .to_protobuf(&(ctx, &addon_name, &self.request, *meta_request)), + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(&( + ctx, + &addon_name, + &self.request, + *meta_request, + )), } } } @@ -93,45 +105,57 @@ impl ToProtobuf)> impl ToProtobuf)> for ResourceLoadable> { - fn to_protobuf( + fn to_protobuf( &self, (ctx, meta_request): &(&Ctx, Option<&ResourceRequest>), ) -> models::LoadableStream { let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableStream { - request: self.request.to_protobuf(&()), - content: self - .content - .to_protobuf(&(ctx, &addon_name, &self.request, *meta_request)), + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(&( + ctx, + &addon_name, + &self.request, + *meta_request, + )), } } } impl ToProtobuf for ResourceLoadable> { - fn to_protobuf(&self, ctx: &Ctx) -> models::LoadableSubtitles { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LoadableSubtitles { let addon_name = get_addon_name(ctx, &self.request.base); models::LoadableSubtitles { title: addon_name.to_owned(), - request: self.request.to_protobuf(&()), - content: self.content.to_protobuf(&(Some(&addon_name))), + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(&(Some(&addon_name))), } } } impl ToProtobuf for &ResourceLoadable> { - fn to_protobuf(&self, ctx: &Ctx) -> models::LoadableAddonCatalog { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LoadableAddonCatalog { models::LoadableAddonCatalog { - request: self.request.to_protobuf(&()), - content: self.content.to_protobuf(ctx), + request: self.request.to_protobuf::(&()), + content: self.content.to_protobuf::(ctx), } } } impl ToProtobuf for DescriptorLoadable { - fn to_protobuf(&self, ctx: &Ctx) -> models::LoadableDescriptor { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LoadableDescriptor { models::LoadableDescriptor { transport_url: self.transport_url.to_string(), - content: Some(self.content.to_protobuf(ctx)), + content: Some(self.content.to_protobuf::(ctx)), } } } diff --git a/src/commonMain/rust/bridge/resource_path.rs b/stremio-core-protobuf/src/bridge/resource_path.rs similarity index 79% rename from src/commonMain/rust/bridge/resource_path.rs rename to stremio-core-protobuf/src/bridge/resource_path.rs index 2b4ddfc4..ac88ba23 100644 --- a/src/commonMain/rust/bridge/resource_path.rs +++ b/stremio-core-protobuf/src/bridge/resource_path.rs @@ -15,12 +15,15 @@ impl FromProtobuf for types::ResourcePath { } impl ToProtobuf for ResourcePath { - fn to_protobuf(&self, _args: &()) -> types::ResourcePath { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ResourcePath { types::ResourcePath { resource: self.resource.to_owned(), r#type: self.r#type.to_owned(), id: self.id.to_owned(), - extra: self.extra.to_protobuf(&()), + extra: self.extra.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/bridge/resource_request.rs b/stremio-core-protobuf/src/bridge/resource_request.rs similarity index 83% rename from src/commonMain/rust/bridge/resource_request.rs rename to stremio-core-protobuf/src/bridge/resource_request.rs index f506c2cc..4eba8996 100644 --- a/src/commonMain/rust/bridge/resource_request.rs +++ b/stremio-core-protobuf/src/bridge/resource_request.rs @@ -22,10 +22,13 @@ impl FromProtobuf for types::ResourceRequest { } impl ToProtobuf for ResourceRequest { - fn to_protobuf(&self, _args: &()) -> types::ResourceRequest { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ResourceRequest { types::ResourceRequest { base: self.base.to_string(), - path: self.path.to_protobuf(&()), + path: self.path.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/bridge/stream.rs b/stremio-core-protobuf/src/bridge/stream.rs similarity index 91% rename from src/commonMain/rust/bridge/stream.rs rename to stremio-core-protobuf/src/bridge/stream.rs index 6e1bb512..6b6be882 100644 --- a/src/commonMain/rust/bridge/stream.rs +++ b/stremio-core-protobuf/src/bridge/stream.rs @@ -80,7 +80,10 @@ impl FromProtobuf for types::Stream { } impl ToProtobuf for StreamSource { - fn to_protobuf(&self, _args: &()) -> types::stream::Source { + fn to_protobuf( + &self, + _args: &(), + ) -> types::stream::Source { match self { StreamSource::Url { url } => types::stream::Source::Url(types::stream::Url { url: url.to_string(), @@ -106,8 +109,8 @@ impl ToProtobuf for StreamSource { android_tv_url, .. } => types::stream::Source::External(types::stream::External { - external_url: external_url.to_protobuf(&()), - android_tv_url: android_tv_url.to_protobuf(&()), + external_url: external_url.to_protobuf::(&()), + android_tv_url: android_tv_url.to_protobuf::(&()), }), StreamSource::PlayerFrame { player_frame_url } => { types::stream::Source::PlayerFrame(types::stream::PlayerFrame { @@ -119,7 +122,7 @@ impl ToProtobuf for StreamSource { file_idx, file_must_include, } => types::stream::Source::Rar(types::stream::Rar { - rar_urls: rar_urls.to_protobuf(&()), + rar_urls: rar_urls.to_protobuf::(&()), file_idx: file_idx.map(|idx| idx as i32), file_must_include: file_must_include.to_owned(), }), @@ -128,7 +131,7 @@ impl ToProtobuf for StreamSource { file_idx, file_must_include, } => types::stream::Source::Zip(types::stream::Zip { - zip_urls: zip_urls.to_protobuf(&()), + zip_urls: zip_urls.to_protobuf::(&()), file_idx: file_idx.map(|idx| idx as i32), file_must_include: file_must_include.to_owned(), }), @@ -137,7 +140,10 @@ impl ToProtobuf for StreamSource { } impl ToProtobuf for StreamProxyHeaders { - fn to_protobuf(&self, _args: &()) -> types::StreamProxyHeaders { + fn to_protobuf( + &self, + _args: &(), + ) -> types::StreamProxyHeaders { types::StreamProxyHeaders { request: self.request.to_owned(), response: self.response.to_owned(), @@ -156,7 +162,7 @@ impl ), > for Stream { - fn to_protobuf( + fn to_protobuf( &self, (ctx, addon_name, stream_request, meta_request): &( Option<&Ctx>, @@ -189,7 +195,7 @@ impl name: self.name.to_owned().or_else(|| addon_name.cloned()), description: self.description.clone(), thumbnail: self.thumbnail.clone(), - subtitles: self.subtitles.to_protobuf(addon_name), + subtitles: self.subtitles.to_protobuf::(addon_name), behavior_hints: types::StreamBehaviorHints { not_web_ready: self.behavior_hints.not_web_ready, binge_group: self.behavior_hints.binge_group.to_owned(), @@ -198,7 +204,7 @@ impl .country_whitelist .to_owned() .unwrap_or_default(), - proxy_headers: self.behavior_hints.proxy_headers.to_protobuf(&()), + proxy_headers: self.behavior_hints.proxy_headers.to_protobuf::(&()), filename: self.behavior_hints.filename.to_owned(), video_hash: self.behavior_hints.video_hash.to_owned(), video_size: self.behavior_hints.video_size, @@ -210,7 +216,7 @@ impl streaming: deep_links.external_player.streaming, }, }, - source: Some(self.source.to_protobuf(&())), + source: Some(self.source.to_protobuf::(&())), } } } diff --git a/src/commonMain/rust/bridge/string.rs b/stremio-core-protobuf/src/bridge/string.rs similarity index 74% rename from src/commonMain/rust/bridge/string.rs rename to stremio-core-protobuf/src/bridge/string.rs index ecbb4086..3fc1291d 100644 --- a/src/commonMain/rust/bridge/string.rs +++ b/stremio-core-protobuf/src/bridge/string.rs @@ -8,7 +8,7 @@ impl FromProtobuf for String { } impl ToProtobuf for Url { - fn to_protobuf(&self, _args: &()) -> String { + fn to_protobuf(&self, _args: &()) -> String { self.to_string() } } diff --git a/src/commonMain/rust/bridge/subtitle.rs b/stremio-core-protobuf/src/bridge/subtitle.rs similarity index 80% rename from src/commonMain/rust/bridge/subtitle.rs rename to stremio-core-protobuf/src/bridge/subtitle.rs index b4a3e189..f4226213 100644 --- a/src/commonMain/rust/bridge/subtitle.rs +++ b/stremio-core-protobuf/src/bridge/subtitle.rs @@ -13,7 +13,10 @@ impl FromProtobuf for types::Subtitle { } impl ToProtobuf> for Subtitles { - fn to_protobuf(&self, addon_name: &Option<&String>) -> types::Subtitle { + fn to_protobuf( + &self, + addon_name: &Option<&String>, + ) -> types::Subtitle { types::Subtitle { lang: self.lang.to_string(), url: self.url.to_string(), diff --git a/stremio-core-protobuf/src/lib.rs b/stremio-core-protobuf/src/lib.rs new file mode 100644 index 00000000..b70b79a4 --- /dev/null +++ b/stremio-core-protobuf/src/lib.rs @@ -0,0 +1,30 @@ +#[doc(inline)] +pub use crate::{ + bridge::{FromProtobuf, ToProtobuf}, + protobuf::{ + // Re-export all google Protobuf specific structs + google::protobuf::*, + // Re-export Protobuf core modules on the API's top level + stremio::core as stremio_core_models, + }, +}; + +pub mod bridge; + +/// Model implementations. +/// The bridge between Core and Protobuf generated core data structures +/// +/// Includes ToProtobuf and FromProtobuf impls for fields of models and custom models themseves +pub mod model { + pub use addons::*; + + mod addons; + + // Impls of ToProtobuf & FromProtobuf + mod fields; +} + +#[allow(clippy::all)] +/// The generated module before any export's take place in the API's top level +/// Made public because of the compatibility with stremio-core-android +pub mod protobuf; diff --git a/src/commonMain/rust/model/addons.rs b/stremio-core-protobuf/src/model/addons.rs similarity index 100% rename from src/commonMain/rust/model/addons.rs rename to stremio-core-protobuf/src/model/addons.rs diff --git a/stremio-core-protobuf/src/model/fields.rs b/stremio-core-protobuf/src/model/fields.rs new file mode 100644 index 00000000..cb06de11 --- /dev/null +++ b/stremio-core-protobuf/src/model/fields.rs @@ -0,0 +1,12 @@ +mod addon_detail; +mod addons_with_filters; +mod catalogs_with_extra; +mod continue_watching_preview; +mod ctx; +mod discover; +mod library; +mod library_by_type; +mod link; +mod meta_details; +mod player; +mod streaming_server; diff --git a/stremio-core-protobuf/src/model/fields/addon_detail.rs b/stremio-core-protobuf/src/model/fields/addon_detail.rs new file mode 100644 index 00000000..d3adcf6b --- /dev/null +++ b/stremio-core-protobuf/src/model/fields/addon_detail.rs @@ -0,0 +1,44 @@ +use crate::bridge::{FromProtobuf, ToProtobuf}; +use crate::protobuf::stremio::core::models; +use stremio_core::models::addon_details::{AddonDetails, Selected}; +use stremio_core::models::ctx::Ctx; + +impl FromProtobuf for models::addon_details::Selected { + fn from_protobuf(&self) -> Selected { + let transport_url = self.transport_url.from_protobuf(); + + Selected { + transport_url: if transport_url.scheme() == "stremio" { + let replaced_url = transport_url.as_str().replacen("stremio://", "https://", 1); + + replaced_url.parse().expect("Should be able to parse URL") + } else { + transport_url + }, + } + } +} + +impl ToProtobuf for Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::addon_details::Selected { + models::addon_details::Selected { + transport_url: self.transport_url.to_string(), + } + } +} + +impl ToProtobuf for AddonDetails { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::AddonDetails { + models::AddonDetails { + selected: self.selected.to_protobuf::(&()), + local_addon: self.local_addon.to_protobuf::(ctx), + remote_addon: self.remote_addon.to_protobuf::(ctx), + } + } +} diff --git a/src/commonMain/rust/model/fields/addons_with_filters.rs b/stremio-core-protobuf/src/model/fields/addons_with_filters.rs similarity index 85% rename from src/commonMain/rust/model/fields/addons_with_filters.rs rename to stremio-core-protobuf/src/model/fields/addons_with_filters.rs index a07e32e4..c7955a0c 100644 --- a/src/commonMain/rust/model/fields/addons_with_filters.rs +++ b/stremio-core-protobuf/src/model/fields/addons_with_filters.rs @@ -25,7 +25,10 @@ impl FromProtobuf } impl ToProtobuf for InstalledAddonsRequest { - fn to_protobuf(&self, _args: &()) -> types::ResourceRequest { + fn to_protobuf( + &self, + _args: &(), + ) -> types::ResourceRequest { types::ResourceRequest { base: "".to_string(), path: types::ResourcePath { @@ -41,24 +44,30 @@ impl ToProtobuf for InstalledAddonsRequest { impl ToProtobuf for installed_addons_with_filters::Selected { - fn to_protobuf(&self, _args: &()) -> models::addons_with_filters::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::addons_with_filters::Selected { models::addons_with_filters::Selected { - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for AddonsWithFilters { - fn to_protobuf(&self, ctx: &Ctx) -> models::AddonsWithFilters { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::AddonsWithFilters { models::AddonsWithFilters { selected: self .remote_addons .selected .to_owned() .map(|selected| models::addons_with_filters::Selected { - request: selected.request.to_protobuf(&()), + request: selected.request.to_protobuf::(&()), }) - .or_else(|| self.installed_addons.selected.to_protobuf(&())), + .or_else(|| self.installed_addons.selected.to_protobuf::(&())), selectable: models::addons_with_filters::Selectable { types: match &self.remote_addons.selected.is_some() { true => self @@ -70,7 +79,7 @@ impl ToProtobuf for AddonsWithFilters { |selectable_type| models::addons_with_filters::SelectableType { r#type: selectable_type.r#type.to_string(), selected: selectable_type.selected, - request: selectable_type.request.to_protobuf(&()), + request: selectable_type.request.to_protobuf::(&()), }, ) .collect(), @@ -83,7 +92,7 @@ impl ToProtobuf for AddonsWithFilters { |selectable_type| models::addons_with_filters::SelectableType { r#type: selectable_type.r#type.clone().unwrap_or_default(), selected: selectable_type.selected, - request: selectable_type.request.to_protobuf(&()), + request: selectable_type.request.to_protobuf::(&()), }, ) .collect(), @@ -96,12 +105,12 @@ impl ToProtobuf for AddonsWithFilters { .map(|catalog| models::addons_with_filters::SelectableCatalog { name: catalog.catalog.to_owned(), selected: catalog.selected, - request: catalog.request.to_protobuf(&()), + request: catalog.request.to_protobuf::(&()), }) .chain([models::addons_with_filters::SelectableCatalog { name: "Installed".to_string(), selected: self.remote_addons.selected.is_none(), - request: InstalledAddonsRequest { r#type: None }.to_protobuf(&()), + request: InstalledAddonsRequest { r#type: None }.to_protobuf::(&()), }]) .collect(), }, @@ -110,16 +119,16 @@ impl ToProtobuf for AddonsWithFilters { .remote_addons .catalog .first() - .map(|page| page.to_protobuf(ctx)), + .map(|page| page.to_protobuf::(ctx)), None => { self.installed_addons .selected .as_ref() .map(|selected| LoadableAddonCatalog { - request: selected.request.to_protobuf(&()), + request: selected.request.to_protobuf::(&()), content: Some(models::loadable_addon_catalog::Content::Ready( models::Addons { - items: self.installed_addons.catalog.to_protobuf(ctx), + items: self.installed_addons.catalog.to_protobuf::(ctx), }, )), }) diff --git a/src/commonMain/rust/model/fields/catalogs_with_extra.rs b/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs similarity index 61% rename from src/commonMain/rust/model/fields/catalogs_with_extra.rs rename to stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs index 870ed3cb..62eb490d 100644 --- a/src/commonMain/rust/model/fields/catalogs_with_extra.rs +++ b/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs @@ -17,33 +17,42 @@ impl FromProtobuf for models::catalogs_with_extra::Selected { } impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::catalogs_with_extra::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalogs_with_extra::Selected { models::catalogs_with_extra::Selected { r#type: self.r#type.clone(), - extra: self.extra.to_protobuf(&()), + extra: self.extra.to_protobuf::(&()), } } } impl ToProtobuf for Catalog { - fn to_protobuf(&self, ctx: &Ctx) -> models::Catalog { + fn to_protobuf(&self, ctx: &Ctx) -> models::Catalog { models::Catalog { - pages: self.iter().map(|page| page.to_protobuf(ctx)).collect(), + pages: self.iter().map(|page| page.to_protobuf::(ctx)).collect(), } } } impl ToProtobuf for CatalogsWithExtra { - fn to_protobuf(&self, ctx: &Ctx) -> models::CatalogsWithExtra { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::CatalogsWithExtra { models::CatalogsWithExtra { - selected: self.selected.to_protobuf(&()), - catalogs: self.catalogs.to_protobuf(ctx), + selected: self.selected.to_protobuf::(&()), + catalogs: self.catalogs.to_protobuf::(ctx), } } } impl ToProtobuf for DiscoverDeepLinks { - fn to_protobuf(&self, _args: &()) -> models::DiscoverDeepLinks { + fn to_protobuf( + &self, + _args: &(), + ) -> models::DiscoverDeepLinks { models::DiscoverDeepLinks { discover: self.discover.clone(), } diff --git a/src/commonMain/rust/model/fields/continue_watching_preview.rs b/stremio-core-protobuf/src/model/fields/continue_watching_preview.rs similarity index 53% rename from src/commonMain/rust/model/fields/continue_watching_preview.rs rename to stremio-core-protobuf/src/model/fields/continue_watching_preview.rs index f098d9e5..4c0d2495 100644 --- a/src/commonMain/rust/model/fields/continue_watching_preview.rs +++ b/stremio-core-protobuf/src/model/fields/continue_watching_preview.rs @@ -5,16 +5,22 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::{models, types}; impl ToProtobuf for Item { - fn to_protobuf(&self, ctx: &Ctx) -> types::LibraryItem { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> types::LibraryItem { self.library_item - .to_protobuf(&(ctx, Some(self.notifications))) + .to_protobuf::(&(ctx, Some(self.notifications))) } } impl ToProtobuf for ContinueWatchingPreview { - fn to_protobuf(&self, ctx: &Ctx) -> models::ContinueWatchingPreview { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::ContinueWatchingPreview { models::ContinueWatchingPreview { - library_items: self.items.to_protobuf(ctx), + library_items: self.items.to_protobuf::(ctx), } } } diff --git a/stremio-core-protobuf/src/model/fields/ctx.rs b/stremio-core-protobuf/src/model/fields/ctx.rs new file mode 100644 index 00000000..9c14041f --- /dev/null +++ b/stremio-core-protobuf/src/model/fields/ctx.rs @@ -0,0 +1,12 @@ +use crate::bridge::ToProtobuf; +use crate::protobuf::stremio::core::models; +use stremio_core::models::ctx::Ctx; + +impl ToProtobuf for Ctx { + fn to_protobuf(&self, _args: &()) -> models::Ctx { + models::Ctx { + profile: self.profile.to_protobuf::(&()), + events: self.events.to_protobuf::(&()), + } + } +} diff --git a/src/commonMain/rust/model/fields/discover.rs b/stremio-core-protobuf/src/model/fields/discover.rs similarity index 52% rename from src/commonMain/rust/model/fields/discover.rs rename to stremio-core-protobuf/src/model/fields/discover.rs index 582288e6..8884cd0a 100644 --- a/src/commonMain/rust/model/fields/discover.rs +++ b/stremio-core-protobuf/src/model/fields/discover.rs @@ -17,78 +17,102 @@ impl FromProtobuf for models::catalog_with_filters::Selected { } impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::Selected { models::catalog_with_filters::Selected { - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableType { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::SelectableType { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::SelectableType { models::catalog_with_filters::SelectableType { r#type: self.r#type.to_string(), selected: self.selected, - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableCatalog { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::SelectableCatalog { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::SelectableCatalog { models::catalog_with_filters::SelectableCatalog { name: self.catalog.to_string(), selected: self.selected, - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableExtraOption { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::SelectableExtraOption { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::SelectableExtraOption { models::catalog_with_filters::SelectableExtraOption { value: self.value.clone(), selected: self.selected, - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableExtra { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::SelectableExtra { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::SelectableExtra { models::catalog_with_filters::SelectableExtra { name: self.name.to_string(), is_required: self.is_required, - options: self.options.to_protobuf(&()), + options: self.options.to_protobuf::(&()), } } } impl ToProtobuf for SelectablePage { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::SelectablePage { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::SelectablePage { models::catalog_with_filters::SelectablePage { - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for Selectable { - fn to_protobuf(&self, _args: &()) -> models::catalog_with_filters::Selectable { + fn to_protobuf( + &self, + _args: &(), + ) -> models::catalog_with_filters::Selectable { models::catalog_with_filters::Selectable { - types: self.types.to_protobuf(&()), - catalogs: self.catalogs.to_protobuf(&()), - extra: self.extra.to_protobuf(&()), - next_page: self.next_page.to_protobuf(&()), + types: self.types.to_protobuf::(&()), + catalogs: self.catalogs.to_protobuf::(&()), + extra: self.extra.to_protobuf::(&()), + next_page: self.next_page.to_protobuf::(&()), } } } impl ToProtobuf for CatalogWithFilters { - fn to_protobuf(&self, ctx: &Ctx) -> models::CatalogWithFilters { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::CatalogWithFilters { models::CatalogWithFilters { - selected: self.selected.to_protobuf(&()), - selectable: self.selectable.to_protobuf(&()), - catalog: self.catalog.to_protobuf(ctx), + selected: self.selected.to_protobuf::(&()), + selectable: self.selectable.to_protobuf::(&()), + catalog: self.catalog.to_protobuf::(ctx), } } } diff --git a/src/commonMain/rust/model/fields/library.rs b/stremio-core-protobuf/src/model/fields/library.rs similarity index 66% rename from src/commonMain/rust/model/fields/library.rs rename to stremio-core-protobuf/src/model/fields/library.rs index af531771..0fee9e72 100644 --- a/src/commonMain/rust/model/fields/library.rs +++ b/stremio-core-protobuf/src/model/fields/library.rs @@ -48,7 +48,10 @@ impl FromProtobuf for models::library_with_filters::Selected { } impl ToProtobuf for Sort { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::Sort { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::Sort { match self { Sort::LastWatched => models::library_with_filters::Sort::LastWatched, Sort::Name => models::library_with_filters::Sort::Name, @@ -61,67 +64,88 @@ impl ToProtobuf for Sort { } impl ToProtobuf for LibraryRequest { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::LibraryRequest { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::LibraryRequest { models::library_with_filters::LibraryRequest { r#type: self.r#type.clone(), - sort: self.sort.to_protobuf(&()) as i32, + sort: self.sort.to_protobuf::(&()) as i32, page: i64::try_from(self.page.0.get()).unwrap_or(i64::MAX), } } } impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::Selected { models::library_with_filters::Selected { - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableType { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::SelectableType { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::SelectableType { models::library_with_filters::SelectableType { r#type: self.r#type.clone(), selected: self.selected, - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectableSort { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::SelectableSort { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::SelectableSort { models::library_with_filters::SelectableSort { - sort: self.sort.to_protobuf(&()) as i32, + sort: self.sort.to_protobuf::(&()) as i32, selected: self.selected, - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for SelectablePage { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::SelectablePage { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::SelectablePage { models::library_with_filters::SelectablePage { - request: self.request.to_protobuf(&()), + request: self.request.to_protobuf::(&()), } } } impl ToProtobuf for Selectable { - fn to_protobuf(&self, _args: &()) -> models::library_with_filters::Selectable { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_with_filters::Selectable { models::library_with_filters::Selectable { - types: self.types.to_protobuf(&()), - sorts: self.sorts.to_protobuf(&()), - next_page: self.next_page.to_protobuf(&()), + types: self.types.to_protobuf::(&()), + sorts: self.sorts.to_protobuf::(&()), + next_page: self.next_page.to_protobuf::(&()), } } } impl ToProtobuf for LibraryWithFilters { - fn to_protobuf(&self, ctx: &Ctx) -> models::LibraryWithFilters { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LibraryWithFilters { models::LibraryWithFilters { - selected: self.selected.to_protobuf(&()), - selectable: self.selectable.to_protobuf(&()), - catalog: self.catalog.to_protobuf(&(ctx, None)), + selected: self.selected.to_protobuf::(&()), + selectable: self.selectable.to_protobuf::(&()), + catalog: self.catalog.to_protobuf::(&(ctx, None)), } } } diff --git a/src/commonMain/rust/model/fields/library_by_type.rs b/stremio-core-protobuf/src/model/fields/library_by_type.rs similarity index 57% rename from src/commonMain/rust/model/fields/library_by_type.rs rename to stremio-core-protobuf/src/model/fields/library_by_type.rs index 9d370203..a215859e 100644 --- a/src/commonMain/rust/model/fields/library_by_type.rs +++ b/stremio-core-protobuf/src/model/fields/library_by_type.rs @@ -19,36 +19,48 @@ impl FromProtobuf for models::library_by_type::Selected { } impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::library_by_type::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_by_type::Selected { models::library_by_type::Selected { - sort: self.sort.to_protobuf(&()) as i32, + sort: self.sort.to_protobuf::(&()) as i32, } } } impl ToProtobuf for SelectableSort { - fn to_protobuf(&self, _args: &()) -> models::library_by_type::SelectableSort { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_by_type::SelectableSort { models::library_by_type::SelectableSort { - sort: self.sort.to_protobuf(&()) as i32, + sort: self.sort.to_protobuf::(&()) as i32, selected: self.selected, } } } impl ToProtobuf for Selectable { - fn to_protobuf(&self, _args: &()) -> models::library_by_type::Selectable { + fn to_protobuf( + &self, + _args: &(), + ) -> models::library_by_type::Selectable { models::library_by_type::Selectable { - sorts: self.sorts.to_protobuf(&()), + sorts: self.sorts.to_protobuf::(&()), } } } impl ToProtobuf for Catalog { - fn to_protobuf(&self, ctx: &Ctx) -> models::LibraryCatalog { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LibraryCatalog { let items = self .iter() .flatten() - .map(|item| item.to_protobuf(&(ctx, None))) + .map(|item| item.to_protobuf::(&(ctx, None))) .collect::>(); let r#type = items.first().map(|item| item.r#type.to_owned()); models::LibraryCatalog { r#type, items } @@ -56,11 +68,14 @@ impl ToProtobuf for Catalog { } impl ToProtobuf for LibraryByType { - fn to_protobuf(&self, ctx: &Ctx) -> models::LibraryByType { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::LibraryByType { models::LibraryByType { - selected: self.selected.to_protobuf(&()), - selectable: self.selectable.to_protobuf(&()), - catalogs: self.catalogs.to_protobuf(ctx), + selected: self.selected.to_protobuf::(&()), + selectable: self.selectable.to_protobuf::(&()), + catalogs: self.catalogs.to_protobuf::(ctx), } } } diff --git a/src/commonMain/rust/model/fields/link.rs b/stremio-core-protobuf/src/model/fields/link.rs similarity index 56% rename from src/commonMain/rust/model/fields/link.rs rename to stremio-core-protobuf/src/model/fields/link.rs index ff862cb8..bce77960 100644 --- a/src/commonMain/rust/model/fields/link.rs +++ b/stremio-core-protobuf/src/model/fields/link.rs @@ -5,10 +5,10 @@ use crate::bridge::ToProtobuf; use crate::protobuf::stremio::core::models; impl ToProtobuf for Link { - fn to_protobuf(&self, _args: &()) -> models::AuthLink { + fn to_protobuf(&self, _args: &()) -> models::AuthLink { models::AuthLink { - code: self.code.to_protobuf(&()), - data: self.data.to_protobuf(&()), + code: self.code.to_protobuf::(&()), + data: self.data.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/model/fields/meta_details.rs b/stremio-core-protobuf/src/model/fields/meta_details.rs similarity index 80% rename from src/commonMain/rust/model/fields/meta_details.rs rename to stremio-core-protobuf/src/model/fields/meta_details.rs index d75513ad..52336786 100644 --- a/src/commonMain/rust/model/fields/meta_details.rs +++ b/stremio-core-protobuf/src/model/fields/meta_details.rs @@ -6,10 +6,9 @@ use stremio_core::runtime::Env; use stremio_core::types::addon::ResourceRequest; use stremio_core::types::library::LibraryItem; use stremio_core::types::resource::{MetaItem, SeriesInfo, Video}; -use stremio_watched_bitfield::WatchedBitField; +use stremio_core::types::watched_bitfield::WatchedBitField; use crate::bridge::{FromProtobuf, ToProtobuf}; -use crate::env::AndroidEnv; use crate::protobuf::stremio::core::{models, types}; impl FromProtobuf for models::meta_details::Selected { @@ -23,17 +22,17 @@ impl FromProtobuf for models::meta_details::Selected { } impl ToProtobuf for Selected { - fn to_protobuf(&self, _args: &()) -> models::meta_details::Selected { + fn to_protobuf(&self, _args: &()) -> models::meta_details::Selected { models::meta_details::Selected { - meta_path: self.meta_path.to_protobuf(&()), - stream_path: self.stream_path.to_protobuf(&()), + meta_path: self.meta_path.to_protobuf::(&()), + stream_path: self.stream_path.to_protobuf::(&()), guess_stream_path: self.guess_stream, } } } impl ToProtobuf for SeriesInfo { - fn to_protobuf(&self, _args: &()) -> types::video::SeriesInfo { + fn to_protobuf(&self, _args: &()) -> types::video::SeriesInfo { types::video::SeriesInfo { season: self.season as i64, episode: self.episode as i64, @@ -60,7 +59,7 @@ impl ), > for Video { - fn to_protobuf( + fn to_protobuf( &self, (library_item, watched, addon_name): &( Option<&LibraryItem>, @@ -71,14 +70,16 @@ impl types::Video { id: self.id.to_string(), title: self.title.to_string(), - released: self.released.to_protobuf(&()), + released: self.released.to_protobuf::(&()), overview: self.overview.clone(), thumbnail: self.thumbnail.clone(), - streams: self.streams.to_protobuf(&(None, *addon_name, None, None)), - series_info: self.series_info.to_protobuf(&()), + streams: self + .streams + .to_protobuf::(&(None, *addon_name, None, None)), + series_info: self.series_info.to_protobuf::(&()), upcoming: self .released - .map(|released| released > AndroidEnv::now()) + .map(|released| released > E::now()) .unwrap_or_default(), watched: watched .map(|watched| watched.get_video(&self.id)) @@ -119,7 +120,7 @@ impl ), > for MetaItem { - fn to_protobuf( + fn to_protobuf( &self, (library_item, watched, addon_name, meta_request): &( Option<&LibraryItem>, @@ -132,24 +133,24 @@ impl id: self.preview.id.to_string(), r#type: self.preview.r#type.to_string(), name: self.preview.name.to_string(), - poster_shape: self.preview.poster_shape.to_protobuf(&()) as i32, - poster: self.preview.poster.to_protobuf(&()), - background: self.preview.background.to_protobuf(&()), - logo: self.preview.logo.to_protobuf(&()), + poster_shape: self.preview.poster_shape.to_protobuf::(&()) as i32, + poster: self.preview.poster.to_protobuf::(&()), + background: self.preview.background.to_protobuf::(&()), + logo: self.preview.logo.to_protobuf::(&()), description: self.preview.description.clone(), release_info: self.preview.release_info.clone(), runtime: self.preview.runtime.clone(), - released: self.preview.released.to_protobuf(&()), - links: self.preview.links.to_protobuf(&()), + released: self.preview.released.to_protobuf::(&()), + links: self.preview.links.to_protobuf::(&()), trailer_streams: self .preview .trailer_streams - .to_protobuf(&(None, None, None, None)), + .to_protobuf::(&(None, None, None, None)), videos: self .videos - .to_protobuf(&(*library_item, *watched, *addon_name)), - behavior_hints: self.preview.behavior_hints.to_protobuf(&()), - deep_links: MetaItemDeepLinks::from((self, *meta_request)).to_protobuf(&()), + .to_protobuf::(&(*library_item, *watched, *addon_name)), + behavior_hints: self.preview.behavior_hints.to_protobuf::(&()), + deep_links: MetaItemDeepLinks::from((self, *meta_request)).to_protobuf::(&()), progress: library_item.and_then(|item| { if item.state.time_offset > 0 && item.state.duration > 0 { Some(item.state.time_offset as f64 / item.state.duration as f64) @@ -166,7 +167,7 @@ impl } impl ToProtobuf for MetaDetails { - fn to_protobuf(&self, ctx: &Ctx) -> models::MetaDetails { + fn to_protobuf(&self, ctx: &Ctx) -> models::MetaDetails { let meta_item = self .meta_items .iter() @@ -221,15 +222,15 @@ impl ToProtobuf for MetaDetails { .unwrap_or_else(|| meta_item.preview.name.to_owned()) }); models::MetaDetails { - selected: self.selected.to_protobuf(&()), + selected: self.selected.to_protobuf::(&()), title, - meta_item: meta_item.to_protobuf(&( + meta_item: meta_item.to_protobuf::(&( ctx, self.library_item.as_ref(), self.watched.as_ref(), )), - streams: streams.to_protobuf(&(ctx, meta_request)), - suggested_stream: self.suggested_stream.to_protobuf(&(ctx, meta_request)), + streams: streams.to_protobuf::(&(ctx, meta_request)), + suggested_stream: self.suggested_stream.to_protobuf::(&(ctx, meta_request)), } } } diff --git a/src/commonMain/rust/model/fields/player.rs b/stremio-core-protobuf/src/model/fields/player.rs similarity index 69% rename from src/commonMain/rust/model/fields/player.rs rename to stremio-core-protobuf/src/model/fields/player.rs index bad3a5da..78cdbb8e 100644 --- a/src/commonMain/rust/model/fields/player.rs +++ b/stremio-core-protobuf/src/model/fields/player.rs @@ -59,7 +59,10 @@ impl FromProtobuf for models::player::VideoParams { } impl ToProtobuf for VideoParams { - fn to_protobuf(&self, _args: &()) -> models::player::VideoParams { + fn to_protobuf( + &self, + _args: &(), + ) -> models::player::VideoParams { models::player::VideoParams { hash: self.hash.to_owned(), size: self.size.map(|x| x as i64).to_owned(), @@ -69,11 +72,14 @@ impl ToProtobuf for VideoParams { } impl ToProtobuf for StreamItemState { - fn to_protobuf(&self, _args: &()) -> models::player::StreamState { + fn to_protobuf( + &self, + _args: &(), + ) -> models::player::StreamState { models::player::StreamState { - subtitle_track: self.subtitle_track.to_protobuf(&()), + subtitle_track: self.subtitle_track.to_protobuf::(&()), subtitle_delay: self.subtitle_delay.to_owned(), - audio_track: self.audio_track.to_protobuf(&()), + audio_track: self.audio_track.to_protobuf::(&()), audio_delay: self.audio_delay.to_owned(), playback_speed: self.playback_speed.to_owned(), player_type: self.player_type.to_owned(), @@ -82,7 +88,10 @@ impl ToProtobuf for StreamItemState { } impl ToProtobuf for SubtitleTrack { - fn to_protobuf(&self, _args: &()) -> models::player::SubtitleTrack { + fn to_protobuf( + &self, + _args: &(), + ) -> models::player::SubtitleTrack { models::player::SubtitleTrack { id: self.id.to_owned(), embedded: self.embedded, @@ -92,7 +101,10 @@ impl ToProtobuf for SubtitleTrack { } impl ToProtobuf for AudioTrack { - fn to_protobuf(&self, _args: &()) -> models::player::AudioTrack { + fn to_protobuf( + &self, + _args: &(), + ) -> models::player::AudioTrack { models::player::AudioTrack { id: self.id.to_owned(), language: self.language.to_owned(), @@ -101,7 +113,10 @@ impl ToProtobuf for AudioTrack { } impl ToProtobuf for Selected { - fn to_protobuf(&self, ctx: &Ctx) -> models::player::Selected { + fn to_protobuf( + &self, + ctx: &Ctx, + ) -> models::player::Selected { let addon_name = self.stream_request.as_ref().and_then(|request| { ctx.profile .addons @@ -112,33 +127,33 @@ impl ToProtobuf for Selected { models::player::Selected { stream: self .stream - .to_protobuf(&(Some(ctx), addon_name, None, None)), - stream_request: self.stream_request.to_protobuf(&()), - meta_request: self.meta_request.to_protobuf(&()), - subtitles_path: self.subtitles_path.to_protobuf(&()), + .to_protobuf::(&(Some(ctx), addon_name, None, None)), + stream_request: self.stream_request.to_protobuf::(&()), + meta_request: self.meta_request.to_protobuf::(&()), + subtitles_path: self.subtitles_path.to_protobuf::(&()), } } } impl ToProtobuf for Player { - fn to_protobuf(&self, ctx: &Ctx) -> models::Player { + fn to_protobuf(&self, ctx: &Ctx) -> models::Player { models::Player { - selected: self.selected.to_protobuf(ctx), - video_params: self.video_params.to_protobuf(&()), - meta_item: self.meta_item.as_ref().to_protobuf(&( + selected: self.selected.to_protobuf::(ctx), + video_params: self.video_params.to_protobuf::(&()), + meta_item: self.meta_item.as_ref().to_protobuf::(&( ctx, self.library_item.as_ref(), self.watched.as_ref(), )), - subtitles: self.subtitles.to_protobuf(ctx), - next_video: self.next_video.to_protobuf(&( + subtitles: self.subtitles.to_protobuf::(ctx), + next_video: self.next_video.to_protobuf::(&( self.library_item.as_ref(), self.watched.as_ref(), None, )), - series_info: self.series_info.to_protobuf(&()), - library_item: self.library_item.to_protobuf(&(ctx, None)), - stream_state: self.stream_state.to_protobuf(&()), + series_info: self.series_info.to_protobuf::(&()), + library_item: self.library_item.to_protobuf::(&(ctx, None)), + stream_state: self.stream_state.to_protobuf::(&()), } } } diff --git a/src/commonMain/rust/model/fields/streaming_server.rs b/stremio-core-protobuf/src/model/fields/streaming_server.rs similarity index 72% rename from src/commonMain/rust/model/fields/streaming_server.rs rename to stremio-core-protobuf/src/model/fields/streaming_server.rs index 20462ab5..18a2bb5b 100644 --- a/src/commonMain/rust/model/fields/streaming_server.rs +++ b/stremio-core-protobuf/src/model/fields/streaming_server.rs @@ -1,7 +1,9 @@ -use stremio_core::models::streaming_server::{ - PlaybackDevice, Selected as StreamingServerSelected, StatisticsRequest, StreamingServer, +use stremio_core::{ + models::streaming_server::{ + PlaybackDevice, Selected as StreamingServerSelected, StreamingServer, + }, + types::streaming_server::{Settings, Statistics, StatisticsRequest}, }; -use stremio_core::types::streaming_server::{Settings, Statistics}; use crate::bridge::{FromProtobuf, ToProtobuf}; use crate::protobuf::stremio::core::models; @@ -15,6 +17,7 @@ impl FromProtobuf for models::streaming_server::Settings { remote_https: self.remote_https.clone(), transcode_profile: self.transcode_profile.to_owned(), cache_size: self.cache_size.to_owned(), + proxy_streams_enabled: self.proxy_streams_enabled, bt_max_connections: self.bt_max_connections, bt_handshake_timeout: self.bt_handshake_timeout, bt_request_timeout: self.bt_request_timeout, @@ -35,7 +38,10 @@ impl FromProtobuf for models::streaming_server::StatisticsReq } impl ToProtobuf for StreamingServerSelected { - fn to_protobuf(&self, _args: &()) -> models::streaming_server::Selected { + fn to_protobuf( + &self, + _args: &(), + ) -> models::streaming_server::Selected { models::streaming_server::Selected { transport_url: self.transport_url.to_string(), } @@ -43,7 +49,10 @@ impl ToProtobuf for StreamingServerSelec } impl ToProtobuf for PlaybackDevice { - fn to_protobuf(&self, _args: &()) -> models::streaming_server::PlaybackDevice { + fn to_protobuf( + &self, + _args: &(), + ) -> models::streaming_server::PlaybackDevice { models::streaming_server::PlaybackDevice { id: self.id.to_string(), name: self.id.to_string(), @@ -53,7 +62,10 @@ impl ToProtobuf for PlaybackDevice } impl ToProtobuf for Statistics { - fn to_protobuf(&self, _args: &()) -> models::streaming_server::Statistics { + fn to_protobuf( + &self, + _args: &(), + ) -> models::streaming_server::Statistics { models::streaming_server::Statistics { name: self.name.to_string(), info_hash: self.info_hash.to_string(), @@ -78,7 +90,10 @@ impl ToProtobuf for Statistics { } impl ToProtobuf for Settings { - fn to_protobuf(&self, _args: &()) -> models::streaming_server::Settings { + fn to_protobuf( + &self, + _args: &(), + ) -> models::streaming_server::Settings { models::streaming_server::Settings { app_path: self.app_path.to_string(), cache_root: self.cache_root.to_string(), @@ -86,6 +101,7 @@ impl ToProtobuf for Settings { remote_https: self.remote_https.clone(), transcode_profile: self.transcode_profile.to_owned(), cache_size: self.cache_size, + proxy_streams_enabled: self.proxy_streams_enabled, bt_max_connections: self.bt_max_connections, bt_handshake_timeout: self.bt_handshake_timeout, bt_request_timeout: self.bt_request_timeout, @@ -97,19 +113,22 @@ impl ToProtobuf for Settings { } impl ToProtobuf for StreamingServer { - fn to_protobuf(&self, _args: &()) -> models::StreamingServer { + fn to_protobuf( + &self, + _args: &(), + ) -> models::StreamingServer { models::StreamingServer { - selected: self.selected.to_protobuf(&()), - settings: self.settings.to_protobuf(&()), - base_url: self.base_url.to_protobuf(&()), - remote_url: self.remote_url.to_protobuf(&()), + selected: self.selected.to_protobuf::(&()), + settings: self.settings.to_protobuf::(&()), + base_url: self.base_url.to_protobuf::(&()), + remote_url: self.remote_url.to_protobuf::(&()), torrent: self .torrent .to_owned() .map(|torrent| torrent.1) - .map(|path| path.to_protobuf(&())), - playback_devices: self.playback_devices.to_protobuf(&()), - statistics: self.statistics.to_protobuf(&()), + .map(|path| path.to_protobuf::(&())), + playback_devices: self.playback_devices.to_protobuf::(&()), + statistics: self.statistics.to_protobuf::(&()), } } }