Inital commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "tonic"
|
||||
version = "0.1.0"
|
||||
authors = ["Lucio Franco <[email protected]>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tower-grpc = { git = "https://github.com/tower-rs/tower-grpc", branch = "std-future" }
|
||||
@@ -0,0 +1,14 @@
|
||||
pub use tower_grpc::*;
|
||||
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
|
||||
pub type ResponseFuture<'a, T> = Pin<Box<dyn Future<Output = Result<T, Status>> + Send + 'a>>;
|
||||
|
||||
pub trait GrpcInnerService<Request> {
|
||||
type Response;
|
||||
|
||||
fn call<'a>(&'a mut self, request: Request) -> ResponseFuture<'a, Self::Response>
|
||||
where
|
||||
Self: 'a;
|
||||
}
|
||||
Reference in New Issue
Block a user