mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-22 11:05:22 +01:00
impl Clone (again) for the clients
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user