Compiler says that data cannot be shared between threads safely even though the data is wrapped within a Mutex
I'm using Rocket which has a State that it passes to the HTTP requests. This struct contains a Mutex<DatastoreInstance> which gives access to a SQLite database and is locked with a mutex to make read and writes safe. pub struct DatastoreInstance { conn: Connection, } When the DatastoreInstance struct looked like this, with only a SQLite connection everything worked fine, but I then also wanted to add a transaction object within this struct: pub struct DatastoreInstance { conn: Connection, events_transaction: Transaction, } This did not compile because the Transaction object needs to reference