mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-04-25 08:42:14 +00:00
Implement Send for Connection
This commit is contained in:
parent
ac648f4ae1
commit
85495e8a96
@ -12,6 +12,8 @@ pub struct Connection {
|
|||||||
phantom: PhantomData<ffi::sqlite3>,
|
phantom: PhantomData<ffi::sqlite3>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for Connection {}
|
||||||
|
|
||||||
impl Connection {
|
impl Connection {
|
||||||
/// Open a connection to a new or existing database.
|
/// Open a connection to a new or existing database.
|
||||||
pub fn open<T: AsRef<Path>>(path: T) -> Result<Connection> {
|
pub fn open<T: AsRef<Path>>(path: T) -> Result<Connection> {
|
||||||
@ -65,7 +67,7 @@ impl Connection {
|
|||||||
/// due to processing of some other request. If the callback returns `true`,
|
/// due to processing of some other request. If the callback returns `true`,
|
||||||
/// the operation will be repeated.
|
/// the operation will be repeated.
|
||||||
pub fn set_busy_handler<F>(&mut self, callback: F) -> Result<()>
|
pub fn set_busy_handler<F>(&mut self, callback: F) -> Result<()>
|
||||||
where F: FnMut(usize) -> bool + 'static
|
where F: FnMut(usize) -> bool + Send + 'static
|
||||||
{
|
{
|
||||||
try!(self.remove_busy_handler());
|
try!(self.remove_busy_handler());
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user