diff --git a/src/client.rs b/src/client.rs index fabafbe..2895d14 100644 --- a/src/client.rs +++ b/src/client.rs @@ -170,7 +170,7 @@ impl Connection { pub fn pipeline_from_initial(&mut self, initial: Query, f: F) -> QueryResult where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, F: Fn(QueryResult>) -> Option, I: IntoIterator, { diff --git a/src/error.rs b/src/error.rs index dad1136..4a6e27d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -93,7 +93,7 @@ pub enum QueryError { /// An unrecoverable error during parsing. ParseFailure, /// An error occured while parsing a response item. - ItemParse(Box), + ItemParse(Box), } impl fmt::Display for QueryError { diff --git a/src/pipeline.rs b/src/pipeline.rs index a759c78..0f87c81 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -39,7 +39,7 @@ impl<'a> Pipeline<'a> { where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, F: Fn(QueryResult>) -> Option, I: IntoIterator, { @@ -121,7 +121,7 @@ impl<'a> Pipeline<'a> { pub fn pop<'b, T>(&'b mut self) -> Option>> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { self.pop_wrapped() .map(|wrapped| wrapped.map_err(|err| err.take_inner())) @@ -133,7 +133,7 @@ impl<'a> Pipeline<'a> { where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { self.queue.pop_front().map(move |query| { let expect = loop { @@ -209,7 +209,7 @@ impl<'a> Pipeline<'a> { where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { Responses { pipeline: Some(self), @@ -299,7 +299,7 @@ pub struct Responses<'a, 'b, T> where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { pipeline: Option<&'b mut Pipeline<'a>>, current_reponse: Option>, @@ -308,7 +308,7 @@ where impl Responses<'_, '_, T> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { fn consume(&mut self) { for item in self { @@ -321,7 +321,7 @@ impl<'a, 'b, T> Iterator for Responses<'a, 'b, T> where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { type Item = QueryResult>; fn next(&mut self) -> Option { @@ -367,7 +367,7 @@ pub struct Response<'a, 'b, T> where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { query: Query, pipeline: Option<&'b mut Pipeline<'a>>, @@ -380,7 +380,7 @@ impl<'a, 'b, T> Response<'a, 'b, T> where 'a: 'b, T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { pub(crate) fn new(query: Query, pipeline: &'b mut Pipeline<'a>, expect: usize) -> Self { Self { @@ -455,7 +455,7 @@ where impl Drop for Response<'_, '_, T> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { fn drop(&mut self) { self.consume(); @@ -465,7 +465,7 @@ where impl Iterator for Response<'_, '_, T> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { type Item = QueryResult>; @@ -480,7 +480,7 @@ where enum ItemOrYield<'a, 'b, T> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { Item(QueryResult>), Yield(&'b mut Pipeline<'a>), @@ -494,12 +494,12 @@ where pub struct ResponseItem(ResponseContent, Query) where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static; + T::Err: Error + Send + Sync + 'static; impl ResponseItem where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { /// Borrow the content of [`ResponseItem`]. pub fn content(&self) -> &T { @@ -521,12 +521,12 @@ where pub(crate) struct ResponseContent(T) where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static; + T::Err: Error + Send + Sync + 'static; impl ResponseContent where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { fn content(&self) -> &T { &self.0 @@ -540,7 +540,7 @@ where impl FromStr for ResponseContent where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { type Err = QueryError; fn from_str(s: &str) -> Result { diff --git a/src/query.rs b/src/query.rs index bb9edf2..ae1a03f 100644 --- a/src/query.rs +++ b/src/query.rs @@ -126,7 +126,7 @@ impl Query { pub(crate) fn parse_item(&self, input: &[u8]) -> QueryResult<(usize, ResponseContent)> where T: FromStr + fmt::Debug, - T::Err: Error + Send + 'static, + T::Err: Error + Send + Sync + 'static, { let (_, (consumed, item)) = match self { _ if !self.expect_data() => parse::noop(input)?,