diff --git a/src/functions.rs b/src/functions.rs index a51e979..bbe1355 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -230,7 +230,7 @@ impl Connection { x_func: F, ) -> Result<()> where - F: FnMut(&Context) -> Result, + F: FnMut(&Context) -> Result + Send, T: ToSql, { self.db @@ -281,7 +281,7 @@ impl InnerConnection { x_func: F, ) -> Result<()> where - F: FnMut(&Context) -> Result, + F: FnMut(&Context) -> Result + Send, T: ToSql, { unsafe extern "C" fn call_boxed_closure( diff --git a/src/hooks.rs b/src/hooks.rs index 56a54e7..bf3f059 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -96,7 +96,7 @@ impl Connection { /// The callback returns `true` to rollback. pub fn commit_hook(&self, hook: Option) where - F: FnMut() -> bool, + F: FnMut() -> bool + Send, { self.db.borrow_mut().commit_hook(hook); } @@ -106,7 +106,7 @@ impl Connection { /// The callback returns `true` to rollback. pub fn rollback_hook(&self, hook: Option) where - F: FnMut(), + F: FnMut() + Send, { self.db.borrow_mut().rollback_hook(hook); } @@ -122,7 +122,7 @@ impl Connection { /// - the ROWID of the row that is updated. pub fn update_hook(&self, hook: Option) where - F: FnMut(Action, &str, &str, i64), + F: FnMut(Action, &str, &str, i64) + Send, { self.db.borrow_mut().update_hook(hook); } @@ -137,7 +137,7 @@ impl InnerConnection { fn commit_hook(&mut self, hook: Option) where - F: FnMut() -> bool, + F: FnMut() -> bool + Send, { unsafe extern "C" fn call_boxed_closure(p_arg: *mut c_void) -> c_int where @@ -182,7 +182,7 @@ impl InnerConnection { fn rollback_hook(&mut self, hook: Option) where - F: FnMut(), + F: FnMut() + Send, { unsafe extern "C" fn call_boxed_closure(p_arg: *mut c_void) where @@ -221,7 +221,7 @@ impl InnerConnection { fn update_hook(&mut self, hook: Option) where - F: FnMut(Action, &str, &str, i64), + F: FnMut(Action, &str, &str, i64) + Send, { unsafe extern "C" fn call_boxed_closure( p_arg: *mut c_void,