pub struct PooledConnection<T: Driver, A: ConnectionAdapter<T>> { /* private fields */ }Implementations§
Source§impl<T: Driver> PooledConnection<T, SyncConnectionAdapter<T>>
impl<T: Driver> PooledConnection<T, SyncConnectionAdapter<T>>
Sourcepub fn scoped_read<F, R, E>(&mut self, closure: F) -> Result<R, E>
pub fn scoped_read<F, R, E>(&mut self, closure: F) -> Result<R, E>
Perform a read operation with a stable scope.
This method uses an explicit transaction to ensure the reader does not take into account ongoing modifications of writers during the execution of the statements in the scope of the closure.
Use Self::read if you want to have the default sqlite behavior, where each statement
gets their own transaction.
§Errors
Returns error if the closure failed or if the read transaction could not be initiated.
Sourcepub fn read<F, R, E>(&mut self, closure: F) -> Result<R, E>
pub fn read<F, R, E>(&mut self, closure: F) -> Result<R, E>
Perform a read operation without a stable scope.
Unlike Self::scoped_read, this method uses the default Sqlite transaction behavior
where each statement will create its own transaction.
§Errors
Returns error if the closure failed.
Sourcepub fn transaction<F, R, E>(&mut self, closure: F) -> Result<R, E>
pub fn transaction<F, R, E>(&mut self, closure: F) -> Result<R, E>
Create a transaction and run the given closure in its scope.
If the closure returns an error the transaction is aborted, otherwise it is commited.
§Errors
Returns error if the closure failed or the transaction failed to commit.