Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Crate implementing the needed runtime for the code generated by twurst-build
in order to run Twirp clients.
Getting started
To start you need first to have a gRPC .proto file (e.g. service.proto).
Then build your proto files by creating a build.rs file with:
and add to your Cargo.toml:
[]
= ""
= ""
= ""
= { = "", =["reqwest-013"] }
[]
= ""
Note that protoc must be available, see prost-build documentation on this topic.
If you are using Nix, nix-shell -p protobuf is enough to provide protoc.
Then you can use the Twirp client with:
use TwirpHttpClient;
async
Note that you can custom the HTTP client with any tower or tower-http layer.
For example to add a basic authorization header to all requests:
use ;
use ServiceBuilder;
use AddAuthorizationLayer;
Cargo features
reqwest-012allows to usereqwest0.12 HTTP implementation.reqwest-013allows to usereqwest0.13 HTTP implementation.
License
Copyright 2024 Helsing GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.