This commit adds a new crate `tonic-health` which implements the
[standard GRPC Health Checking][checking] protocol.
Currently there is only a server implementation, though others have
alluded in the discussion in #135 that client implementations exist
which could also be imported as necessary.
A example server has also been added - once the client work is done a
client for this should be added also.
[checking]: https://github.com/grpc/grpc/blob/master/doc/health-checking.mdFixes#135.
This commit adjusts the code generation for the internal structs in the
implementation of Service<http::Request<HyperBody>> for *Server<T> in
order to annotate internal structs whose names are derived from gRPC
method names with `[allow(non_camel_case_types)]`. This supresses
compiler warnings about type names when compiling generated code. The
struct names are not exposed externally, so this has no impact on types
seen by library consumers.
Fixes#295.
Rust 1.42 deprecates the `description()` method of `std::error::Error`
and provides a blanket implementation suggesting implementation of
`std::fmt::Display` instead. We already implemented `Display` for error
types but in terms of the deprecated `description`. This commit
implements `Display` directly and falls back to the blanket
implementation of `description()`.
* don't replace extern_path'd paths
tonic-build will replace all paths except for google well known types
with one rooted at the super module. For paths that have already been
replaced with a fully qualified path via the extern_path config option,
(e.g. "::uuid::Uuid"), this results in an invalid path
(e.g. "super::::uuid::Uuid"), and a build failure. These paths should
also be excluded when prefixing relative modules with super.
* add doc in tonic-build clarifying extern_path
extern_path expects fully qualified proto and rust paths
* add test cast case for extern path fix
add a test that extern path does indeed result in service types using
the specified type from an external crate. we test this by creating a
service type that has a proto from a different crate, and asserting that
it does indeed impl a trait from that crate
* add license/publish to extern_path test crates
This change introduces proper gRPC interceptors that are avilable
regardless of the transport used. Each codegen service now produces an
additional method called `with_interceptor` that accepts a
`Interceptor`.
All examples have been updated to use this new style and interop has a
custom `tower::Service` middleware to echo the headers. There is also a
new `interceptor` example that shows basic usage.
BREAKING CHANGE: removed `interceptor_fn` and `intercep_headers_fn` from `transport` in favor of using `tonic::Interceptor`.
Adds support for prost-build's "extern_path" feature. This allows you to
reference another prost-generated protobuf, including any traits that
may have been defined for it, from another crate or location.
b90c340 (feat(transport): Allow custom IO and UDS example (#184),
2019-12-13) changed the Connector type to be more generic instead of
only allowing the HttpConnector type, during this change the
`Service::poll_ready` impl was changed from calling
`MakeConnection::poll_ready` on `self.http` to `self` resulting in
infinite recursion due to the blanket imple of
`MakeConnection::poll_ready` calling `Service::poll_ready`.
This fixes the bug by calling `MakeConnection::poll_ready` on
`self.inner` instead of `self`.
Fixes#191