Trait holochain_state::prelude::ReadAccess
source · [−]pub trait ReadAccess<Kind>: Clone + Into<DbRead<Kind>>where
Kind: DbKindT,{
fn async_reader<'life0, 'async_trait, E, R, F>(
&'life0 self,
f: F
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
E: 'static + From<DatabaseError> + Send + 'async_trait,
F: 'static + FnOnce(Transaction<'_>) -> Result<R, E> + Send + 'async_trait,
R: 'static + Send + 'async_trait,
Self: 'async_trait;
fn sync_reader<E, R, F>(&self, f: F) -> Result<R, E>
where
E: From<DatabaseError>,
F: FnOnce(Transaction<'_>) -> Result<R, E>;
fn kind(&self) -> &Kind;
}
Expand description
Required Methods
sourcefn async_reader<'life0, 'async_trait, E, R, F>(
&'life0 self,
f: F
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
E: 'static + From<DatabaseError> + Send + 'async_trait,
F: 'static + FnOnce(Transaction<'_>) -> Result<R, E> + Send + 'async_trait,
R: 'static + Send + 'async_trait,
Self: 'async_trait,
fn async_reader<'life0, 'async_trait, E, R, F>(
&'life0 self,
f: F
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
E: 'static + From<DatabaseError> + Send + 'async_trait,
F: 'static + FnOnce(Transaction<'_>) -> Result<R, E> + Send + 'async_trait,
R: 'static + Send + 'async_trait,
Self: 'async_trait,
Run an async read transaction on a background thread.
sourcefn sync_reader<E, R, F>(&self, f: F) -> Result<R, E>where
E: From<DatabaseError>,
F: FnOnce(Transaction<'_>) -> Result<R, E>,
fn sync_reader<E, R, F>(&self, f: F) -> Result<R, E>where
E: From<DatabaseError>,
F: FnOnce(Transaction<'_>) -> Result<R, E>,
Run an sync read transaction on a the current thread.