Skip to content

Commit 06ba289

Browse files
authored
Merge pull request #27 from hug-dev/send-sync
Add Send and Sync to trait objects
2 parents bfd355e + 1dbc56f commit 06ba289

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ readme = "README.md"
1010
keywords = ["parsec"]
1111
categories = ["development-tools"]
1212
edition = "2018"
13+
documentation = "https://docs.rs/crate/parsec-client"
1314

1415
[dependencies]
1516
parsec-interface = "0.14.0"

src/core/operation_client.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ pub struct OperationClient {
2323
///
2424
/// Defaults to a Protobuf converter
2525
#[derivative(Debug = "ignore")]
26-
pub content_converter: Box<dyn Convert>,
26+
pub content_converter: Box<dyn Convert + Send + Sync>,
2727
/// Converter that manages response body conversions
2828
///
2929
/// Defaults to a Protobuf converter
3030
#[derivative(Debug = "ignore")]
31-
pub accept_converter: Box<dyn Convert>,
31+
pub accept_converter: Box<dyn Convert + Send + Sync>,
3232
/// Client for request and response objects
3333
pub request_client: RequestClient,
3434
}
@@ -125,14 +125,20 @@ impl crate::BasicClient {
125125
/// Set the converter used for request bodies handled by this client.
126126
///
127127
/// By default Protobuf will be used for this.
128-
pub fn set_request_body_converter(&mut self, content_converter: Box<dyn Convert>) {
128+
pub fn set_request_body_converter(
129+
&mut self,
130+
content_converter: Box<dyn Convert + Send + Sync>,
131+
) {
129132
self.op_client.content_converter = content_converter;
130133
}
131134

132135
/// Set the converter used for response bodies handled by this client.
133136
///
134137
/// By default Protobuf will be used for this.
135-
pub fn set_response_body_converter(&mut self, accept_converter: Box<dyn Convert>) {
138+
pub fn set_response_body_converter(
139+
&mut self,
140+
accept_converter: Box<dyn Convert + Send + Sync>,
141+
) {
136142
self.op_client.accept_converter = accept_converter;
137143
}
138144
}

src/core/request_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct RequestClient {
2525
///
2626
/// Defaults to using Unix domain sockets
2727
#[derivative(Debug = "ignore")]
28-
pub ipc_handler: Box<dyn Connect>,
28+
pub ipc_handler: Box<dyn Connect + Send + Sync>,
2929
}
3030

3131
impl RequestClient {
@@ -63,7 +63,7 @@ impl crate::BasicClient {
6363
/// Set the IPC handler used for communication with the service.
6464
///
6565
/// By default the [Unix domain socket client](../ipc_handler/unix_socket/struct.Client.html) is used.
66-
pub fn set_ipc_handler(&mut self, ipc_handler: Box<dyn Connect>) {
66+
pub fn set_ipc_handler(&mut self, ipc_handler: Box<dyn Connect + Send + Sync>) {
6767
self.op_client.request_client.ipc_handler = ipc_handler;
6868
}
6969

0 commit comments

Comments
 (0)