Remove unnecessary Sync bound on clients (#147)

This commit is contained in:
Jon Gjengset
2017-04-26 15:11:30 -04:00
committed by Tim
parent 85a8f8fce7
commit e2728d84f3
2 changed files with 18 additions and 18 deletions

View File

@@ -120,9 +120,9 @@ impl<Req, Resp, E> Clone for Client<Req, Resp, E>
}
impl<Req, Resp, E> Service for Client<Req, Resp, E>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
type Request = Req;
type Response = Resp;
@@ -147,9 +147,9 @@ impl<Req, Resp, E> Client<Req, Resp, E>
E: Deserialize + 'static
{
fn bind(handle: &reactor::Handle, tcp: StreamType, max_payload_size: u64) -> Self
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
let inner = Proto::new(max_payload_size).bind_client(&handle, tcp);
Client { inner }
@@ -187,9 +187,9 @@ pub type ConnectFuture<Req, Resp, E> =
fn(futures::Canceled) -> io::Error>>;
impl<Req, Resp, E> ClientExt for Client<Req, Resp, E>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
type ConnectFut = ConnectFuture<Req, Resp, E>;

View File

@@ -36,9 +36,9 @@ impl<Req, Resp, E> fmt::Debug for Client<Req, Resp, E> {
}
impl<Req, Resp, E> Client<Req, Resp, E>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
/// Drives an RPC call for the given request.
pub fn call(&self, request: Req) -> Result<Resp, ::Error<E>> {
@@ -128,9 +128,9 @@ pub trait ClientExt: Sized {
}
impl<Req, Resp, E> ClientExt for Client<Req, Resp, E>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
fn connect<A>(addr: A, options: Options) -> io::Result<Self>
where A: ToSocketAddrs
@@ -160,9 +160,9 @@ struct RequestHandler<Req, Resp, E, S> {
}
impl<Req, Resp, E> RequestHandler<Req, Resp, E, FutureClient<Req, Resp, E>>
where Req: Serialize + Sync + Send + 'static,
Resp: Deserialize + Sync + Send + 'static,
E: Deserialize + Sync + Send + 'static
where Req: Serialize + Send + 'static,
Resp: Deserialize + Send + 'static,
E: Deserialize + Send + 'static
{
/// Creates a new `RequestHandler` by connecting a `FutureClient` to the given address
/// using the given options.