feat(core): lift Send bound for arguments to Arguments::add

Execute already required Send so this just makes it fail earlier
This commit is contained in:
Ryan Leckey 2020-06-27 04:02:34 -07:00
parent 7beceba832
commit 34859af1d3
4 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ pub trait Arguments<'q>: Send + Sized + Default {
/// Add the value to the end of the arguments.
fn add<T>(&mut self, value: T)
where
T: 'q + Encode<'q, Self::Database> + Type<Self::Database>;
T: 'q + Send + Encode<'q, Self::Database> + Type<Self::Database>;
}
pub trait IntoArguments<'q, DB: HasArguments<'q>>: Sized + Send {

View File

@ -58,7 +58,7 @@ impl<'q, DB: Database> Query<'q, DB, <DB as HasArguments<'q>>::Arguments> {
///
/// There is no validation that the value is of the type expected by the query. Most SQL
/// flavors will perform type coercion (Postgres will return a database error).
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
if let Some(arguments) = &mut self.arguments {
arguments.add(value);
}

View File

@ -41,7 +41,7 @@ impl<'q, DB: Database, O> QueryAs<'q, DB, O, <DB as HasArguments<'q>>::Arguments
/// Bind a value for use with this SQL query.
///
/// See [`Query::bind`](crate::query::Query::bind).
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
self.inner = self.inner.bind(value);
self
}

View File

@ -37,7 +37,7 @@ impl<'q, DB: Database, O> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Argum
/// Bind a value for use with this SQL query.
///
/// See [`Query::bind`](crate::query::Query::bind).
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
self.inner = self.inner.bind(value);
self
}