From c275ea82ac9b14290eaa934cb1eab1a2548a9274 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 16 Sep 2024 09:52:42 +0200 Subject: [PATCH 1/2] Indicate Apache-2.0 license accordingly --- LICENSE-APACHE | 202 ++++++++++++++++++++++++++++++++ LICENSE => LICENSE-MIT | 0 README.md | 5 +- examples/Cargo.toml | 2 +- examples/LICENSE | 19 --- examples/LICENSE-APACHE | 1 + examples/LICENSE-MIT | 1 + interop/Cargo.toml | 2 +- interop/LICENSE | 19 --- interop/LICENSE-APACHE | 1 + interop/LICENSE-MIT | 1 + tonic-build/LICENSE | 19 --- tonic-build/LICENSE-MIT | 1 + tonic-health/Cargo.toml | 2 +- tonic-health/LICENSE | 19 --- tonic-health/LICENSE-APACHE | 1 + tonic-health/LICENSE-MIT | 1 + tonic-reflection/Cargo.toml | 2 +- tonic-reflection/LICENSE | 19 --- tonic-reflection/LICENSE-APACHE | 1 + tonic-reflection/LICENSE-MIT | 1 + tonic-types/Cargo.toml | 2 +- tonic-types/LICENSE | 19 --- tonic-types/LICENSE-APACHE | 1 + tonic-types/LICENSE-MIT | 1 + tonic-web/LICENSE | 19 --- tonic-web/LICENSE-MIT | 1 + tonic/Cargo.toml | 2 +- tonic/LICENSE | 19 --- tonic/LICENSE-APACHE | 1 + tonic/LICENSE-MIT | 1 + 31 files changed, 225 insertions(+), 160 deletions(-) create mode 100644 LICENSE-APACHE rename LICENSE => LICENSE-MIT (100%) delete mode 100644 examples/LICENSE create mode 120000 examples/LICENSE-APACHE create mode 120000 examples/LICENSE-MIT delete mode 100644 interop/LICENSE create mode 120000 interop/LICENSE-APACHE create mode 120000 interop/LICENSE-MIT delete mode 100644 tonic-build/LICENSE create mode 120000 tonic-build/LICENSE-MIT delete mode 100644 tonic-health/LICENSE create mode 120000 tonic-health/LICENSE-APACHE create mode 120000 tonic-health/LICENSE-MIT delete mode 100644 tonic-reflection/LICENSE create mode 120000 tonic-reflection/LICENSE-APACHE create mode 120000 tonic-reflection/LICENSE-MIT delete mode 100644 tonic-types/LICENSE create mode 120000 tonic-types/LICENSE-APACHE create mode 120000 tonic-types/LICENSE-MIT delete mode 100644 tonic-web/LICENSE create mode 120000 tonic-web/LICENSE-MIT delete mode 100644 tonic/LICENSE create mode 120000 tonic/LICENSE-APACHE create mode 120000 tonic/LICENSE-MIT diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/LICENSE-APACHE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE b/LICENSE-MIT similarity index 100% rename from LICENSE rename to LICENSE-MIT diff --git a/README.md b/README.md index afdd2b223..71bdec9aa 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ RPC framework that puts mobile and HTTP/2 first. [![Crates.io](https://img.shields.io/crates/v/tonic)](https://crates.io/crates/tonic) [![Documentation](https://docs.rs/tonic/badge.svg)](https://docs.rs/tonic) -[![Crates.io](https://img.shields.io/crates/l/tonic)](LICENSE) +![Crates.io](https://img.shields.io/crates/l/tonic) [Examples] | [Website] | [Docs] | [Chat] @@ -124,7 +124,8 @@ project. ## License -This project is licensed under the [MIT license](LICENSE). +This project is licensed under the [MIT](LICENSE-MIT) and [Apache-2.0](LICENSE-APACHE) +licenses. ### Contribution diff --git a/examples/Cargo.toml b/examples/Cargo.toml index aea9133e1..fbcb2b20c 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Lucio Franco "] edition = "2021" -license = "MIT" +license = "MIT AND Apache-2.0" name = "examples" publish = false version = "0.1.0" diff --git a/examples/LICENSE b/examples/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/examples/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/examples/LICENSE-APACHE b/examples/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/examples/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/examples/LICENSE-MIT b/examples/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/examples/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/interop/Cargo.toml b/interop/Cargo.toml index 5ec668f4f..64096c45b 100644 --- a/interop/Cargo.toml +++ b/interop/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Lucio Franco "] edition = "2021" -license = "MIT" +license = "MIT AND Apache-2.0" name = "interop" publish = false version = "0.1.0" diff --git a/interop/LICENSE b/interop/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/interop/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/interop/LICENSE-APACHE b/interop/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/interop/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/interop/LICENSE-MIT b/interop/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/interop/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic-build/LICENSE b/tonic-build/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-build/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-build/LICENSE-MIT b/tonic-build/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic-build/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index 5591db3b3..a6fb4a386 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/tonic-health/0.12.2" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "async", "healthcheck"] -license = "MIT" +license = "MIT AND Apache-2.0" name = "tonic-health" readme = "README.md" repository = "https://github.com/hyperium/tonic" diff --git a/tonic-health/LICENSE b/tonic-health/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-health/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-health/LICENSE-APACHE b/tonic-health/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/tonic-health/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/tonic-health/LICENSE-MIT b/tonic-health/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic-health/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index 031293ace..ea94c5e4d 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" homepage = "https://github.com/hyperium/tonic" documentation = "https://docs.rs/tonic-reflection/0.12.2" keywords = ["rpc", "grpc", "async", "reflection"] -license = "MIT" +license = "MIT AND Apache-2.0" name = "tonic-reflection" readme = "README.md" repository = "https://github.com/hyperium/tonic" diff --git a/tonic-reflection/LICENSE b/tonic-reflection/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-reflection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-reflection/LICENSE-APACHE b/tonic-reflection/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/tonic-reflection/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/tonic-reflection/LICENSE-MIT b/tonic-reflection/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic-reflection/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 1511141c0..98685a3c7 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://docs.rs/tonic-types/0.12.2" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "protobuf"] -license = "MIT" +license = "MIT AND Apache-2.0" name = "tonic-types" readme = "README.md" repository = "https://github.com/hyperium/tonic" diff --git a/tonic-types/LICENSE b/tonic-types/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-types/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-types/LICENSE-APACHE b/tonic-types/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/tonic-types/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/tonic-types/LICENSE-MIT b/tonic-types/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic-types/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic-web/LICENSE b/tonic-web/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic-web/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic-web/LICENSE-MIT b/tonic-web/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic-web/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file diff --git a/tonic/Cargo.toml b/tonic/Cargo.toml index bf32e23c1..d4bf8e22d 100644 --- a/tonic/Cargo.toml +++ b/tonic/Cargo.toml @@ -17,7 +17,7 @@ documentation = "https://docs.rs/tonic/0.12.2" edition = "2021" homepage = "https://github.com/hyperium/tonic" keywords = ["rpc", "grpc", "async", "futures", "protobuf"] -license = "MIT" +license = "MIT AND APACHE-2.0" readme = "../README.md" repository = "https://github.com/hyperium/tonic" version = "0.12.2" diff --git a/tonic/LICENSE b/tonic/LICENSE deleted file mode 100644 index 307709840..000000000 --- a/tonic/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Lucio Franco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tonic/LICENSE-APACHE b/tonic/LICENSE-APACHE new file mode 120000 index 000000000..965b606f3 --- /dev/null +++ b/tonic/LICENSE-APACHE @@ -0,0 +1 @@ +../LICENSE-APACHE \ No newline at end of file diff --git a/tonic/LICENSE-MIT b/tonic/LICENSE-MIT new file mode 120000 index 000000000..76219eb72 --- /dev/null +++ b/tonic/LICENSE-MIT @@ -0,0 +1 @@ +../LICENSE-MIT \ No newline at end of file From 0b5544a3f570b48703352172b34c7b999d3d9f46 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 16 Sep 2024 10:16:06 +0200 Subject: [PATCH 2/2] Generate codegen on-the-fly --- .gitignore | 1 + Cargo.toml | 1 - codegen/Cargo.toml | 11 - tonic-health/Cargo.toml | 5 + tonic-health/build.rs | 68 +++ tonic-health/src/generated/grpc_health_v1.bin | Bin 2875 -> 0 bytes tonic-health/src/generated/grpc_health_v1.rs | 457 ----------------- tonic-reflection/Cargo.toml | 5 + .../src/main.rs => tonic-reflection/build.rs | 43 +- .../src/generated/grpc_reflection_v1.rs | 459 ------------------ .../src/generated/grpc_reflection_v1alpha.rs | 459 ------------------ .../src/generated/reflection_v1.bin | Bin 7639 -> 0 bytes .../src/generated/reflection_v1alpha1.bin | Bin 7198 -> 0 bytes tonic-types/Cargo.toml | 5 + tonic-types/build.rs | 67 +++ tonic-types/src/generated/google_rpc.rs | 280 ----------- tonic-types/src/generated/types.bin | Bin 24305 -> 0 bytes 17 files changed, 157 insertions(+), 1704 deletions(-) delete mode 100644 codegen/Cargo.toml create mode 100644 tonic-health/build.rs delete mode 100644 tonic-health/src/generated/grpc_health_v1.bin delete mode 100644 tonic-health/src/generated/grpc_health_v1.rs rename codegen/src/main.rs => tonic-reflection/build.rs (64%) delete mode 100644 tonic-reflection/src/generated/grpc_reflection_v1.rs delete mode 100644 tonic-reflection/src/generated/grpc_reflection_v1alpha.rs delete mode 100644 tonic-reflection/src/generated/reflection_v1.bin delete mode 100644 tonic-reflection/src/generated/reflection_v1alpha1.bin create mode 100644 tonic-types/build.rs delete mode 100644 tonic-types/src/generated/google_rpc.rs delete mode 100644 tonic-types/src/generated/types.bin diff --git a/.gitignore b/.gitignore index 6ae3d3c32..6494123b2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target/ **/*.rs.bk Cargo.lock tags +*/src/generated diff --git a/Cargo.toml b/Cargo.toml index 77b8463fa..bb175bba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ members = [ "tonic-reflection", "tonic-web", # Non-published crates "examples", - "codegen", "interop", # Tests "tests/disable_comments", "tests/included_service", diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml deleted file mode 100644 index f4d9f3290..000000000 --- a/codegen/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "codegen" -authors = ["Lucio Franco "] -license = "MIT" -edition = "2021" -publish = false -version = "0.1.0" - -[dependencies] -tempfile = "3.8.0" -tonic-build = {path = "../tonic-build", default-features = false, features = ["prost", "cleanup-markdown"]} diff --git a/tonic-health/Cargo.toml b/tonic-health/Cargo.toml index a6fb4a386..1777d8b7e 100644 --- a/tonic-health/Cargo.toml +++ b/tonic-health/Cargo.toml @@ -13,11 +13,16 @@ name = "tonic-health" readme = "README.md" repository = "https://github.com/hyperium/tonic" version = "0.12.2" +exclude = ["src/generated"] [features] default = ["transport"] transport = [] +[build-dependencies] +tempfile = "3.8.0" +tonic-build = {path = "../tonic-build", default-features = false, features = ["prost", "cleanup-markdown"]} + [dependencies] async-stream = "0.3" prost = "0.13" diff --git a/tonic-health/build.rs b/tonic-health/build.rs new file mode 100644 index 000000000..8b3d40833 --- /dev/null +++ b/tonic-health/build.rs @@ -0,0 +1,68 @@ +use std::fs::create_dir; +use std::path::{Path, PathBuf}; + +fn main() { + codegen( + &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")), + &["proto/health.proto"], + &["proto"], + &PathBuf::from("src/generated"), + &PathBuf::from("src/generated/grpc_health_v1.bin"), + true, + true, + ); +} + +fn codegen( + root_dir: &Path, + iface_files: &[&str], + include_dirs: &[&str], + out_dir: &Path, + file_descriptor_set_path: &Path, + build_client: bool, + build_server: bool, +) { + let tempdir = tempfile::Builder::new() + .prefix("tonic-codegen-") + .tempdir() + .unwrap(); + + let iface_files: Vec = iface_files + .iter() + .map(|&path| root_dir.join(path)) + .collect(); + + let include_dirs: Vec = include_dirs + .iter() + .map(|&path| root_dir.join(path)) + .collect(); + let out_dir = root_dir.join(out_dir); + if !out_dir.exists() { + create_dir(out_dir.clone()).unwrap(); + } + + let file_descriptor_set_path = root_dir.join(file_descriptor_set_path); + + tonic_build::configure() + .build_client(build_client) + .build_server(build_server) + .out_dir(&tempdir) + .file_descriptor_set_path(file_descriptor_set_path) + .compile_protos(&iface_files, &include_dirs) + .unwrap(); + + for path in std::fs::read_dir(tempdir.path()).unwrap() { + let path = path.unwrap().path(); + let to = out_dir.join( + path.file_name() + .unwrap() + .to_str() + .unwrap() + .strip_suffix(".rs") + .unwrap() + .replace('.', "_") + + ".rs", + ); + std::fs::copy(&path, &to).unwrap(); + } +} diff --git a/tonic-health/src/generated/grpc_health_v1.bin b/tonic-health/src/generated/grpc_health_v1.bin deleted file mode 100644 index 52efb312248858eba8a5024742a401fbc68b32fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2875 zcmb_e&2ke*5Y|d-*^G^C*8CVlLL+`ngk(FFOA=FMga8GQ97)DS4soqkBWa7(&SqxT z!pA&C-XVun<&-=@&Uu17OS)%wB^x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8vR7s_@ezHisWTYQZF{{0a6mvI!r+7kiMq~!C5$-!sw%2AfD!hI9 zibn8VO?1u;bc8Pt&bOBN~TqLoo@<#%t{80D%a92Ch#hgrsEOF`y0fv~|#Yg5jVS zq#v!7i;EeBp_G?C&nWb;y!kErr)XS3$=!T?7Vt8O zumaG~i9#%32rBL=N?52fwJwBwGSxakA&x$<1Z9%%hBFicDTZ%{g*NTX`Ph< z>m#|x{bSxY1xkF*;x@6)!c<&OV>}xgA~@nBeNN0i7yw~AiS_|5s0V}fImjCAH+JA93tU|I_Z}8jHG+X+~Pj#aYQ+;VAftA_5MssvlW=?_#m67vS?a$ z>a;rDt8mb4yxM$o*cIXzqxp;qX_NW=l6vQqIlUCPOr(lpSnR&f*wNn?U5 zArmKt>kmQGk{iD9PA+BoV%B-XB`=J-aeQLwji%r~psY{uOsrp2p89v;} zQbdxPo3@?^F$N#k4t2N~45p( &'static str { - match self { - ServingStatus::Unknown => "UNKNOWN", - ServingStatus::Serving => "SERVING", - ServingStatus::NotServing => "NOT_SERVING", - ServingStatus::ServiceUnknown => "SERVICE_UNKNOWN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "SERVING" => Some(Self::Serving), - "NOT_SERVING" => Some(Self::NotServing), - "SERVICE_UNKNOWN" => Some(Self::ServiceUnknown), - _ => None, - } - } - } -} -/// Generated client implementations. -pub mod health_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct HealthClient { - inner: tonic::client::Grpc, - } - impl HealthClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> HealthClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - HealthClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// If the requested service is unknown, the call will fail with status - /// NOT_FOUND. - pub async fn check( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/grpc.health.v1.Health/Check", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("grpc.health.v1.Health", "Check")); - self.inner.unary(req, path, codec).await - } - /// Performs a watch for the serving status of the requested service. - /// The server will immediately send back a message indicating the current - /// serving status. It will then subsequently send a new message whenever - /// the service's serving status changes. - /// - /// If the requested service is unknown when the call is received, the - /// server will send a message setting the serving status to - /// SERVICE_UNKNOWN but will *not* terminate the call. If at some - /// future point, the serving status of the service becomes known, the - /// server will send a new message with the service's serving status. - /// - /// If the call terminates with status UNIMPLEMENTED, then clients - /// should assume this method is not supported and should not retry the - /// call. If the call terminates with any other status (including OK), - /// clients should retry the call with appropriate exponential backoff. - pub async fn watch( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/grpc.health.v1.Health/Watch", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("grpc.health.v1.Health", "Watch")); - self.inner.server_streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod health_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with HealthServer. - #[async_trait] - pub trait Health: std::marker::Send + std::marker::Sync + 'static { - /// If the requested service is unknown, the call will fail with status - /// NOT_FOUND. - async fn check( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Server streaming response type for the Watch method. - type WatchStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result, - > - + std::marker::Send - + 'static; - /// Performs a watch for the serving status of the requested service. - /// The server will immediately send back a message indicating the current - /// serving status. It will then subsequently send a new message whenever - /// the service's serving status changes. - /// - /// If the requested service is unknown when the call is received, the - /// server will send a message setting the serving status to - /// SERVICE_UNKNOWN but will *not* terminate the call. If at some - /// future point, the serving status of the service becomes known, the - /// server will send a new message with the service's serving status. - /// - /// If the call terminates with status UNIMPLEMENTED, then clients - /// should assume this method is not supported and should not retry the - /// call. If the call terminates with any other status (including OK), - /// clients should retry the call with appropriate exponential backoff. - async fn watch( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct HealthServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl HealthServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for HealthServer - where - T: Health, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/grpc.health.v1.Health/Check" => { - #[allow(non_camel_case_types)] - struct CheckSvc(pub Arc); - impl< - T: Health, - > tonic::server::UnaryService - for CheckSvc { - type Response = super::HealthCheckResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::check(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = CheckSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/grpc.health.v1.Health/Watch" => { - #[allow(non_camel_case_types)] - struct WatchSvc(pub Arc); - impl< - T: Health, - > tonic::server::ServerStreamingService - for WatchSvc { - type Response = super::HealthCheckResponse; - type ResponseStream = T::WatchStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::watch(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = WatchSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.server_streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - "grpc-status", - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for HealthServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "grpc.health.v1.Health"; - impl tonic::server::NamedService for HealthServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/tonic-reflection/Cargo.toml b/tonic-reflection/Cargo.toml index ea94c5e4d..450266a99 100644 --- a/tonic-reflection/Cargo.toml +++ b/tonic-reflection/Cargo.toml @@ -16,6 +16,7 @@ name = "tonic-reflection" readme = "README.md" repository = "https://github.com/hyperium/tonic" version = "0.12.2" +exclude = ["src/generated"] [package.metadata.docs.rs] all-features = true @@ -25,6 +26,10 @@ rustdoc-args = ["--cfg", "docsrs"] server = ["prost-types", "dep:tokio", "dep:tokio-stream"] default = ["server"] +[build-dependencies] +tempfile = "3.8.0" +tonic-build = {path = "../tonic-build", default-features = false, features = ["prost", "cleanup-markdown"]} + [dependencies] prost = "0.13" prost-types = {version = "0.13", optional = true} diff --git a/codegen/src/main.rs b/tonic-reflection/build.rs similarity index 64% rename from codegen/src/main.rs rename to tonic-reflection/build.rs index e67be9b4d..c6a62a31b 100644 --- a/codegen/src/main.rs +++ b/tonic-reflection/build.rs @@ -1,26 +1,9 @@ +use std::fs::create_dir; use std::path::{Path, PathBuf}; fn main() { - // tonic-health codegen( - &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("tonic-health"), - &["proto/health.proto"], - &["proto"], - &PathBuf::from("src/generated"), - &PathBuf::from("src/generated/grpc_health_v1.bin"), - true, - true, - ); - - // tonic-reflection - codegen( - &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("tonic-reflection"), + &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")), &["proto/reflection_v1.proto"], &["proto"], &PathBuf::from("src/generated"), @@ -29,10 +12,7 @@ fn main() { true, ); codegen( - &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("tonic-reflection"), + &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")), &["proto/reflection_v1alpha.proto"], &["proto"], &PathBuf::from("src/generated"), @@ -40,20 +20,6 @@ fn main() { true, true, ); - - // tonic-types - codegen( - &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("tonic-types"), - &["proto/status.proto", "proto/error_details.proto"], - &["proto"], - &PathBuf::from("src/generated"), - &PathBuf::from("src/generated/types.bin"), - false, - false, - ); } fn codegen( @@ -80,6 +46,9 @@ fn codegen( .map(|&path| root_dir.join(path)) .collect(); let out_dir = root_dir.join(out_dir); + if !out_dir.exists() { + create_dir(out_dir.clone()).unwrap(); + } let file_descriptor_set_path = root_dir.join(file_descriptor_set_path); tonic_build::configure() diff --git a/tonic-reflection/src/generated/grpc_reflection_v1.rs b/tonic-reflection/src/generated/grpc_reflection_v1.rs deleted file mode 100644 index 2f454728e..000000000 --- a/tonic-reflection/src/generated/grpc_reflection_v1.rs +++ /dev/null @@ -1,459 +0,0 @@ -// This file is @generated by prost-build. -/// The message sent by the client when calling ServerReflectionInfo method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServerReflectionRequest { - #[prost(string, tag = "1")] - pub host: ::prost::alloc::string::String, - /// To use reflection service, the client should set one of the following - /// fields in message_request. The server distinguishes requests by their - /// defined field and then handles them using corresponding methods. - #[prost(oneof = "server_reflection_request::MessageRequest", tags = "3, 4, 5, 6, 7")] - pub message_request: ::core::option::Option< - server_reflection_request::MessageRequest, - >, -} -/// Nested message and enum types in `ServerReflectionRequest`. -pub mod server_reflection_request { - /// To use reflection service, the client should set one of the following - /// fields in message_request. The server distinguishes requests by their - /// defined field and then handles them using corresponding methods. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MessageRequest { - /// Find a proto file by the file name. - #[prost(string, tag = "3")] - FileByFilename(::prost::alloc::string::String), - /// Find the proto file that declares the given fully-qualified symbol name. - /// This field should be a fully-qualified symbol name - /// (e.g. .\[.\] or .). - #[prost(string, tag = "4")] - FileContainingSymbol(::prost::alloc::string::String), - /// Find the proto file which defines an extension extending the given - /// message type with the given field number. - #[prost(message, tag = "5")] - FileContainingExtension(super::ExtensionRequest), - /// Finds the tag numbers used by all known extensions of the given message - /// type, and appends them to ExtensionNumberResponse in an undefined order. - /// Its corresponding method is best-effort: it's not guaranteed that the - /// reflection service will implement this method, and it's not guaranteed - /// that this method will provide all extensions. Returns - /// StatusCode::UNIMPLEMENTED if it's not implemented. - /// This field should be a fully-qualified type name. The format is - /// . - #[prost(string, tag = "6")] - AllExtensionNumbersOfType(::prost::alloc::string::String), - /// List the full names of registered services. The content will not be - /// checked. - #[prost(string, tag = "7")] - ListServices(::prost::alloc::string::String), - } -} -/// The type name and extension number sent by the client when requesting -/// file_containing_extension. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExtensionRequest { - /// Fully-qualified type name. The format should be . - #[prost(string, tag = "1")] - pub containing_type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] - pub extension_number: i32, -} -/// The message sent by the server to answer ServerReflectionInfo method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServerReflectionResponse { - #[prost(string, tag = "1")] - pub valid_host: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub original_request: ::core::option::Option, - /// The server sets one of the following fields according to the message_request - /// in the request. - #[prost(oneof = "server_reflection_response::MessageResponse", tags = "4, 5, 6, 7")] - pub message_response: ::core::option::Option< - server_reflection_response::MessageResponse, - >, -} -/// Nested message and enum types in `ServerReflectionResponse`. -pub mod server_reflection_response { - /// The server sets one of the following fields according to the message_request - /// in the request. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MessageResponse { - /// This message is used to answer file_by_filename, file_containing_symbol, - /// file_containing_extension requests with transitive dependencies. - /// As the repeated label is not allowed in oneof fields, we use a - /// FileDescriptorResponse message to encapsulate the repeated fields. - /// The reflection service is allowed to avoid sending FileDescriptorProtos - /// that were previously sent in response to earlier requests in the stream. - #[prost(message, tag = "4")] - FileDescriptorResponse(super::FileDescriptorResponse), - /// This message is used to answer all_extension_numbers_of_type requests. - #[prost(message, tag = "5")] - AllExtensionNumbersResponse(super::ExtensionNumberResponse), - /// This message is used to answer list_services requests. - #[prost(message, tag = "6")] - ListServicesResponse(super::ListServiceResponse), - /// This message is used when an error occurs. - #[prost(message, tag = "7")] - ErrorResponse(super::ErrorResponse), - } -} -/// Serialized FileDescriptorProto messages sent by the server answering -/// a file_by_filename, file_containing_symbol, or file_containing_extension -/// request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FileDescriptorResponse { - /// Serialized FileDescriptorProto messages. We avoid taking a dependency on - /// descriptor.proto, which uses proto2 only features, by making them opaque - /// bytes instead. - #[prost(bytes = "vec", repeated, tag = "1")] - pub file_descriptor_proto: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// A list of extension numbers sent by the server answering -/// all_extension_numbers_of_type request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExtensionNumberResponse { - /// Full name of the base type, including the package name. The format - /// is . - #[prost(string, tag = "1")] - pub base_type_name: ::prost::alloc::string::String, - #[prost(int32, repeated, tag = "2")] - pub extension_number: ::prost::alloc::vec::Vec, -} -/// A list of ServiceResponse sent by the server answering list_services request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListServiceResponse { - /// The information of each service may be expanded in the future, so we use - /// ServiceResponse message to encapsulate it. - #[prost(message, repeated, tag = "1")] - pub service: ::prost::alloc::vec::Vec, -} -/// The information of a single service used by ListServiceResponse to answer -/// list_services request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServiceResponse { - /// Full name of a registered service, including its package name. The format - /// is . - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -/// The error code and error message sent by the server when an error occurs. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ErrorResponse { - /// This field uses the error codes defined in grpc::StatusCode. - #[prost(int32, tag = "1")] - pub error_code: i32, - #[prost(string, tag = "2")] - pub error_message: ::prost::alloc::string::String, -} -/// Generated client implementations. -pub mod server_reflection_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct ServerReflectionClient { - inner: tonic::client::Grpc, - } - impl ServerReflectionClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ServerReflectionClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - ServerReflectionClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// The reflection service is structured as a bidirectional stream, ensuring - /// all related requests go to a single server. - pub async fn server_reflection_info( - &mut self, - request: impl tonic::IntoStreamingRequest< - Message = super::ServerReflectionRequest, - >, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/grpc.reflection.v1.ServerReflection/ServerReflectionInfo", - ); - let mut req = request.into_streaming_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "grpc.reflection.v1.ServerReflection", - "ServerReflectionInfo", - ), - ); - self.inner.streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod server_reflection_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServerReflectionServer. - #[async_trait] - pub trait ServerReflection: std::marker::Send + std::marker::Sync + 'static { - /// Server streaming response type for the ServerReflectionInfo method. - type ServerReflectionInfoStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result< - super::ServerReflectionResponse, - tonic::Status, - >, - > - + std::marker::Send - + 'static; - /// The reflection service is structured as a bidirectional stream, ensuring - /// all related requests go to a single server. - async fn server_reflection_info( - &self, - request: tonic::Request>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct ServerReflectionServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ServerReflectionServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for ServerReflectionServer - where - T: ServerReflection, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/grpc.reflection.v1.ServerReflection/ServerReflectionInfo" => { - #[allow(non_camel_case_types)] - struct ServerReflectionInfoSvc(pub Arc); - impl< - T: ServerReflection, - > tonic::server::StreamingService - for ServerReflectionInfoSvc { - type Response = super::ServerReflectionResponse; - type ResponseStream = T::ServerReflectionInfoStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - tonic::Streaming, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::server_reflection_info( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = ServerReflectionInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - "grpc-status", - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for ServerReflectionServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "grpc.reflection.v1.ServerReflection"; - impl tonic::server::NamedService for ServerReflectionServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/tonic-reflection/src/generated/grpc_reflection_v1alpha.rs b/tonic-reflection/src/generated/grpc_reflection_v1alpha.rs deleted file mode 100644 index 237312987..000000000 --- a/tonic-reflection/src/generated/grpc_reflection_v1alpha.rs +++ /dev/null @@ -1,459 +0,0 @@ -// This file is @generated by prost-build. -/// The message sent by the client when calling ServerReflectionInfo method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServerReflectionRequest { - #[prost(string, tag = "1")] - pub host: ::prost::alloc::string::String, - /// To use reflection service, the client should set one of the following - /// fields in message_request. The server distinguishes requests by their - /// defined field and then handles them using corresponding methods. - #[prost(oneof = "server_reflection_request::MessageRequest", tags = "3, 4, 5, 6, 7")] - pub message_request: ::core::option::Option< - server_reflection_request::MessageRequest, - >, -} -/// Nested message and enum types in `ServerReflectionRequest`. -pub mod server_reflection_request { - /// To use reflection service, the client should set one of the following - /// fields in message_request. The server distinguishes requests by their - /// defined field and then handles them using corresponding methods. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MessageRequest { - /// Find a proto file by the file name. - #[prost(string, tag = "3")] - FileByFilename(::prost::alloc::string::String), - /// Find the proto file that declares the given fully-qualified symbol name. - /// This field should be a fully-qualified symbol name - /// (e.g. .\[.\] or .). - #[prost(string, tag = "4")] - FileContainingSymbol(::prost::alloc::string::String), - /// Find the proto file which defines an extension extending the given - /// message type with the given field number. - #[prost(message, tag = "5")] - FileContainingExtension(super::ExtensionRequest), - /// Finds the tag numbers used by all known extensions of extendee_type, and - /// appends them to ExtensionNumberResponse in an undefined order. - /// Its corresponding method is best-effort: it's not guaranteed that the - /// reflection service will implement this method, and it's not guaranteed - /// that this method will provide all extensions. Returns - /// StatusCode::UNIMPLEMENTED if it's not implemented. - /// This field should be a fully-qualified type name. The format is - /// . - #[prost(string, tag = "6")] - AllExtensionNumbersOfType(::prost::alloc::string::String), - /// List the full names of registered services. The content will not be - /// checked. - #[prost(string, tag = "7")] - ListServices(::prost::alloc::string::String), - } -} -/// The type name and extension number sent by the client when requesting -/// file_containing_extension. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExtensionRequest { - /// Fully-qualified type name. The format should be . - #[prost(string, tag = "1")] - pub containing_type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] - pub extension_number: i32, -} -/// The message sent by the server to answer ServerReflectionInfo method. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServerReflectionResponse { - #[prost(string, tag = "1")] - pub valid_host: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub original_request: ::core::option::Option, - /// The server sets one of the following fields according to the - /// message_request in the request. - #[prost(oneof = "server_reflection_response::MessageResponse", tags = "4, 5, 6, 7")] - pub message_response: ::core::option::Option< - server_reflection_response::MessageResponse, - >, -} -/// Nested message and enum types in `ServerReflectionResponse`. -pub mod server_reflection_response { - /// The server sets one of the following fields according to the - /// message_request in the request. - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MessageResponse { - /// This message is used to answer file_by_filename, file_containing_symbol, - /// file_containing_extension requests with transitive dependencies. - /// As the repeated label is not allowed in oneof fields, we use a - /// FileDescriptorResponse message to encapsulate the repeated fields. - /// The reflection service is allowed to avoid sending FileDescriptorProtos - /// that were previously sent in response to earlier requests in the stream. - #[prost(message, tag = "4")] - FileDescriptorResponse(super::FileDescriptorResponse), - /// This message is used to answer all_extension_numbers_of_type requests. - #[prost(message, tag = "5")] - AllExtensionNumbersResponse(super::ExtensionNumberResponse), - /// This message is used to answer list_services requests. - #[prost(message, tag = "6")] - ListServicesResponse(super::ListServiceResponse), - /// This message is used when an error occurs. - #[prost(message, tag = "7")] - ErrorResponse(super::ErrorResponse), - } -} -/// Serialized FileDescriptorProto messages sent by the server answering -/// a file_by_filename, file_containing_symbol, or file_containing_extension -/// request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FileDescriptorResponse { - /// Serialized FileDescriptorProto messages. We avoid taking a dependency on - /// descriptor.proto, which uses proto2 only features, by making them opaque - /// bytes instead. - #[prost(bytes = "vec", repeated, tag = "1")] - pub file_descriptor_proto: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// A list of extension numbers sent by the server answering -/// all_extension_numbers_of_type request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExtensionNumberResponse { - /// Full name of the base type, including the package name. The format - /// is . - #[prost(string, tag = "1")] - pub base_type_name: ::prost::alloc::string::String, - #[prost(int32, repeated, tag = "2")] - pub extension_number: ::prost::alloc::vec::Vec, -} -/// A list of ServiceResponse sent by the server answering list_services request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListServiceResponse { - /// The information of each service may be expanded in the future, so we use - /// ServiceResponse message to encapsulate it. - #[prost(message, repeated, tag = "1")] - pub service: ::prost::alloc::vec::Vec, -} -/// The information of a single service used by ListServiceResponse to answer -/// list_services request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ServiceResponse { - /// Full name of a registered service, including its package name. The format - /// is . - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -/// The error code and error message sent by the server when an error occurs. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ErrorResponse { - /// This field uses the error codes defined in grpc::StatusCode. - #[prost(int32, tag = "1")] - pub error_code: i32, - #[prost(string, tag = "2")] - pub error_message: ::prost::alloc::string::String, -} -/// Generated client implementations. -pub mod server_reflection_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - #[derive(Debug, Clone)] - pub struct ServerReflectionClient { - inner: tonic::client::Grpc, - } - impl ServerReflectionClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ServerReflectionClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + std::marker::Send + std::marker::Sync, - { - ServerReflectionClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// The reflection service is structured as a bidirectional stream, ensuring - /// all related requests go to a single server. - pub async fn server_reflection_info( - &mut self, - request: impl tonic::IntoStreamingRequest< - Message = super::ServerReflectionRequest, - >, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::unknown( - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", - ); - let mut req = request.into_streaming_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "grpc.reflection.v1alpha.ServerReflection", - "ServerReflectionInfo", - ), - ); - self.inner.streaming(req, path, codec).await - } - } -} -/// Generated server implementations. -pub mod server_reflection_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value, - )] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ServerReflectionServer. - #[async_trait] - pub trait ServerReflection: std::marker::Send + std::marker::Sync + 'static { - /// Server streaming response type for the ServerReflectionInfo method. - type ServerReflectionInfoStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result< - super::ServerReflectionResponse, - tonic::Status, - >, - > - + std::marker::Send - + 'static; - /// The reflection service is structured as a bidirectional stream, ensuring - /// all related requests go to a single server. - async fn server_reflection_info( - &self, - request: tonic::Request>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - #[derive(Debug)] - pub struct ServerReflectionServer { - inner: Arc, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - impl ServerReflectionServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for ServerReflectionServer - where - T: ServerReflection, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - match req.uri().path() { - "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo" => { - #[allow(non_camel_case_types)] - struct ServerReflectionInfoSvc(pub Arc); - impl< - T: ServerReflection, - > tonic::server::StreamingService - for ServerReflectionInfoSvc { - type Response = super::ServerReflectionResponse; - type ResponseStream = T::ServerReflectionInfoStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - tonic::Streaming, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::server_reflection_info( - &inner, - request, - ) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let method = ServerReflectionInfoSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.streaming(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - let mut response = http::Response::new(empty_body()); - let headers = response.headers_mut(); - headers - .insert( - "grpc-status", - (tonic::Code::Unimplemented as i32).into(), - ); - headers - .insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) - }) - } - } - } - } - impl Clone for ServerReflectionServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "grpc.reflection.v1alpha.ServerReflection"; - impl tonic::server::NamedService for ServerReflectionServer { - const NAME: &'static str = SERVICE_NAME; - } -} diff --git a/tonic-reflection/src/generated/reflection_v1.bin b/tonic-reflection/src/generated/reflection_v1.bin deleted file mode 100644 index 4b4ecaef9d7cc999759a06523a81fdb2b6fdbca3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7639 zcmb7IOLH5?5ymc-uc02)N)#zjl1I>kdXS(5rxaVZ6_FAZQKl#vpyX0w6}?z4z>R=i zaCbqNO3GDEC3Y!QF5A~!ld9ZOm0VJlV@^5dkbCkAa>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cfV%8oP+d69`zoA~<0wOiUM;_DZ8*4Up6Fi^@e z>xs6J`<+3|;-G8$C8BYH@8fvGRfW8*8%&+yikl>1qnUft~!_=&8f~t___TK1W#Mcqq7bTtuNWBB*7~NH;)&dt0+sEWy0i z)wNiHi(2pJnFkMTM|8u$<{UxL+fsD(EaL0UA6p@c~rS&L^qQQEzSWNzOGD=po2fXB+-Bb zH2mciS(!|th_0!Cf&fUn8d6Buq^lu?L^H3-8!il?I@Nvm4*LR-rY$o{yfV-%4I!nv zic7_SUcWEOr610vxWz$0E+c8`VNAq8NN@EYkgx kj>h13hPk2#ky|9jJ0ZCsPG{p$Ed9=Sd$~3xp9p^ZfA%RK!~g&Q diff --git a/tonic-types/Cargo.toml b/tonic-types/Cargo.toml index 98685a3c7..3e1f2287d 100644 --- a/tonic-types/Cargo.toml +++ b/tonic-types/Cargo.toml @@ -16,6 +16,11 @@ name = "tonic-types" readme = "README.md" repository = "https://github.com/hyperium/tonic" version = "0.12.2" +exclude = ["src/generated"] + +[build-dependencies] +tempfile = "3.8.0" +tonic-build = {path = "../tonic-build", default-features = false, features = ["prost", "cleanup-markdown"]} [dependencies] prost = "0.13" diff --git a/tonic-types/build.rs b/tonic-types/build.rs new file mode 100644 index 000000000..3a0ec46bc --- /dev/null +++ b/tonic-types/build.rs @@ -0,0 +1,67 @@ +use std::fs::create_dir; +use std::path::{Path, PathBuf}; + +fn main() { + codegen( + &PathBuf::from(std::env!("CARGO_MANIFEST_DIR")), + &["proto/status.proto", "proto/error_details.proto"], + &["proto"], + &PathBuf::from("src/generated"), + &PathBuf::from("src/generated/types.bin"), + false, + false, + ); +} + +fn codegen( + root_dir: &Path, + iface_files: &[&str], + include_dirs: &[&str], + out_dir: &Path, + file_descriptor_set_path: &Path, + build_client: bool, + build_server: bool, +) { + let tempdir = tempfile::Builder::new() + .prefix("tonic-codegen-") + .tempdir() + .unwrap(); + + let iface_files: Vec = iface_files + .iter() + .map(|&path| root_dir.join(path)) + .collect(); + + let include_dirs: Vec = include_dirs + .iter() + .map(|&path| root_dir.join(path)) + .collect(); + let out_dir = root_dir.join(out_dir); + if !out_dir.exists() { + create_dir(out_dir.clone()).unwrap(); + } + let file_descriptor_set_path = root_dir.join(file_descriptor_set_path); + + tonic_build::configure() + .build_client(build_client) + .build_server(build_server) + .out_dir(&tempdir) + .file_descriptor_set_path(file_descriptor_set_path) + .compile_protos(&iface_files, &include_dirs) + .unwrap(); + + for path in std::fs::read_dir(tempdir.path()).unwrap() { + let path = path.unwrap().path(); + let to = out_dir.join( + path.file_name() + .unwrap() + .to_str() + .unwrap() + .strip_suffix(".rs") + .unwrap() + .replace('.', "_") + + ".rs", + ); + std::fs::copy(&path, &to).unwrap(); + } +} diff --git a/tonic-types/src/generated/google_rpc.rs b/tonic-types/src/generated/google_rpc.rs deleted file mode 100644 index 856defa5c..000000000 --- a/tonic-types/src/generated/google_rpc.rs +++ /dev/null @@ -1,280 +0,0 @@ -// This file is @generated by prost-build. -/// The `Status` type defines a logical error model that is suitable for -/// different programming environments, including REST APIs and RPC APIs. It is -/// used by [gRPC](). Each `Status` message contains -/// three pieces of data: error code, error message, and error details. -/// -/// You can find out more about this error model and how to work with it in the -/// [API Design Guide](). -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Status { - /// The status code, which should be an enum value of \[google.rpc.Code\]\[google.rpc.Code\]. - #[prost(int32, tag = "1")] - pub code: i32, - /// A developer-facing error message, which should be in English. Any - /// user-facing error message should be localized and sent in the - /// \[google.rpc.Status.details\]\[google.rpc.Status.details\] field, or localized by the client. - #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, - /// A list of messages that carry the error details. There is a common set of - /// message types for APIs to use. - #[prost(message, repeated, tag = "3")] - pub details: ::prost::alloc::vec::Vec<::prost_types::Any>, -} -/// Describes when the clients can retry a failed request. Clients could ignore -/// the recommendation here or retry when this information is missing from error -/// responses. -/// -/// It's always recommended that clients should use exponential backoff when -/// retrying. -/// -/// Clients should wait until `retry_delay` amount of time has passed since -/// receiving the error response before retrying. If retrying requests also -/// fail, clients should use an exponential backoff scheme to gradually increase -/// the delay between retries based on `retry_delay`, until either a maximum -/// number of retries have been reached or a maximum retry delay cap has been -/// reached. -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct RetryInfo { - /// Clients should wait at least this long between retrying the same request. - #[prost(message, optional, tag = "1")] - pub retry_delay: ::core::option::Option<::prost_types::Duration>, -} -/// Describes additional debugging info. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DebugInfo { - /// The stack trace entries indicating where the error occurred. - #[prost(string, repeated, tag = "1")] - pub stack_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Additional debugging information provided by the server. - #[prost(string, tag = "2")] - pub detail: ::prost::alloc::string::String, -} -/// Describes how a quota check failed. -/// -/// For example if a daily limit was exceeded for the calling project, -/// a service could respond with a QuotaFailure detail containing the project -/// id and the description of the quota limit that was exceeded. If the -/// calling project hasn't enabled the service in the developer console, then -/// a service could respond with the project id and set `service_disabled` -/// to true. -/// -/// Also see RetryInfo and Help types for other details about handling a -/// quota failure. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuotaFailure { - /// Describes all quota violations. - #[prost(message, repeated, tag = "1")] - pub violations: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `QuotaFailure`. -pub mod quota_failure { - /// A message type used to describe a single quota violation. For example, a - /// daily quota or a custom quota that was exceeded. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Violation { - /// The subject on which the quota check failed. - /// For example, "clientip:" or "project:". - #[prost(string, tag = "1")] - pub subject: ::prost::alloc::string::String, - /// A description of how the quota check failed. Clients can use this - /// description to find more about the quota configuration in the service's - /// public documentation, or find the relevant quota limit to adjust through - /// developer console. - /// - /// For example: "Service disabled" or "Daily Limit for read operations - /// exceeded". - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - } -} -/// Describes the cause of the error with structured details. -/// -/// Example of an error when contacting the "pubsub.googleapis.com" API when it -/// is not enabled: -/// -/// ```text,json -/// { "reason": "API_DISABLED" -/// "domain": "googleapis.com" -/// "metadata": { -/// "resource": "projects/123", -/// "service": "pubsub.googleapis.com" -/// } -/// } -/// ``` -/// -/// This response indicates that the pubsub.googleapis.com API is not enabled. -/// -/// Example of an error that is returned when attempting to create a Spanner -/// instance in a region that is out of stock: -/// -/// ```text,json -/// { "reason": "STOCKOUT" -/// "domain": "spanner.googleapis.com", -/// "metadata": { -/// "availableRegions": "us-central1,us-east2" -/// } -/// } -/// ``` -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ErrorInfo { - /// The reason of the error. This is a constant value that identifies the - /// proximate cause of the error. Error reasons are unique within a particular - /// domain of errors. This should be at most 63 characters and match - /// /\[A-Z0-9\_\]+/. - #[prost(string, tag = "1")] - pub reason: ::prost::alloc::string::String, - /// The logical grouping to which the "reason" belongs. The error domain - /// is typically the registered service name of the tool or product that - /// generates the error. Example: "pubsub.googleapis.com". If the error is - /// generated by some common infrastructure, the error domain must be a - /// globally unique value that identifies the infrastructure. For Google API - /// infrastructure, the error domain is "googleapis.com". - #[prost(string, tag = "2")] - pub domain: ::prost::alloc::string::String, - /// Additional structured details about this error. - /// - /// Keys should match /\[a-zA-Z0-9-\_\]/ and be limited to 64 characters in - /// length. When identifying the current value of an exceeded limit, the units - /// should be contained in the key, not the value. For example, rather than - /// {"instanceLimit": "100/request"}, should be returned as, - /// {"instanceLimitPerRequest": "100"}, if the client exceeds the number of - /// instances that can be created in a single (batch) request. - #[prost(map = "string, string", tag = "3")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -/// Describes what preconditions have failed. -/// -/// For example, if an RPC failed because it required the Terms of Service to be -/// acknowledged, it could list the terms of service violation in the -/// PreconditionFailure message. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreconditionFailure { - /// Describes all precondition violations. - #[prost(message, repeated, tag = "1")] - pub violations: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `PreconditionFailure`. -pub mod precondition_failure { - /// A message type used to describe a single precondition failure. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Violation { - /// The type of PreconditionFailure. We recommend using a service-specific - /// enum type to define the supported precondition violation subjects. For - /// example, "TOS" for "Terms of Service violation". - #[prost(string, tag = "1")] - pub r#type: ::prost::alloc::string::String, - /// The subject, relative to the type, that failed. - /// For example, "google.com/cloud" relative to the "TOS" type would indicate - /// which terms of service is being referenced. - #[prost(string, tag = "2")] - pub subject: ::prost::alloc::string::String, - /// A description of how the precondition failed. Developers can use this - /// description to understand how to fix the failure. - /// - /// For example: "Terms of service not accepted". - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - } -} -/// Describes violations in a client request. This error type focuses on the -/// syntactic aspects of the request. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BadRequest { - /// Describes all violations in a client request. - #[prost(message, repeated, tag = "1")] - pub field_violations: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `BadRequest`. -pub mod bad_request { - /// A message type used to describe a single bad request field. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct FieldViolation { - /// A path leading to a field in the request body. The value will be a - /// sequence of dot-separated identifiers that identify a protocol buffer - /// field. E.g., "field_violations.field" would identify this field. - #[prost(string, tag = "1")] - pub field: ::prost::alloc::string::String, - /// A description of why the request element is bad. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - } -} -/// Contains metadata about the request that clients can attach when filing a bug -/// or providing other forms of feedback. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RequestInfo { - /// An opaque string that should only be interpreted by the service generating - /// it. For example, it can be used to identify requests in the service's logs. - #[prost(string, tag = "1")] - pub request_id: ::prost::alloc::string::String, - /// Any data that was used to serve this request. For example, an encrypted - /// stack trace that can be sent back to the service provider for debugging. - #[prost(string, tag = "2")] - pub serving_data: ::prost::alloc::string::String, -} -/// Describes the resource that is being accessed. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ResourceInfo { - /// A name for the type of resource being accessed, e.g. "sql table", - /// "cloud storage bucket", "file", "Google calendar"; or the type URL - /// of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". - #[prost(string, tag = "1")] - pub resource_type: ::prost::alloc::string::String, - /// The name of the resource being accessed. For example, a shared calendar - /// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current - /// error is \[google.rpc.Code.PERMISSION_DENIED\]\[google.rpc.Code.PERMISSION_DENIED\]. - #[prost(string, tag = "2")] - pub resource_name: ::prost::alloc::string::String, - /// The owner of the resource (optional). - /// For example, "user:" or "project:". - #[prost(string, tag = "3")] - pub owner: ::prost::alloc::string::String, - /// Describes what error is encountered when accessing this resource. - /// For example, updating a cloud project may require the `writer` permission - /// on the developer console project. - #[prost(string, tag = "4")] - pub description: ::prost::alloc::string::String, -} -/// Provides links to documentation or for performing an out of band action. -/// -/// For example, if a quota check failed with an error indicating the calling -/// project hasn't enabled the accessed service, this can contain a URL pointing -/// directly to the right place in the developer console to flip the bit. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Help { - /// URL(s) pointing to additional information on handling the current error. - #[prost(message, repeated, tag = "1")] - pub links: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `Help`. -pub mod help { - /// Describes a URL link. - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Link { - /// Describes what the link offers. - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, - /// The URL of the link. - #[prost(string, tag = "2")] - pub url: ::prost::alloc::string::String, - } -} -/// Provides a localized error message that is safe to return to the user -/// which can be attached to an RPC error. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LocalizedMessage { - /// The locale used following the specification defined at - /// - /// Examples are: "en-US", "fr-CH", "es-MX" - #[prost(string, tag = "1")] - pub locale: ::prost::alloc::string::String, - /// The localized error message in the above locale. - #[prost(string, tag = "2")] - pub message: ::prost::alloc::string::String, -} diff --git a/tonic-types/src/generated/types.bin b/tonic-types/src/generated/types.bin deleted file mode 100644 index 8af4e92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