Struct holochain_types::env::DbRead [−][src]
pub struct DbRead<Kind> where
Kind: DbKindT, { /* fields omitted */ }
Expand description
A read-only version of DbWrite. This environment can only generate read-only transactions, never read-write.
Implementations
pub async fn async_reader<E, R, F>(&'_ self, f: F) -> Result<R, E> where
E: 'static + From<DatabaseError> + Send,
F: 'static + FnOnce(Transaction<'_>) -> Result<R, E> + Send,
R: 'static + Send,
Trait Implementations
pub 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,
DbRead<Kind>: 'async_trait,
pub 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,
DbRead<Kind>: 'async_trait,
Run an async read transaction on a background thread.
pub fn sync_reader<E, R, F>(&self, f: F) -> Result<R, E> where
E: From<DatabaseError>,
F: FnOnce(Transaction<'_>) -> Result<R, E>,
pub 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.
Auto Trait Implementations
impl<Kind> !RefUnwindSafe for DbRead<Kind>
impl<Kind> !UnwindSafe for DbRead<Kind>
Blanket Implementations
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
Mutably borrows from an owned value. Read more
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more