impl Clone (again) for the clients

This commit is contained in:
Tim Kuehn
2016-12-26 15:30:36 -05:00
parent e22210bfd8
commit 18cbbe5b15
2 changed files with 14 additions and 3 deletions

View File

@@ -33,6 +33,18 @@ pub struct Client<Req, Resp, E>
inner: BindClient<Req, Resp, E>,
}
impl<Req, Resp, E> Clone for Client<Req, Resp, E>
where Req: Serialize + 'static,
Resp: Deserialize + 'static,
E: Deserialize + 'static,
{
fn clone(&self) -> Self {
Client {
inner: self.inner.clone(),
}
}
}
impl<Req, Resp, E> Service for Client<Req, Resp, E>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,

View File

@@ -424,7 +424,6 @@ macro_rules! service {
}
}
#[allow(non_camel_case_types)]
type __tarpc_service_Future =
$crate::futures::Finished<$crate::Response<__tarpc_service_Response,
@@ -610,7 +609,7 @@ macro_rules! service {
impl<S> SyncServiceExt for S where S: SyncService {}
#[allow(unused)]
#[derive(Debug)]
#[derive(Clone, Debug)]
/// The client stub that makes RPC calls to the server. Exposes a blocking interface.
pub struct SyncClient(FutureClient);
@@ -682,7 +681,7 @@ macro_rules! service {
}
#[allow(unused)]
#[derive(Debug)]
#[derive(Clone, Debug)]
/// The client stub that makes RPC calls to the server. Exposes a Future interface.
pub struct FutureClient(__tarpc_service_Client);