├── .cargo └── config.toml ├── .github └── workflows │ └── test.yml ├── .gitignore ├── .protoc-version ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── protobufs.toml ├── src ├── any.rs ├── generated │ ├── envoy.admin.v3.rs │ ├── envoy.admin.v3.serde.rs │ ├── envoy.annotations.rs │ ├── envoy.annotations.serde.rs │ ├── envoy.config.accesslog.v3.rs │ ├── envoy.config.accesslog.v3.serde.rs │ ├── envoy.config.bootstrap.v3.rs │ ├── envoy.config.bootstrap.v3.serde.rs │ ├── envoy.config.cluster.v3.rs │ ├── envoy.config.cluster.v3.serde.rs │ ├── envoy.config.common.key_value.v3.rs │ ├── envoy.config.common.key_value.v3.serde.rs │ ├── envoy.config.common.matcher.v3.rs │ ├── envoy.config.common.matcher.v3.serde.rs │ ├── envoy.config.common.mutation_rules.v3.rs │ ├── envoy.config.common.mutation_rules.v3.serde.rs │ ├── envoy.config.core.v3.rs │ ├── envoy.config.core.v3.serde.rs │ ├── envoy.config.endpoint.v3.rs │ ├── envoy.config.endpoint.v3.serde.rs │ ├── envoy.config.grpc_credential.v3.rs │ ├── envoy.config.grpc_credential.v3.serde.rs │ ├── envoy.config.listener.v3.rs │ ├── envoy.config.listener.v3.serde.rs │ ├── envoy.config.metrics.v3.rs │ ├── envoy.config.metrics.v3.serde.rs │ ├── envoy.config.overload.v3.rs │ ├── envoy.config.overload.v3.serde.rs │ ├── envoy.config.ratelimit.v3.rs │ ├── envoy.config.ratelimit.v3.serde.rs │ ├── envoy.config.rbac.v3.rs │ ├── envoy.config.rbac.v3.serde.rs │ ├── envoy.config.route.v3.rs │ ├── envoy.config.route.v3.serde.rs │ ├── envoy.config.tap.v3.rs │ ├── envoy.config.tap.v3.serde.rs │ ├── envoy.config.trace.v3.rs │ ├── envoy.config.trace.v3.serde.rs │ ├── envoy.config.upstream.local_address_selector.v3.rs │ ├── envoy.config.upstream.local_address_selector.v3.serde.rs │ ├── envoy.data.accesslog.v3.rs │ ├── envoy.data.accesslog.v3.serde.rs │ ├── envoy.data.tap.v3.rs │ ├── envoy.data.tap.v3.serde.rs │ ├── envoy.extensions.clusters.aggregate.v3.rs │ ├── envoy.extensions.clusters.aggregate.v3.serde.rs │ ├── envoy.extensions.common.ratelimit.v3.rs │ ├── envoy.extensions.common.ratelimit.v3.serde.rs │ ├── envoy.extensions.filters.http.ext_proc.v3.rs │ ├── envoy.extensions.filters.http.ext_proc.v3.serde.rs │ ├── envoy.extensions.filters.http.router.v3.rs │ ├── envoy.extensions.filters.http.router.v3.serde.rs │ ├── envoy.extensions.filters.network.http_connection_manager.v3.rs │ ├── envoy.extensions.filters.network.http_connection_manager.v3.serde.rs │ ├── envoy.extensions.transport_sockets.tls.v3.rs │ ├── envoy.extensions.transport_sockets.tls.v3.serde.rs │ ├── envoy.r#type.http.v3.rs │ ├── envoy.r#type.http.v3.serde.rs │ ├── envoy.r#type.matcher.v3.rs │ ├── envoy.r#type.matcher.v3.serde.rs │ ├── envoy.r#type.metadata.v3.rs │ ├── envoy.r#type.metadata.v3.serde.rs │ ├── envoy.r#type.tracing.v3.rs │ ├── envoy.r#type.tracing.v3.serde.rs │ ├── envoy.r#type.v3.rs │ ├── envoy.r#type.v3.serde.rs │ ├── envoy.service.accesslog.v3.rs │ ├── envoy.service.accesslog.v3.serde.rs │ ├── envoy.service.auth.v3.rs │ ├── envoy.service.auth.v3.serde.rs │ ├── envoy.service.cluster.v3.rs │ ├── envoy.service.cluster.v3.serde.rs │ ├── envoy.service.discovery.v3.rs │ ├── envoy.service.discovery.v3.serde.rs │ ├── envoy.service.endpoint.v3.rs │ ├── envoy.service.endpoint.v3.serde.rs │ ├── envoy.service.event_reporting.v3.rs │ ├── envoy.service.event_reporting.v3.serde.rs │ ├── envoy.service.ext_proc.v3.rs │ ├── envoy.service.ext_proc.v3.serde.rs │ ├── envoy.service.extension.v3.rs │ ├── envoy.service.extension.v3.serde.rs │ ├── envoy.service.health.v3.rs │ ├── envoy.service.health.v3.serde.rs │ ├── envoy.service.listener.v3.rs │ ├── envoy.service.listener.v3.serde.rs │ ├── envoy.service.load_stats.v3.rs │ ├── envoy.service.load_stats.v3.serde.rs │ ├── envoy.service.metrics.v3.rs │ ├── envoy.service.metrics.v3.serde.rs │ ├── envoy.service.rate_limit_quota.v3.rs │ ├── envoy.service.rate_limit_quota.v3.serde.rs │ ├── envoy.service.ratelimit.v3.rs │ ├── envoy.service.ratelimit.v3.serde.rs │ ├── envoy.service.route.v3.rs │ ├── envoy.service.route.v3.serde.rs │ ├── envoy.service.runtime.v3.rs │ ├── envoy.service.runtime.v3.serde.rs │ ├── envoy.service.secret.v3.rs │ ├── envoy.service.secret.v3.serde.rs │ ├── envoy.service.status.v3.rs │ ├── envoy.service.status.v3.serde.rs │ ├── envoy.service.tap.v3.rs │ ├── envoy.service.tap.v3.serde.rs │ ├── envoy.service.trace.v3.rs │ ├── envoy.service.trace.v3.serde.rs │ ├── google.api.expr.v1alpha1.rs │ ├── google.api.expr.v1alpha1.serde.rs │ ├── google.api.rs │ ├── google.api.serde.rs │ ├── google.protobuf.rs │ ├── google.protobuf.serde.rs │ ├── google.rpc.rs │ ├── google.rpc.serde.rs │ ├── io.prometheus.client.rs │ ├── io.prometheus.client.serde.rs │ ├── mod.rs │ ├── opencensus.proto.resource.v1.rs │ ├── opencensus.proto.resource.v1.serde.rs │ ├── opencensus.proto.trace.v1.rs │ ├── opencensus.proto.trace.v1.serde.rs │ ├── udpa.annotations.rs │ ├── udpa.annotations.serde.rs │ ├── validate.rs │ ├── validate.serde.rs │ ├── xds.annotations.v3.rs │ ├── xds.annotations.v3.serde.rs │ ├── xds.core.v3.rs │ ├── xds.core.v3.serde.rs │ ├── xds.r#type.matcher.v3.rs │ └── xds.r#type.matcher.v3.serde.rs ├── lib.rs ├── value.rs └── xds-descriptors.bin └── tests ├── generate_sources.rs ├── test_any.rs ├── test_pbjson.rs └── test_value.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --" 3 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Regression Build and Test 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | 7 | pull_request: 8 | branches: [ "main" ] 9 | 10 | env: 11 | CARGO_TERM_COLOR: always 12 | 13 | jobs: 14 | test: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Install Protoc 21 | uses: arduino/setup-protoc@v3 22 | with: 23 | version: "27.3" 24 | 25 | - name: Build 26 | run: cargo build --verbose 27 | 28 | - name: Run tests 29 | run: cargo test --verbose 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.protoc-version: -------------------------------------------------------------------------------- 1 | 27.3 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to xds-api 2 | 3 | Thanks for contributing to the xds-api repo! 4 | 5 | ## Code of Conduct 6 | 7 | All Junction Labs repos adhere to the [Rust Code of Conduct][coc], without exception. 8 | 9 | [coc]: https://www.rust-lang.org/policies/code-of-conduct 10 | 11 | ## Required Dependencies 12 | 13 | This project depends on having a working `rust` toolchain, `protoc`, and `git` 14 | installed locally to build and generate code. 15 | 16 | Getting a working `rust` toolchain is beyond the scope of this project, but we 17 | recommend checking out [rustup](https://rustup.rs/). 18 | 19 | For getting started with `protoc`, see [the prost documentation][prost] and the 20 | [official protoc documentation][protoc]. 21 | 22 | [prost]: https://docs.rs/prost-build/latest/prost_build/#sourcing-protoc 23 | [protoc]: https://grpc.io/docs/protoc-installation/ 24 | 25 | ## Updating Envoy Protobufs 26 | 27 | This project uses a pinned list of protobuf dependency versions and their git 28 | repositories to pull in protobuf defintions. Those versions are kept pinned in 29 | `protobufs.toml`, and pulled from their git repositories at build time. 30 | 31 | The pinned versions in `protobufs.toml` are kept in sync with a specific Envoy 32 | commit. To update protobuf definitions, find a new Envoy revision to pin this 33 | project to, and get the list of downstream dependency versions from the Envoy 34 | project's bazel build rules. There is no easy way to do this, we're sorry. 35 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "xds-api" 3 | version = "0.2.0" 4 | edition = "2021" 5 | authors = ["Junction Labs"] 6 | license = "Apache-2.0" 7 | repository = "https://github.com/junction-labs/xds-api" 8 | homepage = "https://github.com/junction-labs/xds-api" 9 | readme = "README.md" 10 | description = """ 11 | Protocol buffer types for working with Envoy's xDS APIs. 12 | """ 13 | keywords = ["grpc", "xds", "envoy"] 14 | 15 | # we use std::sync::LazyLock 16 | rust-version = "1.81" 17 | 18 | [lib] 19 | doctest = false 20 | 21 | [dependencies] 22 | enum-map = "2.7" 23 | prost = "0.13" 24 | tonic = { version = "0.12", default-features = false, features = [ 25 | "prost", 26 | "codegen", 27 | ] } 28 | pbjson = { version = "0.7", optional = true } 29 | serde = { version = "1.0", optional = true } 30 | 31 | [features] 32 | pbjson = ["dep:pbjson", "dep:serde"] 33 | descriptor = [] 34 | 35 | [dev-dependencies] 36 | anyhow = "1" 37 | glob = "0.3" 38 | pbjson-build = "0.7" 39 | prost-build = "0.13" 40 | prost-types = "0.13" 41 | rand = "0.8" 42 | serde = { version = "1.0", features = ["derive"] } 43 | serde_json = "1.0" 44 | toml = "0.8" 45 | tonic-build = { version = "0.12", default-features = false, features = [ 46 | "prost", 47 | ] } 48 | xshell = "0.2" 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xds-api 2 | 3 | This crate contains generated [Tonic][tonic] bindings for [the xDS gRPC 4 | protocol][xds]. You should depend on this crate if you're interested in 5 | building an xDS client or server or are working with any of Envoy's 6 | configuration types. 7 | 8 | [xds]: https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol 9 | [tonic]: https://crates.io/crates/tonic 10 | 11 | ## xDS Versions 12 | 13 | This crate targets the v3 versions of the xDS APIs. If you are interested 14 | in v2 API support, please reach out or open an issue. 15 | 16 | ## `WellKnownTypes` 17 | 18 | xDS makes heavy use of the protobuf [`Any`][protoany] type. To make working with 19 | `Any` easier, this crate generates its own `Any` implementation and provides 20 | [`WellKnownTypes`] for converting between `Any` and known type URLs. 21 | 22 | [protoany]: https://protobuf.dev/reference/protobuf/google.protobuf/#any 23 | 24 | ## Feature Flags 25 | 26 | This crate provides feature flags for: 27 | 28 | - `pbjson`: Enables Serde serialization/deserialization for xDS types using the 29 | [pbjson][pbjson] crate, which approximates the [canonical json][protojson] 30 | mapping with Serde APIs. Enabling this flag adds a `Serialize` and `Deserialize` 31 | implementation to all xDS types. 32 | 33 | - `descriptor`: Generates and includes an encoded protobuf descriptor for all of 34 | the types in the xDS API. That descriptor can be [registered with 35 | `tonic_reflection`][reflection] to make the xDS APIs visible to a gRPC 36 | Reflection Service. 37 | 38 | [pbjson]: https://crates.io/crates/pbjson 39 | [reflection]: https://docs.rs/tonic-reflection/0.12.2/tonic_reflection/server/struct.Builder.html#method.register_encoded_file_descriptor_set 40 | [protojson]: https://protobuf.dev/programming-guides/proto3/#json 41 | 42 | ## Protoc 43 | 44 | Because this crate compiles well-known types on its own, it depends on a pinned 45 | version of `protoc`. The currently pinned version is kept in `.protoc-version`. 46 | -------------------------------------------------------------------------------- /protobufs.toml: -------------------------------------------------------------------------------- 1 | # Proto dependencies for building the Envoy XDS APIs. 2 | # 3 | # The version of the envoy-data-plane repo here determines the version of all of 4 | # the other dependencies in this file. The git refs here MUST match the versions 5 | # listed in enovyproxy/data-plane-api.git/bazel/repository_locations.bzl. 6 | [dependencies] 7 | envoy-data-plane = { repo_url = "https://github.com/envoyproxy/data-plane-api.git", git_ref = "786c93ccaae9891338f098a5aba60e9987d78bd3" } 8 | cncf-xds = { repo_url = "https://github.com/cncf/xds", git_ref = "555b57ec207be86f811fb0c04752db6f85e3d7e2" } 9 | protoc-gen-validate = { repo_url = "https://github.com/bufbuild/protoc-gen-validate", git_ref = "v1.0.4" } 10 | googleapis = { repo_url = "https://github.com/googleapis/googleapis", git_ref = "114a745b2841a044e98cdbb19358ed29fcf4a5f1" } 11 | opencensus-proto = { repo_url = "https://github.com/census-instrumentation/opencensus-proto", git_ref = "v0.4.1", proto_root = "src" } 12 | prometheus-client-model = { repo_url = "https://github.com/prometheus/client_model", git_ref = "v0.6.1" } 13 | -------------------------------------------------------------------------------- /src/generated/envoy.annotations.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | #[derive(Clone, PartialEq, ::prost::Message)] 3 | pub struct ResourceAnnotation { 4 | /// Annotation for xDS services that indicates the fully-qualified Protobuf type for the resource 5 | /// type. 6 | #[prost(string, tag = "1")] 7 | pub r#type: ::prost::alloc::string::String, 8 | } 9 | impl ::prost::Name for ResourceAnnotation { 10 | const NAME: &'static str = "ResourceAnnotation"; 11 | const PACKAGE: &'static str = "envoy.annotations"; 12 | fn full_name() -> ::prost::alloc::string::String { 13 | "envoy.annotations.ResourceAnnotation".into() 14 | } 15 | fn type_url() -> ::prost::alloc::string::String { 16 | "type.googleapis.com/envoy.annotations.ResourceAnnotation".into() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/generated/envoy.annotations.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for ResourceAnnotation { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if !self.r#type.is_empty() { 10 | len += 1; 11 | } 12 | let mut struct_ser = serializer.serialize_struct("envoy.annotations.ResourceAnnotation", len)?; 13 | if !self.r#type.is_empty() { 14 | struct_ser.serialize_field("type", &self.r#type)?; 15 | } 16 | struct_ser.end() 17 | } 18 | } 19 | impl<'de> serde::Deserialize<'de> for ResourceAnnotation { 20 | #[allow(deprecated)] 21 | fn deserialize(deserializer: D) -> std::result::Result 22 | where 23 | D: serde::Deserializer<'de>, 24 | { 25 | const FIELDS: &[&str] = &[ 26 | "type", 27 | ]; 28 | 29 | #[allow(clippy::enum_variant_names)] 30 | enum GeneratedField { 31 | Type, 32 | } 33 | impl<'de> serde::Deserialize<'de> for GeneratedField { 34 | fn deserialize(deserializer: D) -> std::result::Result 35 | where 36 | D: serde::Deserializer<'de>, 37 | { 38 | struct GeneratedVisitor; 39 | 40 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 41 | type Value = GeneratedField; 42 | 43 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 44 | write!(formatter, "expected one of: {:?}", &FIELDS) 45 | } 46 | 47 | #[allow(unused_variables)] 48 | fn visit_str(self, value: &str) -> std::result::Result 49 | where 50 | E: serde::de::Error, 51 | { 52 | match value { 53 | "type" => Ok(GeneratedField::Type), 54 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 55 | } 56 | } 57 | } 58 | deserializer.deserialize_identifier(GeneratedVisitor) 59 | } 60 | } 61 | struct GeneratedVisitor; 62 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 63 | type Value = ResourceAnnotation; 64 | 65 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 66 | formatter.write_str("struct envoy.annotations.ResourceAnnotation") 67 | } 68 | 69 | fn visit_map(self, mut map_: V) -> std::result::Result 70 | where 71 | V: serde::de::MapAccess<'de>, 72 | { 73 | let mut r#type__ = None; 74 | while let Some(k) = map_.next_key()? { 75 | match k { 76 | GeneratedField::Type => { 77 | if r#type__.is_some() { 78 | return Err(serde::de::Error::duplicate_field("type")); 79 | } 80 | r#type__ = Some(map_.next_value()?); 81 | } 82 | } 83 | } 84 | Ok(ResourceAnnotation { 85 | r#type: r#type__.unwrap_or_default(), 86 | }) 87 | } 88 | } 89 | deserializer.deserialize_struct("envoy.annotations.ResourceAnnotation", FIELDS, GeneratedVisitor) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/generated/envoy.config.common.key_value.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// This shared configuration for Envoy key value stores. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct KeyValueStoreConfig { 5 | /// \[#extension-category: envoy.common.key_value\] 6 | #[prost(message, optional, tag = "1")] 7 | pub config: ::core::option::Option< 8 | super::super::super::core::v3::TypedExtensionConfig, 9 | >, 10 | } 11 | impl ::prost::Name for KeyValueStoreConfig { 12 | const NAME: &'static str = "KeyValueStoreConfig"; 13 | const PACKAGE: &'static str = "envoy.config.common.key_value.v3"; 14 | fn full_name() -> ::prost::alloc::string::String { 15 | "envoy.config.common.key_value.v3.KeyValueStoreConfig".into() 16 | } 17 | fn type_url() -> ::prost::alloc::string::String { 18 | "type.googleapis.com/envoy.config.common.key_value.v3.KeyValueStoreConfig".into() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/generated/envoy.config.common.key_value.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for KeyValueStoreConfig { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.config.is_some() { 10 | len += 1; 11 | } 12 | let mut struct_ser = serializer.serialize_struct("envoy.config.common.key_value.v3.KeyValueStoreConfig", len)?; 13 | if let Some(v) = self.config.as_ref() { 14 | struct_ser.serialize_field("config", v)?; 15 | } 16 | struct_ser.end() 17 | } 18 | } 19 | impl<'de> serde::Deserialize<'de> for KeyValueStoreConfig { 20 | #[allow(deprecated)] 21 | fn deserialize(deserializer: D) -> std::result::Result 22 | where 23 | D: serde::Deserializer<'de>, 24 | { 25 | const FIELDS: &[&str] = &[ 26 | "config", 27 | ]; 28 | 29 | #[allow(clippy::enum_variant_names)] 30 | enum GeneratedField { 31 | Config, 32 | } 33 | impl<'de> serde::Deserialize<'de> for GeneratedField { 34 | fn deserialize(deserializer: D) -> std::result::Result 35 | where 36 | D: serde::Deserializer<'de>, 37 | { 38 | struct GeneratedVisitor; 39 | 40 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 41 | type Value = GeneratedField; 42 | 43 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 44 | write!(formatter, "expected one of: {:?}", &FIELDS) 45 | } 46 | 47 | #[allow(unused_variables)] 48 | fn visit_str(self, value: &str) -> std::result::Result 49 | where 50 | E: serde::de::Error, 51 | { 52 | match value { 53 | "config" => Ok(GeneratedField::Config), 54 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 55 | } 56 | } 57 | } 58 | deserializer.deserialize_identifier(GeneratedVisitor) 59 | } 60 | } 61 | struct GeneratedVisitor; 62 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 63 | type Value = KeyValueStoreConfig; 64 | 65 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 66 | formatter.write_str("struct envoy.config.common.key_value.v3.KeyValueStoreConfig") 67 | } 68 | 69 | fn visit_map(self, mut map_: V) -> std::result::Result 70 | where 71 | V: serde::de::MapAccess<'de>, 72 | { 73 | let mut config__ = None; 74 | while let Some(k) = map_.next_key()? { 75 | match k { 76 | GeneratedField::Config => { 77 | if config__.is_some() { 78 | return Err(serde::de::Error::duplicate_field("config")); 79 | } 80 | config__ = map_.next_value()?; 81 | } 82 | } 83 | } 84 | Ok(KeyValueStoreConfig { 85 | config: config__, 86 | }) 87 | } 88 | } 89 | deserializer.deserialize_struct("envoy.config.common.key_value.v3.KeyValueStoreConfig", FIELDS, GeneratedVisitor) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/generated/envoy.config.common.mutation_rules.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// The HeaderMutationRules structure specifies what headers may be 3 | /// manipulated by a processing filter. This set of rules makes it 4 | /// possible to control which modifications a filter may make. 5 | /// 6 | /// By default, an external processing server may add, modify, or remove 7 | /// any header except for an "Envoy internal" header (which is typically 8 | /// denoted by an x-envoy prefix) or specific headers that may affect 9 | /// further filter processing: 10 | /// 11 | /// * ``host`` 12 | /// * ``:authority`` 13 | /// * ``:scheme`` 14 | /// * ``:method`` 15 | /// 16 | /// Every attempt to add, change, append, or remove a header will be 17 | /// tested against the rules here. Disallowed header mutations will be 18 | /// ignored unless ``disallow_is_error`` is set to true. 19 | /// 20 | /// Attempts to remove headers are further constrained -- regardless of the 21 | /// settings, system-defined headers (that start with ``:``) and the ``host`` 22 | /// header may never be removed. 23 | /// 24 | /// In addition, a counter will be incremented whenever a mutation is 25 | /// rejected. In the ext_proc filter, that counter is named 26 | /// ``rejected_header_mutations``. 27 | /// \[#next-free-field: 8\] 28 | #[derive(Clone, PartialEq, ::prost::Message)] 29 | pub struct HeaderMutationRules { 30 | /// By default, certain headers that could affect processing of subsequent 31 | /// filters or request routing cannot be modified. These headers are 32 | /// ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter 33 | /// to true allows these headers to be modified as well. 34 | #[prost(message, optional, tag = "1")] 35 | pub allow_all_routing: ::core::option::Option< 36 | super::super::super::super::super::google::protobuf::BoolValue, 37 | >, 38 | /// If true, allow modification of envoy internal headers. By default, these 39 | /// start with ``x-envoy`` but this may be overridden in the ``Bootstrap`` 40 | /// configuration using the 41 | /// :ref:`header_prefix ` 42 | /// field. Default is false. 43 | #[prost(message, optional, tag = "2")] 44 | pub allow_envoy: ::core::option::Option< 45 | super::super::super::super::super::google::protobuf::BoolValue, 46 | >, 47 | /// If true, prevent modification of any system header, defined as a header 48 | /// that starts with a ``:`` character, regardless of any other settings. 49 | /// A processing server may still override the ``:status`` of an HTTP response 50 | /// using an ``ImmediateResponse`` message. Default is false. 51 | #[prost(message, optional, tag = "3")] 52 | pub disallow_system: ::core::option::Option< 53 | super::super::super::super::super::google::protobuf::BoolValue, 54 | >, 55 | /// If true, prevent modifications of all header values, regardless of any 56 | /// other settings. A processing server may still override the ``:status`` 57 | /// of an HTTP response using an ``ImmediateResponse`` message. Default is false. 58 | #[prost(message, optional, tag = "4")] 59 | pub disallow_all: ::core::option::Option< 60 | super::super::super::super::super::google::protobuf::BoolValue, 61 | >, 62 | /// If set, specifically allow any header that matches this regular 63 | /// expression. This overrides all other settings except for 64 | /// ``disallow_expression``. 65 | #[prost(message, optional, tag = "5")] 66 | pub allow_expression: ::core::option::Option< 67 | super::super::super::super::r#type::matcher::v3::RegexMatcher, 68 | >, 69 | /// If set, specifically disallow any header that matches this regular 70 | /// expression regardless of any other settings. 71 | #[prost(message, optional, tag = "6")] 72 | pub disallow_expression: ::core::option::Option< 73 | super::super::super::super::r#type::matcher::v3::RegexMatcher, 74 | >, 75 | /// If true, and if the rules in this list cause a header mutation to be 76 | /// disallowed, then the filter using this configuration will terminate the 77 | /// request with a 500 error. In addition, regardless of the setting of this 78 | /// parameter, any attempt to set, add, or modify a disallowed header will 79 | /// cause the ``rejected_header_mutations`` counter to be incremented. 80 | /// Default is false. 81 | #[prost(message, optional, tag = "7")] 82 | pub disallow_is_error: ::core::option::Option< 83 | super::super::super::super::super::google::protobuf::BoolValue, 84 | >, 85 | } 86 | impl ::prost::Name for HeaderMutationRules { 87 | const NAME: &'static str = "HeaderMutationRules"; 88 | const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3"; 89 | fn full_name() -> ::prost::alloc::string::String { 90 | "envoy.config.common.mutation_rules.v3.HeaderMutationRules".into() 91 | } 92 | fn type_url() -> ::prost::alloc::string::String { 93 | "type.googleapis.com/envoy.config.common.mutation_rules.v3.HeaderMutationRules" 94 | .into() 95 | } 96 | } 97 | /// The HeaderMutation structure specifies an action that may be taken on HTTP 98 | /// headers. 99 | #[derive(Clone, PartialEq, ::prost::Message)] 100 | pub struct HeaderMutation { 101 | #[prost(oneof = "header_mutation::Action", tags = "1, 2")] 102 | pub action: ::core::option::Option, 103 | } 104 | /// Nested message and enum types in `HeaderMutation`. 105 | pub mod header_mutation { 106 | #[derive(Clone, PartialEq, ::prost::Oneof)] 107 | pub enum Action { 108 | /// Remove the specified header if it exists. 109 | #[prost(string, tag = "1")] 110 | Remove(::prost::alloc::string::String), 111 | /// Append new header by the specified HeaderValueOption. 112 | #[prost(message, tag = "2")] 113 | Append(super::super::super::super::core::v3::HeaderValueOption), 114 | } 115 | } 116 | impl ::prost::Name for HeaderMutation { 117 | const NAME: &'static str = "HeaderMutation"; 118 | const PACKAGE: &'static str = "envoy.config.common.mutation_rules.v3"; 119 | fn full_name() -> ::prost::alloc::string::String { 120 | "envoy.config.common.mutation_rules.v3.HeaderMutation".into() 121 | } 122 | fn type_url() -> ::prost::alloc::string::String { 123 | "type.googleapis.com/envoy.config.common.mutation_rules.v3.HeaderMutation".into() 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/generated/envoy.config.grpc_credential.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | #[derive(Clone, PartialEq, ::prost::Message)] 3 | pub struct AwsIamConfig { 4 | /// The `service namespace 5 | /// <`_> 6 | /// of the Grpc endpoint. 7 | /// 8 | /// Example: appmesh 9 | #[prost(string, tag = "1")] 10 | pub service_name: ::prost::alloc::string::String, 11 | /// The `region <`_> hosting the Grpc 12 | /// endpoint. If unspecified, the extension will use the value in the ``AWS_REGION`` environment 13 | /// variable. 14 | /// 15 | /// Example: us-west-2 16 | #[prost(string, tag = "2")] 17 | pub region: ::prost::alloc::string::String, 18 | } 19 | impl ::prost::Name for AwsIamConfig { 20 | const NAME: &'static str = "AwsIamConfig"; 21 | const PACKAGE: &'static str = "envoy.config.grpc_credential.v3"; 22 | fn full_name() -> ::prost::alloc::string::String { 23 | "envoy.config.grpc_credential.v3.AwsIamConfig".into() 24 | } 25 | fn type_url() -> ::prost::alloc::string::String { 26 | "type.googleapis.com/envoy.config.grpc_credential.v3.AwsIamConfig".into() 27 | } 28 | } 29 | #[derive(Clone, PartialEq, ::prost::Message)] 30 | pub struct FileBasedMetadataConfig { 31 | /// Location or inline data of secret to use for authentication of the Google gRPC connection 32 | /// this secret will be attached to a header of the gRPC connection 33 | #[prost(message, optional, tag = "1")] 34 | pub secret_data: ::core::option::Option, 35 | /// Metadata header key to use for sending the secret data 36 | /// if no header key is set, "authorization" header will be used 37 | #[prost(string, tag = "2")] 38 | pub header_key: ::prost::alloc::string::String, 39 | /// Prefix to prepend to the secret in the metadata header 40 | /// if no prefix is set, the default is to use no prefix 41 | #[prost(string, tag = "3")] 42 | pub header_prefix: ::prost::alloc::string::String, 43 | } 44 | impl ::prost::Name for FileBasedMetadataConfig { 45 | const NAME: &'static str = "FileBasedMetadataConfig"; 46 | const PACKAGE: &'static str = "envoy.config.grpc_credential.v3"; 47 | fn full_name() -> ::prost::alloc::string::String { 48 | "envoy.config.grpc_credential.v3.FileBasedMetadataConfig".into() 49 | } 50 | fn type_url() -> ::prost::alloc::string::String { 51 | "type.googleapis.com/envoy.config.grpc_credential.v3.FileBasedMetadataConfig" 52 | .into() 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/generated/envoy.config.grpc_credential.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for AwsIamConfig { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if !self.service_name.is_empty() { 10 | len += 1; 11 | } 12 | if !self.region.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.config.grpc_credential.v3.AwsIamConfig", len)?; 16 | if !self.service_name.is_empty() { 17 | struct_ser.serialize_field("service_name", &self.service_name)?; 18 | } 19 | if !self.region.is_empty() { 20 | struct_ser.serialize_field("region", &self.region)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for AwsIamConfig { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "service_name", 33 | "serviceName", 34 | "region", 35 | ]; 36 | 37 | #[allow(clippy::enum_variant_names)] 38 | enum GeneratedField { 39 | ServiceName, 40 | Region, 41 | } 42 | impl<'de> serde::Deserialize<'de> for GeneratedField { 43 | fn deserialize(deserializer: D) -> std::result::Result 44 | where 45 | D: serde::Deserializer<'de>, 46 | { 47 | struct GeneratedVisitor; 48 | 49 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 50 | type Value = GeneratedField; 51 | 52 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 53 | write!(formatter, "expected one of: {:?}", &FIELDS) 54 | } 55 | 56 | #[allow(unused_variables)] 57 | fn visit_str(self, value: &str) -> std::result::Result 58 | where 59 | E: serde::de::Error, 60 | { 61 | match value { 62 | "serviceName" | "service_name" => Ok(GeneratedField::ServiceName), 63 | "region" => Ok(GeneratedField::Region), 64 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 65 | } 66 | } 67 | } 68 | deserializer.deserialize_identifier(GeneratedVisitor) 69 | } 70 | } 71 | struct GeneratedVisitor; 72 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 73 | type Value = AwsIamConfig; 74 | 75 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 76 | formatter.write_str("struct envoy.config.grpc_credential.v3.AwsIamConfig") 77 | } 78 | 79 | fn visit_map(self, mut map_: V) -> std::result::Result 80 | where 81 | V: serde::de::MapAccess<'de>, 82 | { 83 | let mut service_name__ = None; 84 | let mut region__ = None; 85 | while let Some(k) = map_.next_key()? { 86 | match k { 87 | GeneratedField::ServiceName => { 88 | if service_name__.is_some() { 89 | return Err(serde::de::Error::duplicate_field("serviceName")); 90 | } 91 | service_name__ = Some(map_.next_value()?); 92 | } 93 | GeneratedField::Region => { 94 | if region__.is_some() { 95 | return Err(serde::de::Error::duplicate_field("region")); 96 | } 97 | region__ = Some(map_.next_value()?); 98 | } 99 | } 100 | } 101 | Ok(AwsIamConfig { 102 | service_name: service_name__.unwrap_or_default(), 103 | region: region__.unwrap_or_default(), 104 | }) 105 | } 106 | } 107 | deserializer.deserialize_struct("envoy.config.grpc_credential.v3.AwsIamConfig", FIELDS, GeneratedVisitor) 108 | } 109 | } 110 | impl serde::Serialize for FileBasedMetadataConfig { 111 | #[allow(deprecated)] 112 | fn serialize(&self, serializer: S) -> std::result::Result 113 | where 114 | S: serde::Serializer, 115 | { 116 | use serde::ser::SerializeStruct; 117 | let mut len = 0; 118 | if self.secret_data.is_some() { 119 | len += 1; 120 | } 121 | if !self.header_key.is_empty() { 122 | len += 1; 123 | } 124 | if !self.header_prefix.is_empty() { 125 | len += 1; 126 | } 127 | let mut struct_ser = serializer.serialize_struct("envoy.config.grpc_credential.v3.FileBasedMetadataConfig", len)?; 128 | if let Some(v) = self.secret_data.as_ref() { 129 | struct_ser.serialize_field("secret_data", v)?; 130 | } 131 | if !self.header_key.is_empty() { 132 | struct_ser.serialize_field("header_key", &self.header_key)?; 133 | } 134 | if !self.header_prefix.is_empty() { 135 | struct_ser.serialize_field("header_prefix", &self.header_prefix)?; 136 | } 137 | struct_ser.end() 138 | } 139 | } 140 | impl<'de> serde::Deserialize<'de> for FileBasedMetadataConfig { 141 | #[allow(deprecated)] 142 | fn deserialize(deserializer: D) -> std::result::Result 143 | where 144 | D: serde::Deserializer<'de>, 145 | { 146 | const FIELDS: &[&str] = &[ 147 | "secret_data", 148 | "secretData", 149 | "header_key", 150 | "headerKey", 151 | "header_prefix", 152 | "headerPrefix", 153 | ]; 154 | 155 | #[allow(clippy::enum_variant_names)] 156 | enum GeneratedField { 157 | SecretData, 158 | HeaderKey, 159 | HeaderPrefix, 160 | } 161 | impl<'de> serde::Deserialize<'de> for GeneratedField { 162 | fn deserialize(deserializer: D) -> std::result::Result 163 | where 164 | D: serde::Deserializer<'de>, 165 | { 166 | struct GeneratedVisitor; 167 | 168 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 169 | type Value = GeneratedField; 170 | 171 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 172 | write!(formatter, "expected one of: {:?}", &FIELDS) 173 | } 174 | 175 | #[allow(unused_variables)] 176 | fn visit_str(self, value: &str) -> std::result::Result 177 | where 178 | E: serde::de::Error, 179 | { 180 | match value { 181 | "secretData" | "secret_data" => Ok(GeneratedField::SecretData), 182 | "headerKey" | "header_key" => Ok(GeneratedField::HeaderKey), 183 | "headerPrefix" | "header_prefix" => Ok(GeneratedField::HeaderPrefix), 184 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 185 | } 186 | } 187 | } 188 | deserializer.deserialize_identifier(GeneratedVisitor) 189 | } 190 | } 191 | struct GeneratedVisitor; 192 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 193 | type Value = FileBasedMetadataConfig; 194 | 195 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 196 | formatter.write_str("struct envoy.config.grpc_credential.v3.FileBasedMetadataConfig") 197 | } 198 | 199 | fn visit_map(self, mut map_: V) -> std::result::Result 200 | where 201 | V: serde::de::MapAccess<'de>, 202 | { 203 | let mut secret_data__ = None; 204 | let mut header_key__ = None; 205 | let mut header_prefix__ = None; 206 | while let Some(k) = map_.next_key()? { 207 | match k { 208 | GeneratedField::SecretData => { 209 | if secret_data__.is_some() { 210 | return Err(serde::de::Error::duplicate_field("secretData")); 211 | } 212 | secret_data__ = map_.next_value()?; 213 | } 214 | GeneratedField::HeaderKey => { 215 | if header_key__.is_some() { 216 | return Err(serde::de::Error::duplicate_field("headerKey")); 217 | } 218 | header_key__ = Some(map_.next_value()?); 219 | } 220 | GeneratedField::HeaderPrefix => { 221 | if header_prefix__.is_some() { 222 | return Err(serde::de::Error::duplicate_field("headerPrefix")); 223 | } 224 | header_prefix__ = Some(map_.next_value()?); 225 | } 226 | } 227 | } 228 | Ok(FileBasedMetadataConfig { 229 | secret_data: secret_data__, 230 | header_key: header_key__.unwrap_or_default(), 231 | header_prefix: header_prefix__.unwrap_or_default(), 232 | }) 233 | } 234 | } 235 | deserializer.deserialize_struct("envoy.config.grpc_credential.v3.FileBasedMetadataConfig", FIELDS, GeneratedVisitor) 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /src/generated/envoy.config.ratelimit.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Rate limit :ref:`configuration overview `. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct RateLimitServiceConfig { 5 | /// Specifies the gRPC service that hosts the rate limit service. The client 6 | /// will connect to this cluster when it needs to make rate limit service 7 | /// requests. 8 | #[prost(message, optional, tag = "2")] 9 | pub grpc_service: ::core::option::Option, 10 | /// API version for rate limit transport protocol. This describes the rate limit gRPC endpoint and 11 | /// version of messages used on the wire. 12 | #[prost(enumeration = "super::super::core::v3::ApiVersion", tag = "4")] 13 | pub transport_api_version: i32, 14 | } 15 | impl ::prost::Name for RateLimitServiceConfig { 16 | const NAME: &'static str = "RateLimitServiceConfig"; 17 | const PACKAGE: &'static str = "envoy.config.ratelimit.v3"; 18 | fn full_name() -> ::prost::alloc::string::String { 19 | "envoy.config.ratelimit.v3.RateLimitServiceConfig".into() 20 | } 21 | fn type_url() -> ::prost::alloc::string::String { 22 | "type.googleapis.com/envoy.config.ratelimit.v3.RateLimitServiceConfig".into() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/generated/envoy.config.ratelimit.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for RateLimitServiceConfig { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.grpc_service.is_some() { 10 | len += 1; 11 | } 12 | if self.transport_api_version != 0 { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.config.ratelimit.v3.RateLimitServiceConfig", len)?; 16 | if let Some(v) = self.grpc_service.as_ref() { 17 | struct_ser.serialize_field("grpc_service", v)?; 18 | } 19 | if self.transport_api_version != 0 { 20 | let v = super::super::core::v3::ApiVersion::try_from(self.transport_api_version) 21 | .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.transport_api_version)))?; 22 | struct_ser.serialize_field("transport_api_version", &v)?; 23 | } 24 | struct_ser.end() 25 | } 26 | } 27 | impl<'de> serde::Deserialize<'de> for RateLimitServiceConfig { 28 | #[allow(deprecated)] 29 | fn deserialize(deserializer: D) -> std::result::Result 30 | where 31 | D: serde::Deserializer<'de>, 32 | { 33 | const FIELDS: &[&str] = &[ 34 | "grpc_service", 35 | "grpcService", 36 | "transport_api_version", 37 | "transportApiVersion", 38 | ]; 39 | 40 | #[allow(clippy::enum_variant_names)] 41 | enum GeneratedField { 42 | GrpcService, 43 | TransportApiVersion, 44 | } 45 | impl<'de> serde::Deserialize<'de> for GeneratedField { 46 | fn deserialize(deserializer: D) -> std::result::Result 47 | where 48 | D: serde::Deserializer<'de>, 49 | { 50 | struct GeneratedVisitor; 51 | 52 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 53 | type Value = GeneratedField; 54 | 55 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 56 | write!(formatter, "expected one of: {:?}", &FIELDS) 57 | } 58 | 59 | #[allow(unused_variables)] 60 | fn visit_str(self, value: &str) -> std::result::Result 61 | where 62 | E: serde::de::Error, 63 | { 64 | match value { 65 | "grpcService" | "grpc_service" => Ok(GeneratedField::GrpcService), 66 | "transportApiVersion" | "transport_api_version" => Ok(GeneratedField::TransportApiVersion), 67 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 68 | } 69 | } 70 | } 71 | deserializer.deserialize_identifier(GeneratedVisitor) 72 | } 73 | } 74 | struct GeneratedVisitor; 75 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 76 | type Value = RateLimitServiceConfig; 77 | 78 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 79 | formatter.write_str("struct envoy.config.ratelimit.v3.RateLimitServiceConfig") 80 | } 81 | 82 | fn visit_map(self, mut map_: V) -> std::result::Result 83 | where 84 | V: serde::de::MapAccess<'de>, 85 | { 86 | let mut grpc_service__ = None; 87 | let mut transport_api_version__ = None; 88 | while let Some(k) = map_.next_key()? { 89 | match k { 90 | GeneratedField::GrpcService => { 91 | if grpc_service__.is_some() { 92 | return Err(serde::de::Error::duplicate_field("grpcService")); 93 | } 94 | grpc_service__ = map_.next_value()?; 95 | } 96 | GeneratedField::TransportApiVersion => { 97 | if transport_api_version__.is_some() { 98 | return Err(serde::de::Error::duplicate_field("transportApiVersion")); 99 | } 100 | transport_api_version__ = Some(map_.next_value::()? as i32); 101 | } 102 | } 103 | } 104 | Ok(RateLimitServiceConfig { 105 | grpc_service: grpc_service__, 106 | transport_api_version: transport_api_version__.unwrap_or_default(), 107 | }) 108 | } 109 | } 110 | deserializer.deserialize_struct("envoy.config.ratelimit.v3.RateLimitServiceConfig", FIELDS, GeneratedVisitor) 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/generated/envoy.config.upstream.local_address_selector.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Default implementation of a local address selector. This implementation is 3 | /// used if :ref:`local_address_selector 4 | /// ` is not 5 | /// specified. 6 | /// This implementation supports the specification of only one address in 7 | /// :ref:`extra_source_addresses 8 | /// ` which 9 | /// is appended to the address specified in the 10 | /// :ref:`source_address ` 11 | /// field. The extra address should have a different IP version than the address in the 12 | /// ``source_address`` field. The address which has the same IP 13 | /// version with the target host's address IP version will be used as bind address. 14 | /// If there is no same IP version address found, the address in the ``source_address`` field will 15 | /// be returned. 16 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 17 | pub struct DefaultLocalAddressSelector {} 18 | impl ::prost::Name for DefaultLocalAddressSelector { 19 | const NAME: &'static str = "DefaultLocalAddressSelector"; 20 | const PACKAGE: &'static str = "envoy.config.upstream.local_address_selector.v3"; 21 | fn full_name() -> ::prost::alloc::string::String { 22 | "envoy.config.upstream.local_address_selector.v3.DefaultLocalAddressSelector" 23 | .into() 24 | } 25 | fn type_url() -> ::prost::alloc::string::String { 26 | "type.googleapis.com/envoy.config.upstream.local_address_selector.v3.DefaultLocalAddressSelector" 27 | .into() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/generated/envoy.config.upstream.local_address_selector.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for DefaultLocalAddressSelector { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.config.upstream.local_address_selector.v3.DefaultLocalAddressSelector", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for DefaultLocalAddressSelector { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = DefaultLocalAddressSelector; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.config.upstream.local_address_selector.v3.DefaultLocalAddressSelector") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(DefaultLocalAddressSelector { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.config.upstream.local_address_selector.v3.DefaultLocalAddressSelector", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/generated/envoy.extensions.clusters.aggregate.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Configuration for the aggregate cluster. See the :ref:`architecture overview 3 | /// ` for more information. 4 | /// \[#extension: envoy.clusters.aggregate\] 5 | #[derive(Clone, PartialEq, ::prost::Message)] 6 | pub struct ClusterConfig { 7 | /// Load balancing clusters in aggregate cluster. Clusters are prioritized based on the order they 8 | /// appear in this list. 9 | #[prost(string, repeated, tag = "1")] 10 | pub clusters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 11 | } 12 | impl ::prost::Name for ClusterConfig { 13 | const NAME: &'static str = "ClusterConfig"; 14 | const PACKAGE: &'static str = "envoy.extensions.clusters.aggregate.v3"; 15 | fn full_name() -> ::prost::alloc::string::String { 16 | "envoy.extensions.clusters.aggregate.v3.ClusterConfig".into() 17 | } 18 | fn type_url() -> ::prost::alloc::string::String { 19 | "type.googleapis.com/envoy.extensions.clusters.aggregate.v3.ClusterConfig".into() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/generated/envoy.extensions.clusters.aggregate.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for ClusterConfig { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if !self.clusters.is_empty() { 10 | len += 1; 11 | } 12 | let mut struct_ser = serializer.serialize_struct("envoy.extensions.clusters.aggregate.v3.ClusterConfig", len)?; 13 | if !self.clusters.is_empty() { 14 | struct_ser.serialize_field("clusters", &self.clusters)?; 15 | } 16 | struct_ser.end() 17 | } 18 | } 19 | impl<'de> serde::Deserialize<'de> for ClusterConfig { 20 | #[allow(deprecated)] 21 | fn deserialize(deserializer: D) -> std::result::Result 22 | where 23 | D: serde::Deserializer<'de>, 24 | { 25 | const FIELDS: &[&str] = &[ 26 | "clusters", 27 | ]; 28 | 29 | #[allow(clippy::enum_variant_names)] 30 | enum GeneratedField { 31 | Clusters, 32 | } 33 | impl<'de> serde::Deserialize<'de> for GeneratedField { 34 | fn deserialize(deserializer: D) -> std::result::Result 35 | where 36 | D: serde::Deserializer<'de>, 37 | { 38 | struct GeneratedVisitor; 39 | 40 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 41 | type Value = GeneratedField; 42 | 43 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 44 | write!(formatter, "expected one of: {:?}", &FIELDS) 45 | } 46 | 47 | #[allow(unused_variables)] 48 | fn visit_str(self, value: &str) -> std::result::Result 49 | where 50 | E: serde::de::Error, 51 | { 52 | match value { 53 | "clusters" => Ok(GeneratedField::Clusters), 54 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 55 | } 56 | } 57 | } 58 | deserializer.deserialize_identifier(GeneratedVisitor) 59 | } 60 | } 61 | struct GeneratedVisitor; 62 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 63 | type Value = ClusterConfig; 64 | 65 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 66 | formatter.write_str("struct envoy.extensions.clusters.aggregate.v3.ClusterConfig") 67 | } 68 | 69 | fn visit_map(self, mut map_: V) -> std::result::Result 70 | where 71 | V: serde::de::MapAccess<'de>, 72 | { 73 | let mut clusters__ = None; 74 | while let Some(k) = map_.next_key()? { 75 | match k { 76 | GeneratedField::Clusters => { 77 | if clusters__.is_some() { 78 | return Err(serde::de::Error::duplicate_field("clusters")); 79 | } 80 | clusters__ = Some(map_.next_value()?); 81 | } 82 | } 83 | } 84 | Ok(ClusterConfig { 85 | clusters: clusters__.unwrap_or_default(), 86 | }) 87 | } 88 | } 89 | deserializer.deserialize_struct("envoy.extensions.clusters.aggregate.v3.ClusterConfig", FIELDS, GeneratedVisitor) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/generated/envoy.extensions.common.ratelimit.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// A RateLimitDescriptor is a list of hierarchical entries that are used by the service to 3 | /// determine the final rate limit key and overall allowed limit. Here are some examples of how 4 | /// they might be used for the domain "envoy". 5 | /// 6 | /// .. code-block:: cpp 7 | /// 8 | /// \["authenticated": "false"\], \["remote_address": "10.0.0.1"\] 9 | /// 10 | /// What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The 11 | /// configuration supplies a default limit for the *remote_address* key. If there is a desire to 12 | /// raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the 13 | /// configuration. 14 | /// 15 | /// .. code-block:: cpp 16 | /// 17 | /// \["authenticated": "false"\], \["path": "/foo/bar"\] 18 | /// 19 | /// What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if 20 | /// configured that way in the service). 21 | /// 22 | /// .. code-block:: cpp 23 | /// 24 | /// \["authenticated": "false"\], \["path": "/foo/bar"\], \["remote_address": "10.0.0.1"\] 25 | /// 26 | /// What it does: Limits unauthenticated traffic to a specific path for a specific IP address. 27 | /// Like (1) we can raise/block specific IP addresses if we want with an override configuration. 28 | /// 29 | /// .. code-block:: cpp 30 | /// 31 | /// \["authenticated": "true"\], \["client_id": "foo"\] 32 | /// 33 | /// What it does: Limits all traffic for an authenticated client "foo" 34 | /// 35 | /// .. code-block:: cpp 36 | /// 37 | /// \["authenticated": "true"\], \["client_id": "foo"\], \["path": "/foo/bar"\] 38 | /// 39 | /// What it does: Limits traffic to a specific path for an authenticated client "foo" 40 | /// 41 | /// The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired. 42 | /// This enables building complex application scenarios with a generic backend. 43 | /// 44 | /// Optionally the descriptor can contain a limit override under a "limit" key, that specifies 45 | /// the number of requests per unit to use instead of the number configured in the 46 | /// rate limiting service. 47 | #[derive(Clone, PartialEq, ::prost::Message)] 48 | pub struct RateLimitDescriptor { 49 | /// Descriptor entries. 50 | #[prost(message, repeated, tag = "1")] 51 | pub entries: ::prost::alloc::vec::Vec, 52 | /// Optional rate limit override to supply to the ratelimit service. 53 | #[prost(message, optional, tag = "2")] 54 | pub limit: ::core::option::Option, 55 | } 56 | /// Nested message and enum types in `RateLimitDescriptor`. 57 | pub mod rate_limit_descriptor { 58 | #[derive(Clone, PartialEq, ::prost::Message)] 59 | pub struct Entry { 60 | /// Descriptor key. 61 | #[prost(string, tag = "1")] 62 | pub key: ::prost::alloc::string::String, 63 | /// Descriptor value. 64 | #[prost(string, tag = "2")] 65 | pub value: ::prost::alloc::string::String, 66 | } 67 | impl ::prost::Name for Entry { 68 | const NAME: &'static str = "Entry"; 69 | const PACKAGE: &'static str = "envoy.extensions.common.ratelimit.v3"; 70 | fn full_name() -> ::prost::alloc::string::String { 71 | "envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry".into() 72 | } 73 | fn type_url() -> ::prost::alloc::string::String { 74 | "type.googleapis.com/envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.Entry" 75 | .into() 76 | } 77 | } 78 | /// Override rate limit to apply to this descriptor instead of the limit 79 | /// configured in the rate limit service. See :ref:`rate limit override 80 | /// ` for more information. 81 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 82 | pub struct RateLimitOverride { 83 | /// The number of requests per unit of time. 84 | #[prost(uint32, tag = "1")] 85 | pub requests_per_unit: u32, 86 | /// The unit of time. 87 | #[prost( 88 | enumeration = "super::super::super::super::super::r#type::v3::RateLimitUnit", 89 | tag = "2" 90 | )] 91 | pub unit: i32, 92 | } 93 | impl ::prost::Name for RateLimitOverride { 94 | const NAME: &'static str = "RateLimitOverride"; 95 | const PACKAGE: &'static str = "envoy.extensions.common.ratelimit.v3"; 96 | fn full_name() -> ::prost::alloc::string::String { 97 | "envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride" 98 | .into() 99 | } 100 | fn type_url() -> ::prost::alloc::string::String { 101 | "type.googleapis.com/envoy.extensions.common.ratelimit.v3.RateLimitDescriptor.RateLimitOverride" 102 | .into() 103 | } 104 | } 105 | } 106 | impl ::prost::Name for RateLimitDescriptor { 107 | const NAME: &'static str = "RateLimitDescriptor"; 108 | const PACKAGE: &'static str = "envoy.extensions.common.ratelimit.v3"; 109 | fn full_name() -> ::prost::alloc::string::String { 110 | "envoy.extensions.common.ratelimit.v3.RateLimitDescriptor".into() 111 | } 112 | fn type_url() -> ::prost::alloc::string::String { 113 | "type.googleapis.com/envoy.extensions.common.ratelimit.v3.RateLimitDescriptor" 114 | .into() 115 | } 116 | } 117 | #[derive(Clone, PartialEq, ::prost::Message)] 118 | pub struct LocalRateLimitDescriptor { 119 | /// Descriptor entries. 120 | #[prost(message, repeated, tag = "1")] 121 | pub entries: ::prost::alloc::vec::Vec, 122 | /// Token Bucket algorithm for local ratelimiting. 123 | #[prost(message, optional, tag = "2")] 124 | pub token_bucket: ::core::option::Option< 125 | super::super::super::super::r#type::v3::TokenBucket, 126 | >, 127 | } 128 | impl ::prost::Name for LocalRateLimitDescriptor { 129 | const NAME: &'static str = "LocalRateLimitDescriptor"; 130 | const PACKAGE: &'static str = "envoy.extensions.common.ratelimit.v3"; 131 | fn full_name() -> ::prost::alloc::string::String { 132 | "envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor".into() 133 | } 134 | fn type_url() -> ::prost::alloc::string::String { 135 | "type.googleapis.com/envoy.extensions.common.ratelimit.v3.LocalRateLimitDescriptor" 136 | .into() 137 | } 138 | } 139 | /// Defines the version of the standard to use for X-RateLimit headers. 140 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] 141 | #[repr(i32)] 142 | pub enum XRateLimitHeadersRfcVersion { 143 | /// X-RateLimit headers disabled. 144 | Off = 0, 145 | /// Use `draft RFC Version 03 <`_> where 3 headers will be added: 146 | /// 147 | /// * ``X-RateLimit-Limit`` - indicates the request-quota associated to the 148 | /// client in the current time-window followed by the description of the 149 | /// quota policy. The value is returned by the maximum tokens of the token bucket. 150 | /// * ``X-RateLimit-Remaining`` - indicates the remaining requests in the 151 | /// current time-window. The value is returned by the remaining tokens in the token bucket. 152 | /// * ``X-RateLimit-Reset`` - indicates the number of seconds until reset of 153 | /// the current time-window. The value is returned by the remaining fill interval of the token bucket. 154 | DraftVersion03 = 1, 155 | } 156 | impl XRateLimitHeadersRfcVersion { 157 | /// String value of the enum field names used in the ProtoBuf definition. 158 | /// 159 | /// The values are not transformed in any way and thus are considered stable 160 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 161 | pub fn as_str_name(&self) -> &'static str { 162 | match self { 163 | Self::Off => "OFF", 164 | Self::DraftVersion03 => "DRAFT_VERSION_03", 165 | } 166 | } 167 | /// Creates an enum from field names used in the ProtoBuf definition. 168 | pub fn from_str_name(value: &str) -> ::core::option::Option { 169 | match value { 170 | "OFF" => Some(Self::Off), 171 | "DRAFT_VERSION_03" => Some(Self::DraftVersion03), 172 | _ => None, 173 | } 174 | } 175 | } 176 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] 177 | #[repr(i32)] 178 | pub enum VhRateLimitsOptions { 179 | /// Use the virtual host rate limits unless the route has a rate limit policy. 180 | Override = 0, 181 | /// Use the virtual host rate limits even if the route has a rate limit policy. 182 | Include = 1, 183 | /// Ignore the virtual host rate limits even if the route does not have a rate limit policy. 184 | Ignore = 2, 185 | } 186 | impl VhRateLimitsOptions { 187 | /// String value of the enum field names used in the ProtoBuf definition. 188 | /// 189 | /// The values are not transformed in any way and thus are considered stable 190 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 191 | pub fn as_str_name(&self) -> &'static str { 192 | match self { 193 | Self::Override => "OVERRIDE", 194 | Self::Include => "INCLUDE", 195 | Self::Ignore => "IGNORE", 196 | } 197 | } 198 | /// Creates an enum from field names used in the ProtoBuf definition. 199 | pub fn from_str_name(value: &str) -> ::core::option::Option { 200 | match value { 201 | "OVERRIDE" => Some(Self::Override), 202 | "INCLUDE" => Some(Self::Include), 203 | "IGNORE" => Some(Self::Ignore), 204 | _ => None, 205 | } 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /src/generated/envoy.extensions.filters.http.ext_proc.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// \[#next-free-field: 7\] 3 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4 | pub struct ProcessingMode { 5 | /// How to handle the request header. Default is "SEND". 6 | #[prost(enumeration = "processing_mode::HeaderSendMode", tag = "1")] 7 | pub request_header_mode: i32, 8 | /// How to handle the response header. Default is "SEND". 9 | #[prost(enumeration = "processing_mode::HeaderSendMode", tag = "2")] 10 | pub response_header_mode: i32, 11 | /// How to handle the request body. Default is "NONE". 12 | #[prost(enumeration = "processing_mode::BodySendMode", tag = "3")] 13 | pub request_body_mode: i32, 14 | /// How do handle the response body. Default is "NONE". 15 | #[prost(enumeration = "processing_mode::BodySendMode", tag = "4")] 16 | pub response_body_mode: i32, 17 | /// How to handle the request trailers. Default is "SKIP". 18 | #[prost(enumeration = "processing_mode::HeaderSendMode", tag = "5")] 19 | pub request_trailer_mode: i32, 20 | /// How to handle the response trailers. Default is "SKIP". 21 | #[prost(enumeration = "processing_mode::HeaderSendMode", tag = "6")] 22 | pub response_trailer_mode: i32, 23 | } 24 | /// Nested message and enum types in `ProcessingMode`. 25 | pub mod processing_mode { 26 | /// Control how headers and trailers are handled 27 | #[derive( 28 | Clone, 29 | Copy, 30 | Debug, 31 | PartialEq, 32 | Eq, 33 | Hash, 34 | PartialOrd, 35 | Ord, 36 | ::prost::Enumeration 37 | )] 38 | #[repr(i32)] 39 | pub enum HeaderSendMode { 40 | /// The default HeaderSendMode depends on which part of the message is being 41 | /// processed. By default, request and response headers are sent, 42 | /// while trailers are skipped. 43 | Default = 0, 44 | /// Send the header or trailer. 45 | Send = 1, 46 | /// Do not send the header or trailer. 47 | Skip = 2, 48 | } 49 | impl HeaderSendMode { 50 | /// String value of the enum field names used in the ProtoBuf definition. 51 | /// 52 | /// The values are not transformed in any way and thus are considered stable 53 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 54 | pub fn as_str_name(&self) -> &'static str { 55 | match self { 56 | Self::Default => "DEFAULT", 57 | Self::Send => "SEND", 58 | Self::Skip => "SKIP", 59 | } 60 | } 61 | /// Creates an enum from field names used in the ProtoBuf definition. 62 | pub fn from_str_name(value: &str) -> ::core::option::Option { 63 | match value { 64 | "DEFAULT" => Some(Self::Default), 65 | "SEND" => Some(Self::Send), 66 | "SKIP" => Some(Self::Skip), 67 | _ => None, 68 | } 69 | } 70 | } 71 | /// Control how the request and response bodies are handled 72 | /// When body mutation by external processor is enabled, ext_proc filter will always remove 73 | /// the content length header in three cases below because content length can not be guaranteed 74 | /// to be set correctly: 75 | /// 1) STREAMED BodySendMode: header processing completes before body mutation comes back. 76 | /// 2) BUFFERED_PARTIAL BodySendMode: body is buffered and could be injected in different phases. 77 | /// 3) BUFFERED BodySendMode + SKIP HeaderSendMode: header processing (e.g., update content-length) is skipped. 78 | /// 79 | /// In Envoy's http1 codec implementation, removing content length will enable chunked transfer 80 | /// encoding whenever feasible. The recipient (either client or server) must be able 81 | /// to parse and decode the chunked transfer coding. 82 | /// (see `details in RFC9112 <`_>). 83 | /// 84 | /// In BUFFERED BodySendMode + SEND HeaderSendMode, content length header is allowed but it is 85 | /// external processor's responsibility to set the content length correctly matched to the length 86 | /// of mutated body. If they don't match, the corresponding body mutation will be rejected and 87 | /// local reply will be sent with an error message. 88 | #[derive( 89 | Clone, 90 | Copy, 91 | Debug, 92 | PartialEq, 93 | Eq, 94 | Hash, 95 | PartialOrd, 96 | Ord, 97 | ::prost::Enumeration 98 | )] 99 | #[repr(i32)] 100 | pub enum BodySendMode { 101 | /// Do not send the body at all. This is the default. 102 | None = 0, 103 | /// Stream the body to the server in pieces as they arrive at the 104 | /// proxy. 105 | Streamed = 1, 106 | /// Buffer the message body in memory and send the entire body at once. 107 | /// If the body exceeds the configured buffer limit, then the 108 | /// downstream system will receive an error. 109 | Buffered = 2, 110 | /// Buffer the message body in memory and send the entire body in one 111 | /// chunk. If the body exceeds the configured buffer limit, then the body contents 112 | /// up to the buffer limit will be sent. 113 | BufferedPartial = 3, 114 | } 115 | impl BodySendMode { 116 | /// String value of the enum field names used in the ProtoBuf definition. 117 | /// 118 | /// The values are not transformed in any way and thus are considered stable 119 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 120 | pub fn as_str_name(&self) -> &'static str { 121 | match self { 122 | Self::None => "NONE", 123 | Self::Streamed => "STREAMED", 124 | Self::Buffered => "BUFFERED", 125 | Self::BufferedPartial => "BUFFERED_PARTIAL", 126 | } 127 | } 128 | /// Creates an enum from field names used in the ProtoBuf definition. 129 | pub fn from_str_name(value: &str) -> ::core::option::Option { 130 | match value { 131 | "NONE" => Some(Self::None), 132 | "STREAMED" => Some(Self::Streamed), 133 | "BUFFERED" => Some(Self::Buffered), 134 | "BUFFERED_PARTIAL" => Some(Self::BufferedPartial), 135 | _ => None, 136 | } 137 | } 138 | } 139 | } 140 | impl ::prost::Name for ProcessingMode { 141 | const NAME: &'static str = "ProcessingMode"; 142 | const PACKAGE: &'static str = "envoy.extensions.filters.http.ext_proc.v3"; 143 | fn full_name() -> ::prost::alloc::string::String { 144 | "envoy.extensions.filters.http.ext_proc.v3.ProcessingMode".into() 145 | } 146 | fn type_url() -> ::prost::alloc::string::String { 147 | "type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ProcessingMode" 148 | .into() 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/generated/envoy.extensions.filters.http.router.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// \[#next-free-field: 10\] 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Router { 5 | /// Whether the router generates dynamic cluster statistics. Defaults to 6 | /// true. Can be disabled in high performance scenarios. 7 | #[prost(message, optional, tag = "1")] 8 | pub dynamic_stats: ::core::option::Option< 9 | super::super::super::super::super::super::google::protobuf::BoolValue, 10 | >, 11 | /// Whether to start a child span for egress routed calls. This can be 12 | /// useful in scenarios where other filters (auth, ratelimit, etc.) make 13 | /// outbound calls and have child spans rooted at the same ingress 14 | /// parent. Defaults to false. 15 | /// 16 | /// .. attention:: 17 | /// This field is deprecated by the 18 | /// :ref:`spawn_upstream_span `. 19 | /// Please use that ``spawn_upstream_span`` field to control the span creation. 20 | #[deprecated] 21 | #[prost(bool, tag = "2")] 22 | pub start_child_span: bool, 23 | /// Configuration for HTTP upstream logs emitted by the router. Upstream logs 24 | /// are configured in the same way as access logs, but each log entry represents 25 | /// an upstream request. Presuming retries are configured, multiple upstream 26 | /// requests may be made for each downstream (inbound) request. 27 | #[prost(message, repeated, tag = "3")] 28 | pub upstream_log: ::prost::alloc::vec::Vec< 29 | super::super::super::super::super::config::accesslog::v3::AccessLog, 30 | >, 31 | /// Additional upstream access log options. 32 | #[prost(message, optional, tag = "9")] 33 | pub upstream_log_options: ::core::option::Option, 34 | /// Do not add any additional ``x-envoy-`` headers to requests or responses. This 35 | /// only affects the :ref:`router filter generated x-envoy- headers 36 | /// `, other Envoy filters and the HTTP 37 | /// connection manager may continue to set ``x-envoy-`` headers. 38 | #[prost(bool, tag = "4")] 39 | pub suppress_envoy_headers: bool, 40 | /// Specifies a list of HTTP headers to strictly validate. Envoy will reject a 41 | /// request and respond with HTTP status 400 if the request contains an invalid 42 | /// value for any of the headers listed in this field. Strict header checking 43 | /// is only supported for the following headers: 44 | /// 45 | /// Value must be a ','-delimited list (i.e. no spaces) of supported retry 46 | /// policy values: 47 | /// 48 | /// * :ref:`config_http_filters_router_x-envoy-retry-grpc-on` 49 | /// * :ref:`config_http_filters_router_x-envoy-retry-on` 50 | /// 51 | /// Value must be an integer: 52 | /// 53 | /// * :ref:`config_http_filters_router_x-envoy-max-retries` 54 | /// * :ref:`config_http_filters_router_x-envoy-upstream-rq-timeout-ms` 55 | /// * :ref:`config_http_filters_router_x-envoy-upstream-rq-per-try-timeout-ms` 56 | #[prost(string, repeated, tag = "5")] 57 | pub strict_check_headers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 58 | /// If not set, ingress Envoy will ignore 59 | /// :ref:`config_http_filters_router_x-envoy-expected-rq-timeout-ms` header, populated by egress 60 | /// Envoy, when deriving timeout for upstream cluster. 61 | #[prost(bool, tag = "6")] 62 | pub respect_expected_rq_timeout: bool, 63 | /// If set, Envoy will avoid incrementing HTTP failure code stats 64 | /// on gRPC requests. This includes the individual status code value 65 | /// (e.g. upstream_rq_504) and group stats (e.g. upstream_rq_5xx). 66 | /// This field is useful if interested in relying only on the gRPC 67 | /// stats filter to define success and failure metrics for gRPC requests 68 | /// as not all failed gRPC requests charge HTTP status code metrics. See 69 | /// :ref:`gRPC stats filter` documentation 70 | /// for more details. 71 | #[prost(bool, tag = "7")] 72 | pub suppress_grpc_request_failure_code_stats: bool, 73 | /// .. note:: 74 | /// Upstream HTTP filters are currently in alpha. 75 | /// 76 | /// Optional HTTP filters for the upstream HTTP filter chain. 77 | /// 78 | /// These filters will be applied for all requests that pass through the router. 79 | /// They will also be applied to shadowed requests. 80 | /// Upstream HTTP filters cannot change route or cluster. 81 | /// Upstream HTTP filters specified on the cluster will override these filters. 82 | /// 83 | /// If using upstream HTTP filters, please be aware that local errors sent by 84 | /// upstream HTTP filters will not trigger retries, and local errors sent by 85 | /// upstream HTTP filters will count as a final response if hedging is configured. 86 | /// \[#extension-category: envoy.filters.http.upstream\] 87 | #[prost(message, repeated, tag = "8")] 88 | pub upstream_http_filters: ::prost::alloc::vec::Vec< 89 | super::super::super::network::http_connection_manager::v3::HttpFilter, 90 | >, 91 | } 92 | /// Nested message and enum types in `Router`. 93 | pub mod router { 94 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 95 | pub struct UpstreamAccessLogOptions { 96 | /// If set to true, an upstream access log will be recorded when an upstream stream is 97 | /// associated to an http request. Note: Each HTTP request received for an already established 98 | /// connection will result in an upstream access log record. This includes, for example, 99 | /// consecutive HTTP requests over the same connection or a request that is retried. 100 | /// In case a retry is applied, an upstream access log will be recorded for each retry. 101 | #[prost(bool, tag = "1")] 102 | pub flush_upstream_log_on_upstream_stream: bool, 103 | /// The interval to flush the upstream access logs. By default, the router will flush an upstream 104 | /// access log on stream close, when the HTTP request is complete. If this field is set, the router 105 | /// will flush access logs periodically at the specified interval. This is especially useful in the 106 | /// case of long-lived requests, such as CONNECT and Websockets. 107 | /// The interval must be at least 1 millisecond. 108 | #[prost(message, optional, tag = "2")] 109 | pub upstream_log_flush_interval: ::core::option::Option< 110 | super::super::super::super::super::super::super::google::protobuf::Duration, 111 | >, 112 | } 113 | impl ::prost::Name for UpstreamAccessLogOptions { 114 | const NAME: &'static str = "UpstreamAccessLogOptions"; 115 | const PACKAGE: &'static str = "envoy.extensions.filters.http.router.v3"; 116 | fn full_name() -> ::prost::alloc::string::String { 117 | "envoy.extensions.filters.http.router.v3.Router.UpstreamAccessLogOptions" 118 | .into() 119 | } 120 | fn type_url() -> ::prost::alloc::string::String { 121 | "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router.UpstreamAccessLogOptions" 122 | .into() 123 | } 124 | } 125 | } 126 | impl ::prost::Name for Router { 127 | const NAME: &'static str = "Router"; 128 | const PACKAGE: &'static str = "envoy.extensions.filters.http.router.v3"; 129 | fn full_name() -> ::prost::alloc::string::String { 130 | "envoy.extensions.filters.http.router.v3.Router".into() 131 | } 132 | fn type_url() -> ::prost::alloc::string::String { 133 | "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router".into() 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/generated/envoy.r#type.http.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Cookie defines an API for obtaining or generating HTTP cookie. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Cookie { 5 | /// The name that will be used to obtain cookie value from downstream HTTP request or generate 6 | /// new cookie for downstream. 7 | #[prost(string, tag = "1")] 8 | pub name: ::prost::alloc::string::String, 9 | /// Duration of cookie. This will be used to set the expiry time of a new cookie when it is 10 | /// generated. Set this to 0s to use a session cookie and disable cookie expiration. 11 | #[prost(message, optional, tag = "2")] 12 | pub ttl: ::core::option::Option< 13 | super::super::super::super::google::protobuf::Duration, 14 | >, 15 | /// Path of cookie. This will be used to set the path of a new cookie when it is generated. 16 | /// If no path is specified here, no path will be set for the cookie. 17 | #[prost(string, tag = "3")] 18 | pub path: ::prost::alloc::string::String, 19 | } 20 | impl ::prost::Name for Cookie { 21 | const NAME: &'static str = "Cookie"; 22 | const PACKAGE: &'static str = "envoy.type.http.v3"; 23 | fn full_name() -> ::prost::alloc::string::String { 24 | "envoy.type.http.v3.Cookie".into() 25 | } 26 | fn type_url() -> ::prost::alloc::string::String { 27 | "type.googleapis.com/envoy.type.http.v3.Cookie".into() 28 | } 29 | } 30 | #[derive(Clone, PartialEq, ::prost::Message)] 31 | pub struct PathTransformation { 32 | /// A list of operations to apply. Transformations will be performed in the order that they appear. 33 | #[prost(message, repeated, tag = "1")] 34 | pub operations: ::prost::alloc::vec::Vec, 35 | } 36 | /// Nested message and enum types in `PathTransformation`. 37 | pub mod path_transformation { 38 | /// A type of operation to alter text. 39 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 40 | pub struct Operation { 41 | #[prost(oneof = "operation::OperationSpecifier", tags = "2, 3")] 42 | pub operation_specifier: ::core::option::Option, 43 | } 44 | /// Nested message and enum types in `Operation`. 45 | pub mod operation { 46 | /// Should text be normalized according to RFC 3986? This typically is used for path headers 47 | /// before any processing of requests by HTTP filters or routing. This applies percent-encoded 48 | /// normalization and path segment normalization. Fails on characters disallowed in URLs 49 | /// (e.g. NULLs). See `Normalization and Comparison 50 | /// <`_> for details of normalization. Note that 51 | /// this options does not perform `case normalization 52 | /// <`_> 53 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 54 | pub struct NormalizePathRfc3986 {} 55 | impl ::prost::Name for NormalizePathRfc3986 { 56 | const NAME: &'static str = "NormalizePathRFC3986"; 57 | const PACKAGE: &'static str = "envoy.type.http.v3"; 58 | fn full_name() -> ::prost::alloc::string::String { 59 | "envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986" 60 | .into() 61 | } 62 | fn type_url() -> ::prost::alloc::string::String { 63 | "type.googleapis.com/envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986" 64 | .into() 65 | } 66 | } 67 | /// Determines if adjacent slashes are merged into one. A common use case is for a request path 68 | /// header. Using this option in ``:ref: PathNormalizationOptions 69 | /// `` 70 | /// will allow incoming requests with path ``//dir///file`` to match against route with ``prefix`` 71 | /// match set to ``/dir``. When using for header transformations, note that slash merging is not 72 | /// part of `HTTP spec <`_> and is provided for convenience. 73 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 74 | pub struct MergeSlashes {} 75 | impl ::prost::Name for MergeSlashes { 76 | const NAME: &'static str = "MergeSlashes"; 77 | const PACKAGE: &'static str = "envoy.type.http.v3"; 78 | fn full_name() -> ::prost::alloc::string::String { 79 | "envoy.type.http.v3.PathTransformation.Operation.MergeSlashes".into() 80 | } 81 | fn type_url() -> ::prost::alloc::string::String { 82 | "type.googleapis.com/envoy.type.http.v3.PathTransformation.Operation.MergeSlashes" 83 | .into() 84 | } 85 | } 86 | #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] 87 | pub enum OperationSpecifier { 88 | /// Enable path normalization per RFC 3986. 89 | #[prost(message, tag = "2")] 90 | NormalizePathRfc3986(NormalizePathRfc3986), 91 | /// Enable merging adjacent slashes. 92 | #[prost(message, tag = "3")] 93 | MergeSlashes(MergeSlashes), 94 | } 95 | } 96 | impl ::prost::Name for Operation { 97 | const NAME: &'static str = "Operation"; 98 | const PACKAGE: &'static str = "envoy.type.http.v3"; 99 | fn full_name() -> ::prost::alloc::string::String { 100 | "envoy.type.http.v3.PathTransformation.Operation".into() 101 | } 102 | fn type_url() -> ::prost::alloc::string::String { 103 | "type.googleapis.com/envoy.type.http.v3.PathTransformation.Operation".into() 104 | } 105 | } 106 | } 107 | impl ::prost::Name for PathTransformation { 108 | const NAME: &'static str = "PathTransformation"; 109 | const PACKAGE: &'static str = "envoy.type.http.v3"; 110 | fn full_name() -> ::prost::alloc::string::String { 111 | "envoy.type.http.v3.PathTransformation".into() 112 | } 113 | fn type_url() -> ::prost::alloc::string::String { 114 | "type.googleapis.com/envoy.type.http.v3.PathTransformation".into() 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/generated/envoy.r#type.metadata.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// MetadataKey provides a general interface using ``key`` and ``path`` to retrieve value from 3 | /// :ref:`Metadata `. 4 | /// 5 | /// For example, for the following Metadata: 6 | /// 7 | /// .. code-block:: yaml 8 | /// 9 | /// filter_metadata: 10 | /// envoy.xxx: 11 | /// prop: 12 | /// foo: bar 13 | /// xyz: 14 | /// hello: envoy 15 | /// 16 | /// The following MetadataKey will retrieve a string value "bar" from the Metadata. 17 | /// 18 | /// .. code-block:: yaml 19 | /// 20 | /// key: envoy.xxx 21 | /// path: 22 | /// - key: prop 23 | /// - key: foo 24 | /// 25 | #[derive(Clone, PartialEq, ::prost::Message)] 26 | pub struct MetadataKey { 27 | /// The key name of Metadata to retrieve the Struct from the metadata. 28 | /// Typically, it represents a builtin subsystem or custom extension. 29 | #[prost(string, tag = "1")] 30 | pub key: ::prost::alloc::string::String, 31 | /// The path to retrieve the Value from the Struct. It can be a prefix or a full path, 32 | /// e.g. ``\[prop, xyz\]`` for a struct or ``\[prop, foo\]`` for a string in the example, 33 | /// which depends on the particular scenario. 34 | /// 35 | /// Note: Due to that only the key type segment is supported, the path can not specify a list 36 | /// unless the list is the last segment. 37 | #[prost(message, repeated, tag = "2")] 38 | pub path: ::prost::alloc::vec::Vec, 39 | } 40 | /// Nested message and enum types in `MetadataKey`. 41 | pub mod metadata_key { 42 | /// Specifies the segment in a path to retrieve value from Metadata. 43 | /// Currently it is only supported to specify the key, i.e. field name, as one segment of a path. 44 | #[derive(Clone, PartialEq, ::prost::Message)] 45 | pub struct PathSegment { 46 | #[prost(oneof = "path_segment::Segment", tags = "1")] 47 | pub segment: ::core::option::Option, 48 | } 49 | /// Nested message and enum types in `PathSegment`. 50 | pub mod path_segment { 51 | #[derive(Clone, PartialEq, ::prost::Oneof)] 52 | pub enum Segment { 53 | /// If specified, use the key to retrieve the value in a Struct. 54 | #[prost(string, tag = "1")] 55 | Key(::prost::alloc::string::String), 56 | } 57 | } 58 | impl ::prost::Name for PathSegment { 59 | const NAME: &'static str = "PathSegment"; 60 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 61 | fn full_name() -> ::prost::alloc::string::String { 62 | "envoy.type.metadata.v3.MetadataKey.PathSegment".into() 63 | } 64 | fn type_url() -> ::prost::alloc::string::String { 65 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKey.PathSegment".into() 66 | } 67 | } 68 | } 69 | impl ::prost::Name for MetadataKey { 70 | const NAME: &'static str = "MetadataKey"; 71 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 72 | fn full_name() -> ::prost::alloc::string::String { 73 | "envoy.type.metadata.v3.MetadataKey".into() 74 | } 75 | fn type_url() -> ::prost::alloc::string::String { 76 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKey".into() 77 | } 78 | } 79 | /// Describes what kind of metadata. 80 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 81 | pub struct MetadataKind { 82 | #[prost(oneof = "metadata_kind::Kind", tags = "1, 2, 3, 4")] 83 | pub kind: ::core::option::Option, 84 | } 85 | /// Nested message and enum types in `MetadataKind`. 86 | pub mod metadata_kind { 87 | /// Represents dynamic metadata associated with the request. 88 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 89 | pub struct Request {} 90 | impl ::prost::Name for Request { 91 | const NAME: &'static str = "Request"; 92 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 93 | fn full_name() -> ::prost::alloc::string::String { 94 | "envoy.type.metadata.v3.MetadataKind.Request".into() 95 | } 96 | fn type_url() -> ::prost::alloc::string::String { 97 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKind.Request".into() 98 | } 99 | } 100 | /// Represents metadata from :ref:`the route`. 101 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 102 | pub struct Route {} 103 | impl ::prost::Name for Route { 104 | const NAME: &'static str = "Route"; 105 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 106 | fn full_name() -> ::prost::alloc::string::String { 107 | "envoy.type.metadata.v3.MetadataKind.Route".into() 108 | } 109 | fn type_url() -> ::prost::alloc::string::String { 110 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKind.Route".into() 111 | } 112 | } 113 | /// Represents metadata from :ref:`the upstream cluster`. 114 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 115 | pub struct Cluster {} 116 | impl ::prost::Name for Cluster { 117 | const NAME: &'static str = "Cluster"; 118 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 119 | fn full_name() -> ::prost::alloc::string::String { 120 | "envoy.type.metadata.v3.MetadataKind.Cluster".into() 121 | } 122 | fn type_url() -> ::prost::alloc::string::String { 123 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKind.Cluster".into() 124 | } 125 | } 126 | /// Represents metadata from :ref:`the upstream 127 | /// host`. 128 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 129 | pub struct Host {} 130 | impl ::prost::Name for Host { 131 | const NAME: &'static str = "Host"; 132 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 133 | fn full_name() -> ::prost::alloc::string::String { 134 | "envoy.type.metadata.v3.MetadataKind.Host".into() 135 | } 136 | fn type_url() -> ::prost::alloc::string::String { 137 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKind.Host".into() 138 | } 139 | } 140 | #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] 141 | pub enum Kind { 142 | /// Request kind of metadata. 143 | #[prost(message, tag = "1")] 144 | Request(Request), 145 | /// Route kind of metadata. 146 | #[prost(message, tag = "2")] 147 | Route(Route), 148 | /// Cluster kind of metadata. 149 | #[prost(message, tag = "3")] 150 | Cluster(Cluster), 151 | /// Host kind of metadata. 152 | #[prost(message, tag = "4")] 153 | Host(Host), 154 | } 155 | } 156 | impl ::prost::Name for MetadataKind { 157 | const NAME: &'static str = "MetadataKind"; 158 | const PACKAGE: &'static str = "envoy.type.metadata.v3"; 159 | fn full_name() -> ::prost::alloc::string::String { 160 | "envoy.type.metadata.v3.MetadataKind".into() 161 | } 162 | fn type_url() -> ::prost::alloc::string::String { 163 | "type.googleapis.com/envoy.type.metadata.v3.MetadataKind".into() 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/generated/envoy.r#type.tracing.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Describes custom tags for the active span. 3 | /// \[#next-free-field: 6\] 4 | #[derive(Clone, PartialEq, ::prost::Message)] 5 | pub struct CustomTag { 6 | /// Used to populate the tag name. 7 | #[prost(string, tag = "1")] 8 | pub tag: ::prost::alloc::string::String, 9 | /// Used to specify what kind of custom tag. 10 | #[prost(oneof = "custom_tag::Type", tags = "2, 3, 4, 5")] 11 | pub r#type: ::core::option::Option, 12 | } 13 | /// Nested message and enum types in `CustomTag`. 14 | pub mod custom_tag { 15 | /// Literal type custom tag with static value for the tag value. 16 | #[derive(Clone, PartialEq, ::prost::Message)] 17 | pub struct Literal { 18 | /// Static literal value to populate the tag value. 19 | #[prost(string, tag = "1")] 20 | pub value: ::prost::alloc::string::String, 21 | } 22 | impl ::prost::Name for Literal { 23 | const NAME: &'static str = "Literal"; 24 | const PACKAGE: &'static str = "envoy.type.tracing.v3"; 25 | fn full_name() -> ::prost::alloc::string::String { 26 | "envoy.type.tracing.v3.CustomTag.Literal".into() 27 | } 28 | fn type_url() -> ::prost::alloc::string::String { 29 | "type.googleapis.com/envoy.type.tracing.v3.CustomTag.Literal".into() 30 | } 31 | } 32 | /// Environment type custom tag with environment name and default value. 33 | #[derive(Clone, PartialEq, ::prost::Message)] 34 | pub struct Environment { 35 | /// Environment variable name to obtain the value to populate the tag value. 36 | #[prost(string, tag = "1")] 37 | pub name: ::prost::alloc::string::String, 38 | /// When the environment variable is not found, 39 | /// the tag value will be populated with this default value if specified, 40 | /// otherwise no tag will be populated. 41 | #[prost(string, tag = "2")] 42 | pub default_value: ::prost::alloc::string::String, 43 | } 44 | impl ::prost::Name for Environment { 45 | const NAME: &'static str = "Environment"; 46 | const PACKAGE: &'static str = "envoy.type.tracing.v3"; 47 | fn full_name() -> ::prost::alloc::string::String { 48 | "envoy.type.tracing.v3.CustomTag.Environment".into() 49 | } 50 | fn type_url() -> ::prost::alloc::string::String { 51 | "type.googleapis.com/envoy.type.tracing.v3.CustomTag.Environment".into() 52 | } 53 | } 54 | /// Header type custom tag with header name and default value. 55 | #[derive(Clone, PartialEq, ::prost::Message)] 56 | pub struct Header { 57 | /// Header name to obtain the value to populate the tag value. 58 | #[prost(string, tag = "1")] 59 | pub name: ::prost::alloc::string::String, 60 | /// When the header does not exist, 61 | /// the tag value will be populated with this default value if specified, 62 | /// otherwise no tag will be populated. 63 | #[prost(string, tag = "2")] 64 | pub default_value: ::prost::alloc::string::String, 65 | } 66 | impl ::prost::Name for Header { 67 | const NAME: &'static str = "Header"; 68 | const PACKAGE: &'static str = "envoy.type.tracing.v3"; 69 | fn full_name() -> ::prost::alloc::string::String { 70 | "envoy.type.tracing.v3.CustomTag.Header".into() 71 | } 72 | fn type_url() -> ::prost::alloc::string::String { 73 | "type.googleapis.com/envoy.type.tracing.v3.CustomTag.Header".into() 74 | } 75 | } 76 | /// Metadata type custom tag using 77 | /// :ref:`MetadataKey ` to retrieve the protobuf value 78 | /// from :ref:`Metadata `, and populate the tag value with 79 | /// `the canonical JSON <`_> 80 | /// representation of it. 81 | #[derive(Clone, PartialEq, ::prost::Message)] 82 | pub struct Metadata { 83 | /// Specify what kind of metadata to obtain tag value from. 84 | #[prost(message, optional, tag = "1")] 85 | pub kind: ::core::option::Option< 86 | super::super::super::metadata::v3::MetadataKind, 87 | >, 88 | /// Metadata key to define the path to retrieve the tag value. 89 | #[prost(message, optional, tag = "2")] 90 | pub metadata_key: ::core::option::Option< 91 | super::super::super::metadata::v3::MetadataKey, 92 | >, 93 | /// When no valid metadata is found, 94 | /// the tag value would be populated with this default value if specified, 95 | /// otherwise no tag would be populated. 96 | #[prost(string, tag = "3")] 97 | pub default_value: ::prost::alloc::string::String, 98 | } 99 | impl ::prost::Name for Metadata { 100 | const NAME: &'static str = "Metadata"; 101 | const PACKAGE: &'static str = "envoy.type.tracing.v3"; 102 | fn full_name() -> ::prost::alloc::string::String { 103 | "envoy.type.tracing.v3.CustomTag.Metadata".into() 104 | } 105 | fn type_url() -> ::prost::alloc::string::String { 106 | "type.googleapis.com/envoy.type.tracing.v3.CustomTag.Metadata".into() 107 | } 108 | } 109 | /// Used to specify what kind of custom tag. 110 | #[derive(Clone, PartialEq, ::prost::Oneof)] 111 | pub enum Type { 112 | /// A literal custom tag. 113 | #[prost(message, tag = "2")] 114 | Literal(Literal), 115 | /// An environment custom tag. 116 | #[prost(message, tag = "3")] 117 | Environment(Environment), 118 | /// A request header custom tag. 119 | #[prost(message, tag = "4")] 120 | RequestHeader(Header), 121 | /// A custom tag to obtain tag value from the metadata. 122 | #[prost(message, tag = "5")] 123 | Metadata(Metadata), 124 | } 125 | } 126 | impl ::prost::Name for CustomTag { 127 | const NAME: &'static str = "CustomTag"; 128 | const PACKAGE: &'static str = "envoy.type.tracing.v3"; 129 | fn full_name() -> ::prost::alloc::string::String { 130 | "envoy.type.tracing.v3.CustomTag".into() 131 | } 132 | fn type_url() -> ::prost::alloc::string::String { 133 | "type.googleapis.com/envoy.type.tracing.v3.CustomTag".into() 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/generated/envoy.service.cluster.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for CdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.cluster.v3.CdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for CdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = CdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.cluster.v3.CdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(CdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.cluster.v3.CdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/generated/envoy.service.endpoint.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for EdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.endpoint.v3.EdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for EdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = EdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.endpoint.v3.EdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(EdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.endpoint.v3.EdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | impl serde::Serialize for LedsDummy { 73 | #[allow(deprecated)] 74 | fn serialize(&self, serializer: S) -> std::result::Result 75 | where 76 | S: serde::Serializer, 77 | { 78 | use serde::ser::SerializeStruct; 79 | let len = 0; 80 | let struct_ser = serializer.serialize_struct("envoy.service.endpoint.v3.LedsDummy", len)?; 81 | struct_ser.end() 82 | } 83 | } 84 | impl<'de> serde::Deserialize<'de> for LedsDummy { 85 | #[allow(deprecated)] 86 | fn deserialize(deserializer: D) -> std::result::Result 87 | where 88 | D: serde::Deserializer<'de>, 89 | { 90 | const FIELDS: &[&str] = &[ 91 | ]; 92 | 93 | #[allow(clippy::enum_variant_names)] 94 | enum GeneratedField { 95 | } 96 | impl<'de> serde::Deserialize<'de> for GeneratedField { 97 | fn deserialize(deserializer: D) -> std::result::Result 98 | where 99 | D: serde::Deserializer<'de>, 100 | { 101 | struct GeneratedVisitor; 102 | 103 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 104 | type Value = GeneratedField; 105 | 106 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 107 | write!(formatter, "expected one of: {:?}", &FIELDS) 108 | } 109 | 110 | #[allow(unused_variables)] 111 | fn visit_str(self, value: &str) -> std::result::Result 112 | where 113 | E: serde::de::Error, 114 | { 115 | Err(serde::de::Error::unknown_field(value, FIELDS)) 116 | } 117 | } 118 | deserializer.deserialize_identifier(GeneratedVisitor) 119 | } 120 | } 121 | struct GeneratedVisitor; 122 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 123 | type Value = LedsDummy; 124 | 125 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 126 | formatter.write_str("struct envoy.service.endpoint.v3.LedsDummy") 127 | } 128 | 129 | fn visit_map(self, mut map_: V) -> std::result::Result 130 | where 131 | V: serde::de::MapAccess<'de>, 132 | { 133 | while map_.next_key::()?.is_some() { 134 | let _ = map_.next_value::()?; 135 | } 136 | Ok(LedsDummy { 137 | }) 138 | } 139 | } 140 | deserializer.deserialize_struct("envoy.service.endpoint.v3.LedsDummy", FIELDS, GeneratedVisitor) 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/generated/envoy.service.event_reporting.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for StreamEventsRequest { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.identifier.is_some() { 10 | len += 1; 11 | } 12 | if !self.events.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.service.event_reporting.v3.StreamEventsRequest", len)?; 16 | if let Some(v) = self.identifier.as_ref() { 17 | struct_ser.serialize_field("identifier", v)?; 18 | } 19 | if !self.events.is_empty() { 20 | struct_ser.serialize_field("events", &self.events)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for StreamEventsRequest { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "identifier", 33 | "events", 34 | ]; 35 | 36 | #[allow(clippy::enum_variant_names)] 37 | enum GeneratedField { 38 | Identifier, 39 | Events, 40 | } 41 | impl<'de> serde::Deserialize<'de> for GeneratedField { 42 | fn deserialize(deserializer: D) -> std::result::Result 43 | where 44 | D: serde::Deserializer<'de>, 45 | { 46 | struct GeneratedVisitor; 47 | 48 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 49 | type Value = GeneratedField; 50 | 51 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 52 | write!(formatter, "expected one of: {:?}", &FIELDS) 53 | } 54 | 55 | #[allow(unused_variables)] 56 | fn visit_str(self, value: &str) -> std::result::Result 57 | where 58 | E: serde::de::Error, 59 | { 60 | match value { 61 | "identifier" => Ok(GeneratedField::Identifier), 62 | "events" => Ok(GeneratedField::Events), 63 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 64 | } 65 | } 66 | } 67 | deserializer.deserialize_identifier(GeneratedVisitor) 68 | } 69 | } 70 | struct GeneratedVisitor; 71 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 72 | type Value = StreamEventsRequest; 73 | 74 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 75 | formatter.write_str("struct envoy.service.event_reporting.v3.StreamEventsRequest") 76 | } 77 | 78 | fn visit_map(self, mut map_: V) -> std::result::Result 79 | where 80 | V: serde::de::MapAccess<'de>, 81 | { 82 | let mut identifier__ = None; 83 | let mut events__ = None; 84 | while let Some(k) = map_.next_key()? { 85 | match k { 86 | GeneratedField::Identifier => { 87 | if identifier__.is_some() { 88 | return Err(serde::de::Error::duplicate_field("identifier")); 89 | } 90 | identifier__ = map_.next_value()?; 91 | } 92 | GeneratedField::Events => { 93 | if events__.is_some() { 94 | return Err(serde::de::Error::duplicate_field("events")); 95 | } 96 | events__ = Some(map_.next_value()?); 97 | } 98 | } 99 | } 100 | Ok(StreamEventsRequest { 101 | identifier: identifier__, 102 | events: events__.unwrap_or_default(), 103 | }) 104 | } 105 | } 106 | deserializer.deserialize_struct("envoy.service.event_reporting.v3.StreamEventsRequest", FIELDS, GeneratedVisitor) 107 | } 108 | } 109 | impl serde::Serialize for stream_events_request::Identifier { 110 | #[allow(deprecated)] 111 | fn serialize(&self, serializer: S) -> std::result::Result 112 | where 113 | S: serde::Serializer, 114 | { 115 | use serde::ser::SerializeStruct; 116 | let mut len = 0; 117 | if self.node.is_some() { 118 | len += 1; 119 | } 120 | let mut struct_ser = serializer.serialize_struct("envoy.service.event_reporting.v3.StreamEventsRequest.Identifier", len)?; 121 | if let Some(v) = self.node.as_ref() { 122 | struct_ser.serialize_field("node", v)?; 123 | } 124 | struct_ser.end() 125 | } 126 | } 127 | impl<'de> serde::Deserialize<'de> for stream_events_request::Identifier { 128 | #[allow(deprecated)] 129 | fn deserialize(deserializer: D) -> std::result::Result 130 | where 131 | D: serde::Deserializer<'de>, 132 | { 133 | const FIELDS: &[&str] = &[ 134 | "node", 135 | ]; 136 | 137 | #[allow(clippy::enum_variant_names)] 138 | enum GeneratedField { 139 | Node, 140 | } 141 | impl<'de> serde::Deserialize<'de> for GeneratedField { 142 | fn deserialize(deserializer: D) -> std::result::Result 143 | where 144 | D: serde::Deserializer<'de>, 145 | { 146 | struct GeneratedVisitor; 147 | 148 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 149 | type Value = GeneratedField; 150 | 151 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 152 | write!(formatter, "expected one of: {:?}", &FIELDS) 153 | } 154 | 155 | #[allow(unused_variables)] 156 | fn visit_str(self, value: &str) -> std::result::Result 157 | where 158 | E: serde::de::Error, 159 | { 160 | match value { 161 | "node" => Ok(GeneratedField::Node), 162 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 163 | } 164 | } 165 | } 166 | deserializer.deserialize_identifier(GeneratedVisitor) 167 | } 168 | } 169 | struct GeneratedVisitor; 170 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 171 | type Value = stream_events_request::Identifier; 172 | 173 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 174 | formatter.write_str("struct envoy.service.event_reporting.v3.StreamEventsRequest.Identifier") 175 | } 176 | 177 | fn visit_map(self, mut map_: V) -> std::result::Result 178 | where 179 | V: serde::de::MapAccess<'de>, 180 | { 181 | let mut node__ = None; 182 | while let Some(k) = map_.next_key()? { 183 | match k { 184 | GeneratedField::Node => { 185 | if node__.is_some() { 186 | return Err(serde::de::Error::duplicate_field("node")); 187 | } 188 | node__ = map_.next_value()?; 189 | } 190 | } 191 | } 192 | Ok(stream_events_request::Identifier { 193 | node: node__, 194 | }) 195 | } 196 | } 197 | deserializer.deserialize_struct("envoy.service.event_reporting.v3.StreamEventsRequest.Identifier", FIELDS, GeneratedVisitor) 198 | } 199 | } 200 | impl serde::Serialize for StreamEventsResponse { 201 | #[allow(deprecated)] 202 | fn serialize(&self, serializer: S) -> std::result::Result 203 | where 204 | S: serde::Serializer, 205 | { 206 | use serde::ser::SerializeStruct; 207 | let len = 0; 208 | let struct_ser = serializer.serialize_struct("envoy.service.event_reporting.v3.StreamEventsResponse", len)?; 209 | struct_ser.end() 210 | } 211 | } 212 | impl<'de> serde::Deserialize<'de> for StreamEventsResponse { 213 | #[allow(deprecated)] 214 | fn deserialize(deserializer: D) -> std::result::Result 215 | where 216 | D: serde::Deserializer<'de>, 217 | { 218 | const FIELDS: &[&str] = &[ 219 | ]; 220 | 221 | #[allow(clippy::enum_variant_names)] 222 | enum GeneratedField { 223 | } 224 | impl<'de> serde::Deserialize<'de> for GeneratedField { 225 | fn deserialize(deserializer: D) -> std::result::Result 226 | where 227 | D: serde::Deserializer<'de>, 228 | { 229 | struct GeneratedVisitor; 230 | 231 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 232 | type Value = GeneratedField; 233 | 234 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 235 | write!(formatter, "expected one of: {:?}", &FIELDS) 236 | } 237 | 238 | #[allow(unused_variables)] 239 | fn visit_str(self, value: &str) -> std::result::Result 240 | where 241 | E: serde::de::Error, 242 | { 243 | Err(serde::de::Error::unknown_field(value, FIELDS)) 244 | } 245 | } 246 | deserializer.deserialize_identifier(GeneratedVisitor) 247 | } 248 | } 249 | struct GeneratedVisitor; 250 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 251 | type Value = StreamEventsResponse; 252 | 253 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 254 | formatter.write_str("struct envoy.service.event_reporting.v3.StreamEventsResponse") 255 | } 256 | 257 | fn visit_map(self, mut map_: V) -> std::result::Result 258 | where 259 | V: serde::de::MapAccess<'de>, 260 | { 261 | while map_.next_key::()?.is_some() { 262 | let _ = map_.next_value::()?; 263 | } 264 | Ok(StreamEventsResponse { 265 | }) 266 | } 267 | } 268 | deserializer.deserialize_struct("envoy.service.event_reporting.v3.StreamEventsResponse", FIELDS, GeneratedVisitor) 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /src/generated/envoy.service.extension.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for EcdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.extension.v3.EcdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for EcdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = EcdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.extension.v3.EcdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(EcdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.extension.v3.EcdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/generated/envoy.service.listener.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for LdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.listener.v3.LdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for LdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = LdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.listener.v3.LdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(LdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.listener.v3.LdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/generated/envoy.service.load_stats.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for LoadStatsRequest { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.node.is_some() { 10 | len += 1; 11 | } 12 | if !self.cluster_stats.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.service.load_stats.v3.LoadStatsRequest", len)?; 16 | if let Some(v) = self.node.as_ref() { 17 | struct_ser.serialize_field("node", v)?; 18 | } 19 | if !self.cluster_stats.is_empty() { 20 | struct_ser.serialize_field("cluster_stats", &self.cluster_stats)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for LoadStatsRequest { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "node", 33 | "cluster_stats", 34 | "clusterStats", 35 | ]; 36 | 37 | #[allow(clippy::enum_variant_names)] 38 | enum GeneratedField { 39 | Node, 40 | ClusterStats, 41 | } 42 | impl<'de> serde::Deserialize<'de> for GeneratedField { 43 | fn deserialize(deserializer: D) -> std::result::Result 44 | where 45 | D: serde::Deserializer<'de>, 46 | { 47 | struct GeneratedVisitor; 48 | 49 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 50 | type Value = GeneratedField; 51 | 52 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 53 | write!(formatter, "expected one of: {:?}", &FIELDS) 54 | } 55 | 56 | #[allow(unused_variables)] 57 | fn visit_str(self, value: &str) -> std::result::Result 58 | where 59 | E: serde::de::Error, 60 | { 61 | match value { 62 | "node" => Ok(GeneratedField::Node), 63 | "clusterStats" | "cluster_stats" => Ok(GeneratedField::ClusterStats), 64 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 65 | } 66 | } 67 | } 68 | deserializer.deserialize_identifier(GeneratedVisitor) 69 | } 70 | } 71 | struct GeneratedVisitor; 72 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 73 | type Value = LoadStatsRequest; 74 | 75 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 76 | formatter.write_str("struct envoy.service.load_stats.v3.LoadStatsRequest") 77 | } 78 | 79 | fn visit_map(self, mut map_: V) -> std::result::Result 80 | where 81 | V: serde::de::MapAccess<'de>, 82 | { 83 | let mut node__ = None; 84 | let mut cluster_stats__ = None; 85 | while let Some(k) = map_.next_key()? { 86 | match k { 87 | GeneratedField::Node => { 88 | if node__.is_some() { 89 | return Err(serde::de::Error::duplicate_field("node")); 90 | } 91 | node__ = map_.next_value()?; 92 | } 93 | GeneratedField::ClusterStats => { 94 | if cluster_stats__.is_some() { 95 | return Err(serde::de::Error::duplicate_field("clusterStats")); 96 | } 97 | cluster_stats__ = Some(map_.next_value()?); 98 | } 99 | } 100 | } 101 | Ok(LoadStatsRequest { 102 | node: node__, 103 | cluster_stats: cluster_stats__.unwrap_or_default(), 104 | }) 105 | } 106 | } 107 | deserializer.deserialize_struct("envoy.service.load_stats.v3.LoadStatsRequest", FIELDS, GeneratedVisitor) 108 | } 109 | } 110 | impl serde::Serialize for LoadStatsResponse { 111 | #[allow(deprecated)] 112 | fn serialize(&self, serializer: S) -> std::result::Result 113 | where 114 | S: serde::Serializer, 115 | { 116 | use serde::ser::SerializeStruct; 117 | let mut len = 0; 118 | if !self.clusters.is_empty() { 119 | len += 1; 120 | } 121 | if self.send_all_clusters { 122 | len += 1; 123 | } 124 | if self.load_reporting_interval.is_some() { 125 | len += 1; 126 | } 127 | if self.report_endpoint_granularity { 128 | len += 1; 129 | } 130 | let mut struct_ser = serializer.serialize_struct("envoy.service.load_stats.v3.LoadStatsResponse", len)?; 131 | if !self.clusters.is_empty() { 132 | struct_ser.serialize_field("clusters", &self.clusters)?; 133 | } 134 | if self.send_all_clusters { 135 | struct_ser.serialize_field("send_all_clusters", &self.send_all_clusters)?; 136 | } 137 | if let Some(v) = self.load_reporting_interval.as_ref() { 138 | struct_ser.serialize_field("load_reporting_interval", v)?; 139 | } 140 | if self.report_endpoint_granularity { 141 | struct_ser.serialize_field("report_endpoint_granularity", &self.report_endpoint_granularity)?; 142 | } 143 | struct_ser.end() 144 | } 145 | } 146 | impl<'de> serde::Deserialize<'de> for LoadStatsResponse { 147 | #[allow(deprecated)] 148 | fn deserialize(deserializer: D) -> std::result::Result 149 | where 150 | D: serde::Deserializer<'de>, 151 | { 152 | const FIELDS: &[&str] = &[ 153 | "clusters", 154 | "send_all_clusters", 155 | "sendAllClusters", 156 | "load_reporting_interval", 157 | "loadReportingInterval", 158 | "report_endpoint_granularity", 159 | "reportEndpointGranularity", 160 | ]; 161 | 162 | #[allow(clippy::enum_variant_names)] 163 | enum GeneratedField { 164 | Clusters, 165 | SendAllClusters, 166 | LoadReportingInterval, 167 | ReportEndpointGranularity, 168 | } 169 | impl<'de> serde::Deserialize<'de> for GeneratedField { 170 | fn deserialize(deserializer: D) -> std::result::Result 171 | where 172 | D: serde::Deserializer<'de>, 173 | { 174 | struct GeneratedVisitor; 175 | 176 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 177 | type Value = GeneratedField; 178 | 179 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 180 | write!(formatter, "expected one of: {:?}", &FIELDS) 181 | } 182 | 183 | #[allow(unused_variables)] 184 | fn visit_str(self, value: &str) -> std::result::Result 185 | where 186 | E: serde::de::Error, 187 | { 188 | match value { 189 | "clusters" => Ok(GeneratedField::Clusters), 190 | "sendAllClusters" | "send_all_clusters" => Ok(GeneratedField::SendAllClusters), 191 | "loadReportingInterval" | "load_reporting_interval" => Ok(GeneratedField::LoadReportingInterval), 192 | "reportEndpointGranularity" | "report_endpoint_granularity" => Ok(GeneratedField::ReportEndpointGranularity), 193 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 194 | } 195 | } 196 | } 197 | deserializer.deserialize_identifier(GeneratedVisitor) 198 | } 199 | } 200 | struct GeneratedVisitor; 201 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 202 | type Value = LoadStatsResponse; 203 | 204 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 205 | formatter.write_str("struct envoy.service.load_stats.v3.LoadStatsResponse") 206 | } 207 | 208 | fn visit_map(self, mut map_: V) -> std::result::Result 209 | where 210 | V: serde::de::MapAccess<'de>, 211 | { 212 | let mut clusters__ = None; 213 | let mut send_all_clusters__ = None; 214 | let mut load_reporting_interval__ = None; 215 | let mut report_endpoint_granularity__ = None; 216 | while let Some(k) = map_.next_key()? { 217 | match k { 218 | GeneratedField::Clusters => { 219 | if clusters__.is_some() { 220 | return Err(serde::de::Error::duplicate_field("clusters")); 221 | } 222 | clusters__ = Some(map_.next_value()?); 223 | } 224 | GeneratedField::SendAllClusters => { 225 | if send_all_clusters__.is_some() { 226 | return Err(serde::de::Error::duplicate_field("sendAllClusters")); 227 | } 228 | send_all_clusters__ = Some(map_.next_value()?); 229 | } 230 | GeneratedField::LoadReportingInterval => { 231 | if load_reporting_interval__.is_some() { 232 | return Err(serde::de::Error::duplicate_field("loadReportingInterval")); 233 | } 234 | load_reporting_interval__ = map_.next_value()?; 235 | } 236 | GeneratedField::ReportEndpointGranularity => { 237 | if report_endpoint_granularity__.is_some() { 238 | return Err(serde::de::Error::duplicate_field("reportEndpointGranularity")); 239 | } 240 | report_endpoint_granularity__ = Some(map_.next_value()?); 241 | } 242 | } 243 | } 244 | Ok(LoadStatsResponse { 245 | clusters: clusters__.unwrap_or_default(), 246 | send_all_clusters: send_all_clusters__.unwrap_or_default(), 247 | load_reporting_interval: load_reporting_interval__, 248 | report_endpoint_granularity: report_endpoint_granularity__.unwrap_or_default(), 249 | }) 250 | } 251 | } 252 | deserializer.deserialize_struct("envoy.service.load_stats.v3.LoadStatsResponse", FIELDS, GeneratedVisitor) 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /src/generated/envoy.service.metrics.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for StreamMetricsMessage { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.identifier.is_some() { 10 | len += 1; 11 | } 12 | if !self.envoy_metrics.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.service.metrics.v3.StreamMetricsMessage", len)?; 16 | if let Some(v) = self.identifier.as_ref() { 17 | struct_ser.serialize_field("identifier", v)?; 18 | } 19 | if !self.envoy_metrics.is_empty() { 20 | struct_ser.serialize_field("envoy_metrics", &self.envoy_metrics)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for StreamMetricsMessage { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "identifier", 33 | "envoy_metrics", 34 | "envoyMetrics", 35 | ]; 36 | 37 | #[allow(clippy::enum_variant_names)] 38 | enum GeneratedField { 39 | Identifier, 40 | EnvoyMetrics, 41 | } 42 | impl<'de> serde::Deserialize<'de> for GeneratedField { 43 | fn deserialize(deserializer: D) -> std::result::Result 44 | where 45 | D: serde::Deserializer<'de>, 46 | { 47 | struct GeneratedVisitor; 48 | 49 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 50 | type Value = GeneratedField; 51 | 52 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 53 | write!(formatter, "expected one of: {:?}", &FIELDS) 54 | } 55 | 56 | #[allow(unused_variables)] 57 | fn visit_str(self, value: &str) -> std::result::Result 58 | where 59 | E: serde::de::Error, 60 | { 61 | match value { 62 | "identifier" => Ok(GeneratedField::Identifier), 63 | "envoyMetrics" | "envoy_metrics" => Ok(GeneratedField::EnvoyMetrics), 64 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 65 | } 66 | } 67 | } 68 | deserializer.deserialize_identifier(GeneratedVisitor) 69 | } 70 | } 71 | struct GeneratedVisitor; 72 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 73 | type Value = StreamMetricsMessage; 74 | 75 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 76 | formatter.write_str("struct envoy.service.metrics.v3.StreamMetricsMessage") 77 | } 78 | 79 | fn visit_map(self, mut map_: V) -> std::result::Result 80 | where 81 | V: serde::de::MapAccess<'de>, 82 | { 83 | let mut identifier__ = None; 84 | let mut envoy_metrics__ = None; 85 | while let Some(k) = map_.next_key()? { 86 | match k { 87 | GeneratedField::Identifier => { 88 | if identifier__.is_some() { 89 | return Err(serde::de::Error::duplicate_field("identifier")); 90 | } 91 | identifier__ = map_.next_value()?; 92 | } 93 | GeneratedField::EnvoyMetrics => { 94 | if envoy_metrics__.is_some() { 95 | return Err(serde::de::Error::duplicate_field("envoyMetrics")); 96 | } 97 | envoy_metrics__ = Some(map_.next_value()?); 98 | } 99 | } 100 | } 101 | Ok(StreamMetricsMessage { 102 | identifier: identifier__, 103 | envoy_metrics: envoy_metrics__.unwrap_or_default(), 104 | }) 105 | } 106 | } 107 | deserializer.deserialize_struct("envoy.service.metrics.v3.StreamMetricsMessage", FIELDS, GeneratedVisitor) 108 | } 109 | } 110 | impl serde::Serialize for stream_metrics_message::Identifier { 111 | #[allow(deprecated)] 112 | fn serialize(&self, serializer: S) -> std::result::Result 113 | where 114 | S: serde::Serializer, 115 | { 116 | use serde::ser::SerializeStruct; 117 | let mut len = 0; 118 | if self.node.is_some() { 119 | len += 1; 120 | } 121 | let mut struct_ser = serializer.serialize_struct("envoy.service.metrics.v3.StreamMetricsMessage.Identifier", len)?; 122 | if let Some(v) = self.node.as_ref() { 123 | struct_ser.serialize_field("node", v)?; 124 | } 125 | struct_ser.end() 126 | } 127 | } 128 | impl<'de> serde::Deserialize<'de> for stream_metrics_message::Identifier { 129 | #[allow(deprecated)] 130 | fn deserialize(deserializer: D) -> std::result::Result 131 | where 132 | D: serde::Deserializer<'de>, 133 | { 134 | const FIELDS: &[&str] = &[ 135 | "node", 136 | ]; 137 | 138 | #[allow(clippy::enum_variant_names)] 139 | enum GeneratedField { 140 | Node, 141 | } 142 | impl<'de> serde::Deserialize<'de> for GeneratedField { 143 | fn deserialize(deserializer: D) -> std::result::Result 144 | where 145 | D: serde::Deserializer<'de>, 146 | { 147 | struct GeneratedVisitor; 148 | 149 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 150 | type Value = GeneratedField; 151 | 152 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 153 | write!(formatter, "expected one of: {:?}", &FIELDS) 154 | } 155 | 156 | #[allow(unused_variables)] 157 | fn visit_str(self, value: &str) -> std::result::Result 158 | where 159 | E: serde::de::Error, 160 | { 161 | match value { 162 | "node" => Ok(GeneratedField::Node), 163 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 164 | } 165 | } 166 | } 167 | deserializer.deserialize_identifier(GeneratedVisitor) 168 | } 169 | } 170 | struct GeneratedVisitor; 171 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 172 | type Value = stream_metrics_message::Identifier; 173 | 174 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 175 | formatter.write_str("struct envoy.service.metrics.v3.StreamMetricsMessage.Identifier") 176 | } 177 | 178 | fn visit_map(self, mut map_: V) -> std::result::Result 179 | where 180 | V: serde::de::MapAccess<'de>, 181 | { 182 | let mut node__ = None; 183 | while let Some(k) = map_.next_key()? { 184 | match k { 185 | GeneratedField::Node => { 186 | if node__.is_some() { 187 | return Err(serde::de::Error::duplicate_field("node")); 188 | } 189 | node__ = map_.next_value()?; 190 | } 191 | } 192 | } 193 | Ok(stream_metrics_message::Identifier { 194 | node: node__, 195 | }) 196 | } 197 | } 198 | deserializer.deserialize_struct("envoy.service.metrics.v3.StreamMetricsMessage.Identifier", FIELDS, GeneratedVisitor) 199 | } 200 | } 201 | impl serde::Serialize for StreamMetricsResponse { 202 | #[allow(deprecated)] 203 | fn serialize(&self, serializer: S) -> std::result::Result 204 | where 205 | S: serde::Serializer, 206 | { 207 | use serde::ser::SerializeStruct; 208 | let len = 0; 209 | let struct_ser = serializer.serialize_struct("envoy.service.metrics.v3.StreamMetricsResponse", len)?; 210 | struct_ser.end() 211 | } 212 | } 213 | impl<'de> serde::Deserialize<'de> for StreamMetricsResponse { 214 | #[allow(deprecated)] 215 | fn deserialize(deserializer: D) -> std::result::Result 216 | where 217 | D: serde::Deserializer<'de>, 218 | { 219 | const FIELDS: &[&str] = &[ 220 | ]; 221 | 222 | #[allow(clippy::enum_variant_names)] 223 | enum GeneratedField { 224 | } 225 | impl<'de> serde::Deserialize<'de> for GeneratedField { 226 | fn deserialize(deserializer: D) -> std::result::Result 227 | where 228 | D: serde::Deserializer<'de>, 229 | { 230 | struct GeneratedVisitor; 231 | 232 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 233 | type Value = GeneratedField; 234 | 235 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 236 | write!(formatter, "expected one of: {:?}", &FIELDS) 237 | } 238 | 239 | #[allow(unused_variables)] 240 | fn visit_str(self, value: &str) -> std::result::Result 241 | where 242 | E: serde::de::Error, 243 | { 244 | Err(serde::de::Error::unknown_field(value, FIELDS)) 245 | } 246 | } 247 | deserializer.deserialize_identifier(GeneratedVisitor) 248 | } 249 | } 250 | struct GeneratedVisitor; 251 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 252 | type Value = StreamMetricsResponse; 253 | 254 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 255 | formatter.write_str("struct envoy.service.metrics.v3.StreamMetricsResponse") 256 | } 257 | 258 | fn visit_map(self, mut map_: V) -> std::result::Result 259 | where 260 | V: serde::de::MapAccess<'de>, 261 | { 262 | while map_.next_key::()?.is_some() { 263 | let _ = map_.next_value::()?; 264 | } 265 | Ok(StreamMetricsResponse { 266 | }) 267 | } 268 | } 269 | deserializer.deserialize_struct("envoy.service.metrics.v3.StreamMetricsResponse", FIELDS, GeneratedVisitor) 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /src/generated/envoy.service.route.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for RdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.route.v3.RdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for RdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = RdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.route.v3.RdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(RdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.route.v3.RdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | impl serde::Serialize for SrdsDummy { 73 | #[allow(deprecated)] 74 | fn serialize(&self, serializer: S) -> std::result::Result 75 | where 76 | S: serde::Serializer, 77 | { 78 | use serde::ser::SerializeStruct; 79 | let len = 0; 80 | let struct_ser = serializer.serialize_struct("envoy.service.route.v3.SrdsDummy", len)?; 81 | struct_ser.end() 82 | } 83 | } 84 | impl<'de> serde::Deserialize<'de> for SrdsDummy { 85 | #[allow(deprecated)] 86 | fn deserialize(deserializer: D) -> std::result::Result 87 | where 88 | D: serde::Deserializer<'de>, 89 | { 90 | const FIELDS: &[&str] = &[ 91 | ]; 92 | 93 | #[allow(clippy::enum_variant_names)] 94 | enum GeneratedField { 95 | } 96 | impl<'de> serde::Deserialize<'de> for GeneratedField { 97 | fn deserialize(deserializer: D) -> std::result::Result 98 | where 99 | D: serde::Deserializer<'de>, 100 | { 101 | struct GeneratedVisitor; 102 | 103 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 104 | type Value = GeneratedField; 105 | 106 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 107 | write!(formatter, "expected one of: {:?}", &FIELDS) 108 | } 109 | 110 | #[allow(unused_variables)] 111 | fn visit_str(self, value: &str) -> std::result::Result 112 | where 113 | E: serde::de::Error, 114 | { 115 | Err(serde::de::Error::unknown_field(value, FIELDS)) 116 | } 117 | } 118 | deserializer.deserialize_identifier(GeneratedVisitor) 119 | } 120 | } 121 | struct GeneratedVisitor; 122 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 123 | type Value = SrdsDummy; 124 | 125 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 126 | formatter.write_str("struct envoy.service.route.v3.SrdsDummy") 127 | } 128 | 129 | fn visit_map(self, mut map_: V) -> std::result::Result 130 | where 131 | V: serde::de::MapAccess<'de>, 132 | { 133 | while map_.next_key::()?.is_some() { 134 | let _ = map_.next_value::()?; 135 | } 136 | Ok(SrdsDummy { 137 | }) 138 | } 139 | } 140 | deserializer.deserialize_struct("envoy.service.route.v3.SrdsDummy", FIELDS, GeneratedVisitor) 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/generated/envoy.service.runtime.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for RtdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.runtime.v3.RtdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for RtdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = RtdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.runtime.v3.RtdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(RtdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.runtime.v3.RtdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | impl serde::Serialize for Runtime { 73 | #[allow(deprecated)] 74 | fn serialize(&self, serializer: S) -> std::result::Result 75 | where 76 | S: serde::Serializer, 77 | { 78 | use serde::ser::SerializeStruct; 79 | let mut len = 0; 80 | if !self.name.is_empty() { 81 | len += 1; 82 | } 83 | if self.layer.is_some() { 84 | len += 1; 85 | } 86 | let mut struct_ser = serializer.serialize_struct("envoy.service.runtime.v3.Runtime", len)?; 87 | if !self.name.is_empty() { 88 | struct_ser.serialize_field("name", &self.name)?; 89 | } 90 | if let Some(v) = self.layer.as_ref() { 91 | struct_ser.serialize_field("layer", v)?; 92 | } 93 | struct_ser.end() 94 | } 95 | } 96 | impl<'de> serde::Deserialize<'de> for Runtime { 97 | #[allow(deprecated)] 98 | fn deserialize(deserializer: D) -> std::result::Result 99 | where 100 | D: serde::Deserializer<'de>, 101 | { 102 | const FIELDS: &[&str] = &[ 103 | "name", 104 | "layer", 105 | ]; 106 | 107 | #[allow(clippy::enum_variant_names)] 108 | enum GeneratedField { 109 | Name, 110 | Layer, 111 | } 112 | impl<'de> serde::Deserialize<'de> for GeneratedField { 113 | fn deserialize(deserializer: D) -> std::result::Result 114 | where 115 | D: serde::Deserializer<'de>, 116 | { 117 | struct GeneratedVisitor; 118 | 119 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 120 | type Value = GeneratedField; 121 | 122 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 123 | write!(formatter, "expected one of: {:?}", &FIELDS) 124 | } 125 | 126 | #[allow(unused_variables)] 127 | fn visit_str(self, value: &str) -> std::result::Result 128 | where 129 | E: serde::de::Error, 130 | { 131 | match value { 132 | "name" => Ok(GeneratedField::Name), 133 | "layer" => Ok(GeneratedField::Layer), 134 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 135 | } 136 | } 137 | } 138 | deserializer.deserialize_identifier(GeneratedVisitor) 139 | } 140 | } 141 | struct GeneratedVisitor; 142 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 143 | type Value = Runtime; 144 | 145 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 146 | formatter.write_str("struct envoy.service.runtime.v3.Runtime") 147 | } 148 | 149 | fn visit_map(self, mut map_: V) -> std::result::Result 150 | where 151 | V: serde::de::MapAccess<'de>, 152 | { 153 | let mut name__ = None; 154 | let mut layer__ = None; 155 | while let Some(k) = map_.next_key()? { 156 | match k { 157 | GeneratedField::Name => { 158 | if name__.is_some() { 159 | return Err(serde::de::Error::duplicate_field("name")); 160 | } 161 | name__ = Some(map_.next_value()?); 162 | } 163 | GeneratedField::Layer => { 164 | if layer__.is_some() { 165 | return Err(serde::de::Error::duplicate_field("layer")); 166 | } 167 | layer__ = map_.next_value()?; 168 | } 169 | } 170 | } 171 | Ok(Runtime { 172 | name: name__.unwrap_or_default(), 173 | layer: layer__, 174 | }) 175 | } 176 | } 177 | deserializer.deserialize_struct("envoy.service.runtime.v3.Runtime", FIELDS, GeneratedVisitor) 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/generated/envoy.service.secret.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for SdsDummy { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let len = 0; 9 | let struct_ser = serializer.serialize_struct("envoy.service.secret.v3.SdsDummy", len)?; 10 | struct_ser.end() 11 | } 12 | } 13 | impl<'de> serde::Deserialize<'de> for SdsDummy { 14 | #[allow(deprecated)] 15 | fn deserialize(deserializer: D) -> std::result::Result 16 | where 17 | D: serde::Deserializer<'de>, 18 | { 19 | const FIELDS: &[&str] = &[ 20 | ]; 21 | 22 | #[allow(clippy::enum_variant_names)] 23 | enum GeneratedField { 24 | } 25 | impl<'de> serde::Deserialize<'de> for GeneratedField { 26 | fn deserialize(deserializer: D) -> std::result::Result 27 | where 28 | D: serde::Deserializer<'de>, 29 | { 30 | struct GeneratedVisitor; 31 | 32 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 33 | type Value = GeneratedField; 34 | 35 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 36 | write!(formatter, "expected one of: {:?}", &FIELDS) 37 | } 38 | 39 | #[allow(unused_variables)] 40 | fn visit_str(self, value: &str) -> std::result::Result 41 | where 42 | E: serde::de::Error, 43 | { 44 | Err(serde::de::Error::unknown_field(value, FIELDS)) 45 | } 46 | } 47 | deserializer.deserialize_identifier(GeneratedVisitor) 48 | } 49 | } 50 | struct GeneratedVisitor; 51 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 52 | type Value = SdsDummy; 53 | 54 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 | formatter.write_str("struct envoy.service.secret.v3.SdsDummy") 56 | } 57 | 58 | fn visit_map(self, mut map_: V) -> std::result::Result 59 | where 60 | V: serde::de::MapAccess<'de>, 61 | { 62 | while map_.next_key::()?.is_some() { 63 | let _ = map_.next_value::()?; 64 | } 65 | Ok(SdsDummy { 66 | }) 67 | } 68 | } 69 | deserializer.deserialize_struct("envoy.service.secret.v3.SdsDummy", FIELDS, GeneratedVisitor) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/generated/envoy.service.trace.v3.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for StreamTracesMessage { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.identifier.is_some() { 10 | len += 1; 11 | } 12 | if !self.spans.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesMessage", len)?; 16 | if let Some(v) = self.identifier.as_ref() { 17 | struct_ser.serialize_field("identifier", v)?; 18 | } 19 | if !self.spans.is_empty() { 20 | struct_ser.serialize_field("spans", &self.spans)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for StreamTracesMessage { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "identifier", 33 | "spans", 34 | ]; 35 | 36 | #[allow(clippy::enum_variant_names)] 37 | enum GeneratedField { 38 | Identifier, 39 | Spans, 40 | } 41 | impl<'de> serde::Deserialize<'de> for GeneratedField { 42 | fn deserialize(deserializer: D) -> std::result::Result 43 | where 44 | D: serde::Deserializer<'de>, 45 | { 46 | struct GeneratedVisitor; 47 | 48 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 49 | type Value = GeneratedField; 50 | 51 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 52 | write!(formatter, "expected one of: {:?}", &FIELDS) 53 | } 54 | 55 | #[allow(unused_variables)] 56 | fn visit_str(self, value: &str) -> std::result::Result 57 | where 58 | E: serde::de::Error, 59 | { 60 | match value { 61 | "identifier" => Ok(GeneratedField::Identifier), 62 | "spans" => Ok(GeneratedField::Spans), 63 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 64 | } 65 | } 66 | } 67 | deserializer.deserialize_identifier(GeneratedVisitor) 68 | } 69 | } 70 | struct GeneratedVisitor; 71 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 72 | type Value = StreamTracesMessage; 73 | 74 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 75 | formatter.write_str("struct envoy.service.trace.v3.StreamTracesMessage") 76 | } 77 | 78 | fn visit_map(self, mut map_: V) -> std::result::Result 79 | where 80 | V: serde::de::MapAccess<'de>, 81 | { 82 | let mut identifier__ = None; 83 | let mut spans__ = None; 84 | while let Some(k) = map_.next_key()? { 85 | match k { 86 | GeneratedField::Identifier => { 87 | if identifier__.is_some() { 88 | return Err(serde::de::Error::duplicate_field("identifier")); 89 | } 90 | identifier__ = map_.next_value()?; 91 | } 92 | GeneratedField::Spans => { 93 | if spans__.is_some() { 94 | return Err(serde::de::Error::duplicate_field("spans")); 95 | } 96 | spans__ = Some(map_.next_value()?); 97 | } 98 | } 99 | } 100 | Ok(StreamTracesMessage { 101 | identifier: identifier__, 102 | spans: spans__.unwrap_or_default(), 103 | }) 104 | } 105 | } 106 | deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesMessage", FIELDS, GeneratedVisitor) 107 | } 108 | } 109 | impl serde::Serialize for stream_traces_message::Identifier { 110 | #[allow(deprecated)] 111 | fn serialize(&self, serializer: S) -> std::result::Result 112 | where 113 | S: serde::Serializer, 114 | { 115 | use serde::ser::SerializeStruct; 116 | let mut len = 0; 117 | if self.node.is_some() { 118 | len += 1; 119 | } 120 | let mut struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesMessage.Identifier", len)?; 121 | if let Some(v) = self.node.as_ref() { 122 | struct_ser.serialize_field("node", v)?; 123 | } 124 | struct_ser.end() 125 | } 126 | } 127 | impl<'de> serde::Deserialize<'de> for stream_traces_message::Identifier { 128 | #[allow(deprecated)] 129 | fn deserialize(deserializer: D) -> std::result::Result 130 | where 131 | D: serde::Deserializer<'de>, 132 | { 133 | const FIELDS: &[&str] = &[ 134 | "node", 135 | ]; 136 | 137 | #[allow(clippy::enum_variant_names)] 138 | enum GeneratedField { 139 | Node, 140 | } 141 | impl<'de> serde::Deserialize<'de> for GeneratedField { 142 | fn deserialize(deserializer: D) -> std::result::Result 143 | where 144 | D: serde::Deserializer<'de>, 145 | { 146 | struct GeneratedVisitor; 147 | 148 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 149 | type Value = GeneratedField; 150 | 151 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 152 | write!(formatter, "expected one of: {:?}", &FIELDS) 153 | } 154 | 155 | #[allow(unused_variables)] 156 | fn visit_str(self, value: &str) -> std::result::Result 157 | where 158 | E: serde::de::Error, 159 | { 160 | match value { 161 | "node" => Ok(GeneratedField::Node), 162 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 163 | } 164 | } 165 | } 166 | deserializer.deserialize_identifier(GeneratedVisitor) 167 | } 168 | } 169 | struct GeneratedVisitor; 170 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 171 | type Value = stream_traces_message::Identifier; 172 | 173 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 174 | formatter.write_str("struct envoy.service.trace.v3.StreamTracesMessage.Identifier") 175 | } 176 | 177 | fn visit_map(self, mut map_: V) -> std::result::Result 178 | where 179 | V: serde::de::MapAccess<'de>, 180 | { 181 | let mut node__ = None; 182 | while let Some(k) = map_.next_key()? { 183 | match k { 184 | GeneratedField::Node => { 185 | if node__.is_some() { 186 | return Err(serde::de::Error::duplicate_field("node")); 187 | } 188 | node__ = map_.next_value()?; 189 | } 190 | } 191 | } 192 | Ok(stream_traces_message::Identifier { 193 | node: node__, 194 | }) 195 | } 196 | } 197 | deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesMessage.Identifier", FIELDS, GeneratedVisitor) 198 | } 199 | } 200 | impl serde::Serialize for StreamTracesResponse { 201 | #[allow(deprecated)] 202 | fn serialize(&self, serializer: S) -> std::result::Result 203 | where 204 | S: serde::Serializer, 205 | { 206 | use serde::ser::SerializeStruct; 207 | let len = 0; 208 | let struct_ser = serializer.serialize_struct("envoy.service.trace.v3.StreamTracesResponse", len)?; 209 | struct_ser.end() 210 | } 211 | } 212 | impl<'de> serde::Deserialize<'de> for StreamTracesResponse { 213 | #[allow(deprecated)] 214 | fn deserialize(deserializer: D) -> std::result::Result 215 | where 216 | D: serde::Deserializer<'de>, 217 | { 218 | const FIELDS: &[&str] = &[ 219 | ]; 220 | 221 | #[allow(clippy::enum_variant_names)] 222 | enum GeneratedField { 223 | } 224 | impl<'de> serde::Deserialize<'de> for GeneratedField { 225 | fn deserialize(deserializer: D) -> std::result::Result 226 | where 227 | D: serde::Deserializer<'de>, 228 | { 229 | struct GeneratedVisitor; 230 | 231 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 232 | type Value = GeneratedField; 233 | 234 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 235 | write!(formatter, "expected one of: {:?}", &FIELDS) 236 | } 237 | 238 | #[allow(unused_variables)] 239 | fn visit_str(self, value: &str) -> std::result::Result 240 | where 241 | E: serde::de::Error, 242 | { 243 | Err(serde::de::Error::unknown_field(value, FIELDS)) 244 | } 245 | } 246 | deserializer.deserialize_identifier(GeneratedVisitor) 247 | } 248 | } 249 | struct GeneratedVisitor; 250 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 251 | type Value = StreamTracesResponse; 252 | 253 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 254 | formatter.write_str("struct envoy.service.trace.v3.StreamTracesResponse") 255 | } 256 | 257 | fn visit_map(self, mut map_: V) -> std::result::Result 258 | where 259 | V: serde::de::MapAccess<'de>, 260 | { 261 | while map_.next_key::()?.is_some() { 262 | let _ = map_.next_value::()?; 263 | } 264 | Ok(StreamTracesResponse { 265 | }) 266 | } 267 | } 268 | deserializer.deserialize_struct("envoy.service.trace.v3.StreamTracesResponse", FIELDS, GeneratedVisitor) 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /src/generated/google.rpc.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// The `Status` type defines a logical error model that is suitable for 3 | /// different programming environments, including REST APIs and RPC APIs. It is 4 | /// used by [gRPC](). Each `Status` message contains 5 | /// three pieces of data: error code, error message, and error details. 6 | /// 7 | /// You can find out more about this error model and how to work with it in the 8 | /// [API Design Guide](). 9 | #[derive(Clone, PartialEq, ::prost::Message)] 10 | pub struct Status { 11 | /// The status code, which should be an enum value of 12 | /// [google.rpc.Code][google.rpc.Code]. 13 | #[prost(int32, tag = "1")] 14 | pub code: i32, 15 | /// A developer-facing error message, which should be in English. Any 16 | /// user-facing error message should be localized and sent in the 17 | /// [google.rpc.Status.details][google.rpc.Status.details] field, or localized 18 | /// by the client. 19 | #[prost(string, tag = "2")] 20 | pub message: ::prost::alloc::string::String, 21 | /// A list of messages that carry the error details. There is a common set of 22 | /// message types for APIs to use. 23 | #[prost(message, repeated, tag = "3")] 24 | pub details: ::prost::alloc::vec::Vec, 25 | } 26 | impl ::prost::Name for Status { 27 | const NAME: &'static str = "Status"; 28 | const PACKAGE: &'static str = "google.rpc"; 29 | fn full_name() -> ::prost::alloc::string::String { 30 | "google.rpc.Status".into() 31 | } 32 | fn type_url() -> ::prost::alloc::string::String { 33 | "/google.rpc.Status".into() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/generated/google.rpc.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for Status { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if self.code != 0 { 10 | len += 1; 11 | } 12 | if !self.message.is_empty() { 13 | len += 1; 14 | } 15 | if !self.details.is_empty() { 16 | len += 1; 17 | } 18 | let mut struct_ser = serializer.serialize_struct("google.rpc.Status", len)?; 19 | if self.code != 0 { 20 | struct_ser.serialize_field("code", &self.code)?; 21 | } 22 | if !self.message.is_empty() { 23 | struct_ser.serialize_field("message", &self.message)?; 24 | } 25 | if !self.details.is_empty() { 26 | struct_ser.serialize_field("details", &self.details)?; 27 | } 28 | struct_ser.end() 29 | } 30 | } 31 | impl<'de> serde::Deserialize<'de> for Status { 32 | #[allow(deprecated)] 33 | fn deserialize(deserializer: D) -> std::result::Result 34 | where 35 | D: serde::Deserializer<'de>, 36 | { 37 | const FIELDS: &[&str] = &[ 38 | "code", 39 | "message", 40 | "details", 41 | ]; 42 | 43 | #[allow(clippy::enum_variant_names)] 44 | enum GeneratedField { 45 | Code, 46 | Message, 47 | Details, 48 | } 49 | impl<'de> serde::Deserialize<'de> for GeneratedField { 50 | fn deserialize(deserializer: D) -> std::result::Result 51 | where 52 | D: serde::Deserializer<'de>, 53 | { 54 | struct GeneratedVisitor; 55 | 56 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 57 | type Value = GeneratedField; 58 | 59 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 60 | write!(formatter, "expected one of: {:?}", &FIELDS) 61 | } 62 | 63 | #[allow(unused_variables)] 64 | fn visit_str(self, value: &str) -> std::result::Result 65 | where 66 | E: serde::de::Error, 67 | { 68 | match value { 69 | "code" => Ok(GeneratedField::Code), 70 | "message" => Ok(GeneratedField::Message), 71 | "details" => Ok(GeneratedField::Details), 72 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 73 | } 74 | } 75 | } 76 | deserializer.deserialize_identifier(GeneratedVisitor) 77 | } 78 | } 79 | struct GeneratedVisitor; 80 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 81 | type Value = Status; 82 | 83 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 84 | formatter.write_str("struct google.rpc.Status") 85 | } 86 | 87 | fn visit_map(self, mut map_: V) -> std::result::Result 88 | where 89 | V: serde::de::MapAccess<'de>, 90 | { 91 | let mut code__ = None; 92 | let mut message__ = None; 93 | let mut details__ = None; 94 | while let Some(k) = map_.next_key()? { 95 | match k { 96 | GeneratedField::Code => { 97 | if code__.is_some() { 98 | return Err(serde::de::Error::duplicate_field("code")); 99 | } 100 | code__ = 101 | Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) 102 | ; 103 | } 104 | GeneratedField::Message => { 105 | if message__.is_some() { 106 | return Err(serde::de::Error::duplicate_field("message")); 107 | } 108 | message__ = Some(map_.next_value()?); 109 | } 110 | GeneratedField::Details => { 111 | if details__.is_some() { 112 | return Err(serde::de::Error::duplicate_field("details")); 113 | } 114 | details__ = Some(map_.next_value()?); 115 | } 116 | } 117 | } 118 | Ok(Status { 119 | code: code__.unwrap_or_default(), 120 | message: message__.unwrap_or_default(), 121 | details: details__.unwrap_or_default(), 122 | }) 123 | } 124 | } 125 | deserializer.deserialize_struct("google.rpc.Status", FIELDS, GeneratedVisitor) 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/generated/opencensus.proto.resource.v1.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | /// Resource information. 3 | #[derive(Clone, PartialEq, ::prost::Message)] 4 | pub struct Resource { 5 | /// Type identifier for the resource. 6 | #[prost(string, tag = "1")] 7 | pub r#type: ::prost::alloc::string::String, 8 | /// Set of labels that describe the resource. 9 | #[prost(map = "string, string", tag = "2")] 10 | pub labels: ::std::collections::HashMap< 11 | ::prost::alloc::string::String, 12 | ::prost::alloc::string::String, 13 | >, 14 | } 15 | impl ::prost::Name for Resource { 16 | const NAME: &'static str = "Resource"; 17 | const PACKAGE: &'static str = "opencensus.proto.resource.v1"; 18 | fn full_name() -> ::prost::alloc::string::String { 19 | "opencensus.proto.resource.v1.Resource".into() 20 | } 21 | fn type_url() -> ::prost::alloc::string::String { 22 | "/opencensus.proto.resource.v1.Resource".into() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/generated/opencensus.proto.resource.v1.serde.rs: -------------------------------------------------------------------------------- 1 | impl serde::Serialize for Resource { 2 | #[allow(deprecated)] 3 | fn serialize(&self, serializer: S) -> std::result::Result 4 | where 5 | S: serde::Serializer, 6 | { 7 | use serde::ser::SerializeStruct; 8 | let mut len = 0; 9 | if !self.r#type.is_empty() { 10 | len += 1; 11 | } 12 | if !self.labels.is_empty() { 13 | len += 1; 14 | } 15 | let mut struct_ser = serializer.serialize_struct("opencensus.proto.resource.v1.Resource", len)?; 16 | if !self.r#type.is_empty() { 17 | struct_ser.serialize_field("type", &self.r#type)?; 18 | } 19 | if !self.labels.is_empty() { 20 | struct_ser.serialize_field("labels", &self.labels)?; 21 | } 22 | struct_ser.end() 23 | } 24 | } 25 | impl<'de> serde::Deserialize<'de> for Resource { 26 | #[allow(deprecated)] 27 | fn deserialize(deserializer: D) -> std::result::Result 28 | where 29 | D: serde::Deserializer<'de>, 30 | { 31 | const FIELDS: &[&str] = &[ 32 | "type", 33 | "labels", 34 | ]; 35 | 36 | #[allow(clippy::enum_variant_names)] 37 | enum GeneratedField { 38 | Type, 39 | Labels, 40 | } 41 | impl<'de> serde::Deserialize<'de> for GeneratedField { 42 | fn deserialize(deserializer: D) -> std::result::Result 43 | where 44 | D: serde::Deserializer<'de>, 45 | { 46 | struct GeneratedVisitor; 47 | 48 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 49 | type Value = GeneratedField; 50 | 51 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 52 | write!(formatter, "expected one of: {:?}", &FIELDS) 53 | } 54 | 55 | #[allow(unused_variables)] 56 | fn visit_str(self, value: &str) -> std::result::Result 57 | where 58 | E: serde::de::Error, 59 | { 60 | match value { 61 | "type" => Ok(GeneratedField::Type), 62 | "labels" => Ok(GeneratedField::Labels), 63 | _ => Err(serde::de::Error::unknown_field(value, FIELDS)), 64 | } 65 | } 66 | } 67 | deserializer.deserialize_identifier(GeneratedVisitor) 68 | } 69 | } 70 | struct GeneratedVisitor; 71 | impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { 72 | type Value = Resource; 73 | 74 | fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 75 | formatter.write_str("struct opencensus.proto.resource.v1.Resource") 76 | } 77 | 78 | fn visit_map(self, mut map_: V) -> std::result::Result 79 | where 80 | V: serde::de::MapAccess<'de>, 81 | { 82 | let mut r#type__ = None; 83 | let mut labels__ = None; 84 | while let Some(k) = map_.next_key()? { 85 | match k { 86 | GeneratedField::Type => { 87 | if r#type__.is_some() { 88 | return Err(serde::de::Error::duplicate_field("type")); 89 | } 90 | r#type__ = Some(map_.next_value()?); 91 | } 92 | GeneratedField::Labels => { 93 | if labels__.is_some() { 94 | return Err(serde::de::Error::duplicate_field("labels")); 95 | } 96 | labels__ = Some( 97 | map_.next_value::>()? 98 | ); 99 | } 100 | } 101 | } 102 | Ok(Resource { 103 | r#type: r#type__.unwrap_or_default(), 104 | labels: labels__.unwrap_or_default(), 105 | }) 106 | } 107 | } 108 | deserializer.deserialize_struct("opencensus.proto.resource.v1.Resource", FIELDS, GeneratedVisitor) 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/generated/udpa.annotations.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3 | pub struct StatusAnnotation { 4 | /// The entity is work-in-progress and subject to breaking changes. 5 | #[prost(bool, tag = "1")] 6 | pub work_in_progress: bool, 7 | /// The entity belongs to a package with the given version status. 8 | #[prost(enumeration = "PackageVersionStatus", tag = "2")] 9 | pub package_version_status: i32, 10 | } 11 | impl ::prost::Name for StatusAnnotation { 12 | const NAME: &'static str = "StatusAnnotation"; 13 | const PACKAGE: &'static str = "udpa.annotations"; 14 | fn full_name() -> ::prost::alloc::string::String { 15 | "udpa.annotations.StatusAnnotation".into() 16 | } 17 | fn type_url() -> ::prost::alloc::string::String { 18 | "/udpa.annotations.StatusAnnotation".into() 19 | } 20 | } 21 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] 22 | #[repr(i32)] 23 | pub enum PackageVersionStatus { 24 | /// Unknown package version status. 25 | Unknown = 0, 26 | /// This version of the package is frozen. 27 | Frozen = 1, 28 | /// This version of the package is the active development version. 29 | Active = 2, 30 | /// This version of the package is the candidate for the next major version. It 31 | /// is typically machine generated from the active development version. 32 | NextMajorVersionCandidate = 3, 33 | } 34 | impl PackageVersionStatus { 35 | /// String value of the enum field names used in the ProtoBuf definition. 36 | /// 37 | /// The values are not transformed in any way and thus are considered stable 38 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 39 | pub fn as_str_name(&self) -> &'static str { 40 | match self { 41 | Self::Unknown => "UNKNOWN", 42 | Self::Frozen => "FROZEN", 43 | Self::Active => "ACTIVE", 44 | Self::NextMajorVersionCandidate => "NEXT_MAJOR_VERSION_CANDIDATE", 45 | } 46 | } 47 | /// Creates an enum from field names used in the ProtoBuf definition. 48 | pub fn from_str_name(value: &str) -> ::core::option::Option { 49 | match value { 50 | "UNKNOWN" => Some(Self::Unknown), 51 | "FROZEN" => Some(Self::Frozen), 52 | "ACTIVE" => Some(Self::Active), 53 | "NEXT_MAJOR_VERSION_CANDIDATE" => Some(Self::NextMajorVersionCandidate), 54 | _ => None, 55 | } 56 | } 57 | } 58 | #[derive(Clone, PartialEq, ::prost::Message)] 59 | pub struct VersioningAnnotation { 60 | /// Track the previous message type. E.g. this message might be 61 | /// udpa.foo.v3alpha.Foo and it was previously udpa.bar.v2.Bar. This 62 | /// information is consumed by UDPA via proto descriptors. 63 | #[prost(string, tag = "1")] 64 | pub previous_message_type: ::prost::alloc::string::String, 65 | } 66 | impl ::prost::Name for VersioningAnnotation { 67 | const NAME: &'static str = "VersioningAnnotation"; 68 | const PACKAGE: &'static str = "udpa.annotations"; 69 | fn full_name() -> ::prost::alloc::string::String { 70 | "udpa.annotations.VersioningAnnotation".into() 71 | } 72 | fn type_url() -> ::prost::alloc::string::String { 73 | "/udpa.annotations.VersioningAnnotation".into() 74 | } 75 | } 76 | #[derive(Clone, PartialEq, ::prost::Message)] 77 | pub struct MigrateAnnotation { 78 | /// Rename the message/enum/enum value in next version. 79 | #[prost(string, tag = "1")] 80 | pub rename: ::prost::alloc::string::String, 81 | } 82 | impl ::prost::Name for MigrateAnnotation { 83 | const NAME: &'static str = "MigrateAnnotation"; 84 | const PACKAGE: &'static str = "udpa.annotations"; 85 | fn full_name() -> ::prost::alloc::string::String { 86 | "udpa.annotations.MigrateAnnotation".into() 87 | } 88 | fn type_url() -> ::prost::alloc::string::String { 89 | "/udpa.annotations.MigrateAnnotation".into() 90 | } 91 | } 92 | #[derive(Clone, PartialEq, ::prost::Message)] 93 | pub struct FieldMigrateAnnotation { 94 | /// Rename the field in next version. 95 | #[prost(string, tag = "1")] 96 | pub rename: ::prost::alloc::string::String, 97 | /// Add the field to a named oneof in next version. If this already exists, the 98 | /// field will join its siblings under the oneof, otherwise a new oneof will be 99 | /// created with the given name. 100 | #[prost(string, tag = "2")] 101 | pub oneof_promotion: ::prost::alloc::string::String, 102 | } 103 | impl ::prost::Name for FieldMigrateAnnotation { 104 | const NAME: &'static str = "FieldMigrateAnnotation"; 105 | const PACKAGE: &'static str = "udpa.annotations"; 106 | fn full_name() -> ::prost::alloc::string::String { 107 | "udpa.annotations.FieldMigrateAnnotation".into() 108 | } 109 | fn type_url() -> ::prost::alloc::string::String { 110 | "/udpa.annotations.FieldMigrateAnnotation".into() 111 | } 112 | } 113 | #[derive(Clone, PartialEq, ::prost::Message)] 114 | pub struct FileMigrateAnnotation { 115 | /// Move all types in the file to another package, this implies changing proto 116 | /// file path. 117 | #[prost(string, tag = "2")] 118 | pub move_to_package: ::prost::alloc::string::String, 119 | } 120 | impl ::prost::Name for FileMigrateAnnotation { 121 | const NAME: &'static str = "FileMigrateAnnotation"; 122 | const PACKAGE: &'static str = "udpa.annotations"; 123 | fn full_name() -> ::prost::alloc::string::String { 124 | "udpa.annotations.FileMigrateAnnotation".into() 125 | } 126 | fn type_url() -> ::prost::alloc::string::String { 127 | "/udpa.annotations.FileMigrateAnnotation".into() 128 | } 129 | } 130 | /// These annotations indicate metadata for the purpose of understanding the 131 | /// security significance of fields. 132 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 133 | pub struct FieldSecurityAnnotation { 134 | /// Field should be set in the presence of untrusted downstreams. 135 | #[prost(bool, tag = "1")] 136 | pub configure_for_untrusted_downstream: bool, 137 | /// Field should be set in the presence of untrusted upstreams. 138 | #[prost(bool, tag = "2")] 139 | pub configure_for_untrusted_upstream: bool, 140 | } 141 | impl ::prost::Name for FieldSecurityAnnotation { 142 | const NAME: &'static str = "FieldSecurityAnnotation"; 143 | const PACKAGE: &'static str = "udpa.annotations"; 144 | fn full_name() -> ::prost::alloc::string::String { 145 | "udpa.annotations.FieldSecurityAnnotation".into() 146 | } 147 | fn type_url() -> ::prost::alloc::string::String { 148 | "/udpa.annotations.FieldSecurityAnnotation".into() 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/generated/xds.annotations.v3.rs: -------------------------------------------------------------------------------- 1 | // This file is @generated by prost-build. 2 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3 | pub struct FileStatusAnnotation { 4 | /// The entity is work-in-progress and subject to breaking changes. 5 | #[prost(bool, tag = "1")] 6 | pub work_in_progress: bool, 7 | } 8 | impl ::prost::Name for FileStatusAnnotation { 9 | const NAME: &'static str = "FileStatusAnnotation"; 10 | const PACKAGE: &'static str = "xds.annotations.v3"; 11 | fn full_name() -> ::prost::alloc::string::String { 12 | "xds.annotations.v3.FileStatusAnnotation".into() 13 | } 14 | fn type_url() -> ::prost::alloc::string::String { 15 | "/xds.annotations.v3.FileStatusAnnotation".into() 16 | } 17 | } 18 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 19 | pub struct MessageStatusAnnotation { 20 | /// The entity is work-in-progress and subject to breaking changes. 21 | #[prost(bool, tag = "1")] 22 | pub work_in_progress: bool, 23 | } 24 | impl ::prost::Name for MessageStatusAnnotation { 25 | const NAME: &'static str = "MessageStatusAnnotation"; 26 | const PACKAGE: &'static str = "xds.annotations.v3"; 27 | fn full_name() -> ::prost::alloc::string::String { 28 | "xds.annotations.v3.MessageStatusAnnotation".into() 29 | } 30 | fn type_url() -> ::prost::alloc::string::String { 31 | "/xds.annotations.v3.MessageStatusAnnotation".into() 32 | } 33 | } 34 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 35 | pub struct FieldStatusAnnotation { 36 | /// The entity is work-in-progress and subject to breaking changes. 37 | #[prost(bool, tag = "1")] 38 | pub work_in_progress: bool, 39 | } 40 | impl ::prost::Name for FieldStatusAnnotation { 41 | const NAME: &'static str = "FieldStatusAnnotation"; 42 | const PACKAGE: &'static str = "xds.annotations.v3"; 43 | fn full_name() -> ::prost::alloc::string::String { 44 | "xds.annotations.v3.FieldStatusAnnotation".into() 45 | } 46 | fn type_url() -> ::prost::alloc::string::String { 47 | "/xds.annotations.v3.FieldStatusAnnotation".into() 48 | } 49 | } 50 | #[derive(Clone, Copy, PartialEq, ::prost::Message)] 51 | pub struct StatusAnnotation { 52 | /// The entity is work-in-progress and subject to breaking changes. 53 | #[prost(bool, tag = "1")] 54 | pub work_in_progress: bool, 55 | /// The entity belongs to a package with the given version status. 56 | #[prost(enumeration = "PackageVersionStatus", tag = "2")] 57 | pub package_version_status: i32, 58 | } 59 | impl ::prost::Name for StatusAnnotation { 60 | const NAME: &'static str = "StatusAnnotation"; 61 | const PACKAGE: &'static str = "xds.annotations.v3"; 62 | fn full_name() -> ::prost::alloc::string::String { 63 | "xds.annotations.v3.StatusAnnotation".into() 64 | } 65 | fn type_url() -> ::prost::alloc::string::String { 66 | "/xds.annotations.v3.StatusAnnotation".into() 67 | } 68 | } 69 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] 70 | #[repr(i32)] 71 | pub enum PackageVersionStatus { 72 | /// Unknown package version status. 73 | Unknown = 0, 74 | /// This version of the package is frozen. 75 | Frozen = 1, 76 | /// This version of the package is the active development version. 77 | Active = 2, 78 | /// This version of the package is the candidate for the next major version. It 79 | /// is typically machine generated from the active development version. 80 | NextMajorVersionCandidate = 3, 81 | } 82 | impl PackageVersionStatus { 83 | /// String value of the enum field names used in the ProtoBuf definition. 84 | /// 85 | /// The values are not transformed in any way and thus are considered stable 86 | /// (if the ProtoBuf definition does not change) and safe for programmatic use. 87 | pub fn as_str_name(&self) -> &'static str { 88 | match self { 89 | Self::Unknown => "UNKNOWN", 90 | Self::Frozen => "FROZEN", 91 | Self::Active => "ACTIVE", 92 | Self::NextMajorVersionCandidate => "NEXT_MAJOR_VERSION_CANDIDATE", 93 | } 94 | } 95 | /// Creates an enum from field names used in the ProtoBuf definition. 96 | pub fn from_str_name(value: &str) -> ::core::option::Option { 97 | match value { 98 | "UNKNOWN" => Some(Self::Unknown), 99 | "FROZEN" => Some(Self::Frozen), 100 | "ACTIVE" => Some(Self::Active), 101 | "NEXT_MAJOR_VERSION_CANDIDATE" => Some(Self::NextMajorVersionCandidate), 102 | _ => None, 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::doc_lazy_continuation)] 2 | #![doc = include_str!("../README.md")] 3 | 4 | mod any; 5 | 6 | #[allow(clippy::all, clippy::pedantic, clippy::nursery)] 7 | mod generated; 8 | 9 | pub mod pb { 10 | pub use crate::generated::*; 11 | } 12 | 13 | pub use any::WellKnownTypes; 14 | 15 | mod value; 16 | 17 | /// A serialized file descriptor set containing the entirety of the XDS API. 18 | /// 19 | /// See [`prost_types`][fd] and the GRPC documentation for information on how to use 20 | /// a descriptor set. 21 | /// 22 | /// [fd]: https://docs.rs/prost-types/0.13.1/prost_types/struct.FileDescriptorSet.html 23 | #[cfg(feature = "descriptor")] 24 | pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("xds-descriptors.bin"); 25 | -------------------------------------------------------------------------------- /src/value.rs: -------------------------------------------------------------------------------- 1 | use crate::generated::google::protobuf; 2 | 3 | macro_rules! wrapper_type { 4 | ($proto_ty:ty, $primitive_ty:ty) => { 5 | impl From<$primitive_ty> for $proto_ty { 6 | fn from(value: $primitive_ty) -> Self { 7 | Self { value } 8 | } 9 | } 10 | 11 | impl From<$proto_ty> for $primitive_ty { 12 | fn from(value: $proto_ty) -> Self { 13 | value.value 14 | } 15 | } 16 | }; 17 | } 18 | 19 | wrapper_type!(protobuf::UInt64Value, u64); 20 | wrapper_type!(protobuf::UInt32Value, u32); 21 | wrapper_type!(protobuf::Int32Value, i32); 22 | wrapper_type!(protobuf::Int64Value, i64); 23 | wrapper_type!(protobuf::FloatValue, f32); 24 | wrapper_type!(protobuf::DoubleValue, f64); 25 | wrapper_type!(protobuf::BytesValue, Vec); 26 | wrapper_type!(protobuf::BoolValue, bool); 27 | wrapper_type!(protobuf::StringValue, String); 28 | 29 | impl TryFrom for protobuf::Duration { 30 | type Error = std::num::TryFromIntError; 31 | 32 | fn try_from(value: std::time::Duration) -> Result { 33 | let seconds: i64 = value.as_secs().try_into()?; 34 | let nanos: i32 = value.subsec_nanos().try_into()?; 35 | Ok(protobuf::Duration { seconds, nanos }) 36 | } 37 | } 38 | 39 | impl TryFrom for std::time::Duration { 40 | type Error = std::num::TryFromIntError; 41 | 42 | fn try_from(value: protobuf::Duration) -> Result { 43 | let seconds: u64 = value.seconds.try_into()?; 44 | let nanos: u32 = value.nanos.try_into()?; 45 | Ok(std::time::Duration::new(seconds, nanos)) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/xds-descriptors.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/junction-labs/xds-api/fc5c86e3b4c55a9bbd26051c8bbf0120a5a61b65/src/xds-descriptors.bin -------------------------------------------------------------------------------- /tests/test_any.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod any { 3 | use xds_api::pb::{ 4 | envoy::{ 5 | config::{ 6 | cluster::v3 as xds_cluster, listener::v3 as xds_listener, route::v3 as xds_route, 7 | }, 8 | extensions::clusters::aggregate::v3::ClusterConfig as AggregateClusterConfig, 9 | extensions::filters::network::http_connection_manager::v3::{ 10 | http_connection_manager::RouteSpecifier, HttpConnectionManager, 11 | }, 12 | }, 13 | google::protobuf, 14 | }; 15 | 16 | #[test] 17 | fn roundtrip_cluster() { 18 | use xds_cluster::cluster::ring_hash_lb_config::HashFunction; 19 | 20 | assert_roundtrip(xds_cluster::Cluster { 21 | name: "hello".to_string(), 22 | lb_config: Some(xds_cluster::cluster::LbConfig::RingHashLbConfig( 23 | xds_cluster::cluster::RingHashLbConfig { 24 | hash_function: HashFunction::XxHash.into(), 25 | ..Default::default() 26 | }, 27 | )), 28 | ..Default::default() 29 | }); 30 | } 31 | 32 | #[test] 33 | fn roundtrip_aggregate_cluster() { 34 | assert_roundtrip(AggregateClusterConfig { 35 | clusters: vec!["foo".to_string(), "bar".to_string()], 36 | }) 37 | } 38 | 39 | #[test] 40 | fn roundtrip_http_connection_manager() { 41 | assert_roundtrip(HttpConnectionManager { 42 | route_specifier: Some(RouteSpecifier::RouteConfig(xds_route::RouteConfiguration { 43 | name: "test_route".to_string(), 44 | ..Default::default() 45 | })), 46 | ..Default::default() 47 | }) 48 | } 49 | 50 | #[test] 51 | fn roundtrip_listener() { 52 | let connection_manager = HttpConnectionManager { 53 | route_specifier: Some(RouteSpecifier::RouteConfig(xds_route::RouteConfiguration { 54 | name: "test_route".to_string(), 55 | ..Default::default() 56 | })), 57 | ..Default::default() 58 | }; 59 | 60 | assert_roundtrip(xds_listener::Listener { 61 | name: "cool_listener".to_string(), 62 | api_listener: Some(xds_listener::ApiListener { 63 | api_listener: Some(protobuf::Any::from_msg(&connection_manager).unwrap()), 64 | }), 65 | ..Default::default() 66 | }) 67 | } 68 | 69 | fn assert_roundtrip(m: M) { 70 | let initial_val = m.clone(); 71 | let as_any = protobuf::Any::from_msg(&m).unwrap(); 72 | let round_tripped = as_any.to_msg().unwrap(); 73 | 74 | assert_eq!( 75 | initial_val, round_tripped, 76 | "message should round-trip to itself" 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /tests/test_pbjson.rs: -------------------------------------------------------------------------------- 1 | #[cfg(all(test, feature = "pbjson"))] 2 | mod pbjson { 3 | 4 | use serde_json::json; 5 | use xds_api::pb::{ 6 | envoy::{ 7 | config::{ 8 | cluster::v3 as xds_cluster, listener::v3 as xds_listener, route::v3 as xds_route, 9 | }, 10 | extensions::filters::network::http_connection_manager::v3::{ 11 | http_connection_manager::RouteSpecifier, HttpConnectionManager, 12 | }, 13 | }, 14 | google::protobuf, 15 | }; 16 | 17 | macro_rules! serialize_test { 18 | ($name:ident, $value:expr) => { 19 | #[test] 20 | fn $name() { 21 | let value = $value; 22 | assert!(serde_json::to_vec(&value).is_ok()); 23 | } 24 | }; 25 | } 26 | 27 | serialize_test!( 28 | cluster, 29 | xds_cluster::Cluster { 30 | name: "some name".to_string(), 31 | ..Default::default() 32 | } 33 | ); 34 | 35 | serialize_test!( 36 | listener, 37 | xds_listener::Listener { 38 | name: "some listener".to_string(), 39 | ..Default::default() 40 | } 41 | ); 42 | 43 | serialize_test!( 44 | http_connection_manager, 45 | HttpConnectionManager { 46 | route_specifier: Some(RouteSpecifier::RouteConfig(xds_route::RouteConfiguration { 47 | name: "test_route".to_string(), 48 | ..Default::default() 49 | })), 50 | ..Default::default() 51 | } 52 | ); 53 | 54 | #[test] 55 | fn listener_http_conn_manager() { 56 | let connection_manager = HttpConnectionManager { 57 | route_specifier: Some(RouteSpecifier::RouteConfig(xds_route::RouteConfiguration { 58 | name: "test_route".to_string(), 59 | ..Default::default() 60 | })), 61 | ..Default::default() 62 | }; 63 | 64 | let listener = xds_listener::Listener { 65 | name: "cool_listener".to_string(), 66 | api_listener: Some(xds_listener::ApiListener { 67 | api_listener: Some(protobuf::Any::from_msg(&connection_manager).unwrap()), 68 | }), 69 | ..Default::default() 70 | }; 71 | 72 | let listener_json = serde_json::to_value(&listener).unwrap(); 73 | 74 | assert_json_eq( 75 | &json!({ 76 | "name": "cool_listener", 77 | "api_listener": { 78 | "api_listener": { 79 | "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", 80 | "route_config": { 81 | "name": "test_route", 82 | } 83 | } 84 | } 85 | }), 86 | &listener_json, 87 | ); 88 | } 89 | 90 | #[test] 91 | fn any_not_well_known() { 92 | let cors_policy = xds_route::CorsPolicy { 93 | allow_methods: "HEAD,GET,PUT,POST".to_string(), 94 | ..Default::default() 95 | }; 96 | let as_any = protobuf::Any::from_msg(&cors_policy).unwrap(); 97 | 98 | assert_json_eq( 99 | &json!({ 100 | "@type": "type.googleapis.com/envoy.config.route.v3.CorsPolicy", 101 | "value": &as_any.value, 102 | }), 103 | &serde_json::to_value(&as_any).unwrap(), 104 | ) 105 | } 106 | 107 | #[test] 108 | fn decode_any() { 109 | let cors_policy = xds_route::CorsPolicy { 110 | allow_methods: "HEAD,GET,PUT,POST".to_string(), 111 | ..Default::default() 112 | }; 113 | let as_any = protobuf::Any::from_msg(&cors_policy).unwrap(); 114 | 115 | assert_eq!( 116 | serde_json::from_value::(json!({ 117 | "@type": &as_any.type_url, 118 | "value": &as_any.value, 119 | })) 120 | .unwrap(), 121 | as_any, 122 | ); 123 | } 124 | 125 | #[inline] 126 | fn assert_json_eq(expected: &serde_json::Value, actual: &serde_json::Value) { 127 | assert_eq!( 128 | expected, 129 | actual, 130 | "json values are not equal:\n expected: {}\nactual: {}", 131 | serde_json::to_string_pretty(expected).unwrap(), 132 | serde_json::to_string_pretty(actual).unwrap(), 133 | ) 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /tests/test_value.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod value { 3 | use std::u64; 4 | 5 | use xds_api::pb::google::protobuf; 6 | use xds_api::pb::google::protobuf::BoolValue; 7 | use xds_api::pb::google::protobuf::BytesValue; 8 | use xds_api::pb::google::protobuf::DoubleValue; 9 | use xds_api::pb::google::protobuf::FloatValue; 10 | use xds_api::pb::google::protobuf::Int32Value; 11 | use xds_api::pb::google::protobuf::Int64Value; 12 | use xds_api::pb::google::protobuf::StringValue; 13 | use xds_api::pb::google::protobuf::UInt32Value; 14 | use xds_api::pb::google::protobuf::UInt64Value; 15 | 16 | macro_rules! test_roundtrip { 17 | ($name:ident, $proto_ty:ident, $std_ty:ty, $std_value:expr) => { 18 | #[test] 19 | fn $name() { 20 | let proto_value: $proto_ty = $proto_ty { value: $std_value }; 21 | let as_proto: $proto_ty = $std_value.into(); 22 | assert_eq!(as_proto, proto_value); 23 | 24 | let as_std: $std_ty = proto_value.into(); 25 | assert_eq!(as_std, $std_value); 26 | } 27 | }; 28 | } 29 | 30 | test_roundtrip!(test_u64, UInt64Value, u64, 123u64); 31 | test_roundtrip!(test_u32, UInt32Value, u32, 123u32); 32 | test_roundtrip!(test_i64, Int64Value, i64, 123i64); 33 | test_roundtrip!(test_i32, Int32Value, i32, 123i32); 34 | test_roundtrip!(test_f32, FloatValue, f32, 1.2345); 35 | test_roundtrip!(test_f64, DoubleValue, f64, 1.2345); 36 | test_roundtrip!(test_bytes, BytesValue, Vec, vec![0, 1, 2, 3]); 37 | test_roundtrip!(test_bool, BoolValue, bool, true); 38 | test_roundtrip!(test_string, StringValue, String, "round trip".to_string()); 39 | 40 | #[test] 41 | fn test_duration() { 42 | let d = std::time::Duration::new(123, 456); 43 | let d_as_proto: protobuf::Duration = d.try_into().unwrap(); 44 | 45 | assert_eq!( 46 | d_as_proto, 47 | protobuf::Duration { 48 | seconds: 123, 49 | nanos: 456 50 | } 51 | ); 52 | 53 | let proto_as_std: std::time::Duration = d_as_proto.try_into().unwrap(); 54 | assert_eq!(proto_as_std, d); 55 | } 56 | 57 | #[test] 58 | fn test_duration_overflow() { 59 | let d = std::time::Duration::new(u64::MAX, 0); 60 | let as_proto: Result = d.try_into(); 61 | assert!(as_proto.is_err()); 62 | } 63 | } 64 | --------------------------------------------------------------------------------