pub trait WriteManager<'e> {
    // Required method
    fn with_commit_sync<E, R, F>(&'e mut self, f: F) -> Result<R, E>
       where E: From<DatabaseError>,
             F: 'e + FnOnce(&mut Transaction<'_>) -> Result<R, E>;

    // Provided method
    fn with_commit_test<R, F>(&'e mut self, f: F) -> Result<R, DatabaseError>
       where F: 'e + FnOnce(&mut Transaction<'_>) -> R { ... }
}
Expand description

Implementors are able to create a new read-write DB transaction

Required Methods§

source

fn with_commit_sync<E, R, F>(&'e mut self, f: F) -> Result<R, E>where E: From<DatabaseError>, F: 'e + FnOnce(&mut Transaction<'_>) -> Result<R, E>,

Run a closure, passing in a mutable reference to a read-write transaction, and commit the transaction after the closure has run. If there is a SQLite error, recover from it and re-run the closure.

Provided Methods§

source

fn with_commit_test<R, F>(&'e mut self, f: F) -> Result<R, DatabaseError>where F: 'e + FnOnce(&mut Transaction<'_>) -> R,

Implementors§

source§

impl<'e> WriteManager<'e> for PConn