fix(build): allow services to be named Service (#709)
Fixes https://github.com/hyperium/tonic/issues/676
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "service_named_service"
|
||||
version = "0.1.0"
|
||||
authors = ["Lucio Franco <[email protected]>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
license = "MIT"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tonic = { path = "../../tonic" }
|
||||
prost = "0.8"
|
||||
|
||||
[build-dependencies]
|
||||
tonic-build = { path = "../../tonic-build" }
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tonic_build::compile_protos("proto/foo.proto").unwrap();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package foo;
|
||||
|
||||
service Service {
|
||||
rpc Foo(stream FooRequest) returns (stream FooResponse) {}
|
||||
}
|
||||
|
||||
message FooRequest {}
|
||||
|
||||
message FooResponse {}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod pb {
|
||||
tonic::include_proto!("foo");
|
||||
}
|
||||
Reference in New Issue
Block a user