Skip to content

Commit da95fa0

Browse files
KiriosKEmpty2k12
authored andcommitted
Add + Send to futures (#32)
1 parent 40edf9d commit da95fa0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/client/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Client {
130130
/// Pings the InfluxDB Server
131131
///
132132
/// Returns a tuple of build type and version number
133-
pub fn ping(&self) -> impl Future<Item = (String, String), Error = Error> {
133+
pub fn ping(&self) -> impl Future<Item = (String, String), Error = Error> + Send {
134134
ReqwestClient::new()
135135
.get(format!("{}/ping", self.url).as_str())
136136
.send()
@@ -180,7 +180,7 @@ impl Client {
180180
/// a [`Error`] variant will be returned.
181181
///
182182
/// [`Error`]: enum.Error.html
183-
pub fn query<'q, Q>(&self, q: &'q Q) -> Box<dyn Future<Item = String, Error = Error>>
183+
pub fn query<'q, Q>(&self, q: &'q Q) -> Box<dyn Future<Item = String, Error = Error> + Send>
184184
where
185185
Q: Query,
186186
&'q Q: Into<QueryTypes<'q>>,

src/integrations/serde_integration.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ pub struct DatabaseQueryResult {
7575
}
7676

7777
impl DatabaseQueryResult {
78-
pub fn deserialize_next<T: 'static>(&mut self) -> impl Future<Item = Return<T>, Error = Error>
78+
pub fn deserialize_next<T: 'static>(
79+
&mut self,
80+
) -> impl Future<Item = Return<T>, Error = Error> + Send
7981
where
80-
T: DeserializeOwned,
82+
T: DeserializeOwned + Send,
8183
{
8284
match serde_json::from_value::<Return<T>>(self.results.remove(0)) {
8385
Ok(item) => futures::future::result(Ok(item)),
@@ -105,7 +107,7 @@ impl Client {
105107
pub fn json_query(
106108
&self,
107109
q: ReadQuery,
108-
) -> impl Future<Item = DatabaseQueryResult, Error = Error> {
110+
) -> impl Future<Item = DatabaseQueryResult, Error = Error> + Send {
109111
use futures::future;
110112

111113
let query = q.build().unwrap();

0 commit comments

Comments
 (0)