Trait holochain_state::prelude::ReadManager
source · pub trait ReadManager<'e> {
// Required methods
fn with_reader<E, R, F>(&'e mut self, f: F) -> Result<R, E>
where E: From<DatabaseError>,
F: 'e + FnOnce(Transaction<'_>) -> Result<R, E>;
fn with_reader_test<R, F>(&'e mut self, f: F) -> R
where F: 'e + FnOnce(Transaction<'_>) -> R;
}
Expand description
Implementors are able to create a new read-only DB transaction
Required Methods§
sourcefn with_reader<E, R, F>(&'e mut self, f: F) -> Result<R, E>where
E: From<DatabaseError>,
F: 'e + FnOnce(Transaction<'_>) -> Result<R, E>,
fn with_reader<E, R, F>(&'e mut self, f: F) -> Result<R, E>where E: From<DatabaseError>, F: 'e + FnOnce(Transaction<'_>) -> Result<R, E>,
Run a closure, passing in a new read-only transaction
sourcefn with_reader_test<R, F>(&'e mut self, f: F) -> Rwhere
F: 'e + FnOnce(Transaction<'_>) -> R,
fn with_reader_test<R, F>(&'e mut self, f: F) -> Rwhere F: 'e + FnOnce(Transaction<'_>) -> R,
Same as with_reader, but with no Results: everything gets unwrapped