Skip to content

Commit

Permalink
doc: add a few docs
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Dec 2, 2024
1 parent 2e032b7 commit 7e56435
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
///
/// The lifetime on this trait allows the resulting DB to borrow from the
/// connector. E.g. the connector may contain some `Db` and the resulting Db may
/// contain `&Db`. This allows for (e.g.) shared caches between multiple DB
/// contain `&Db`. This allows for (e.g.) shared caches between DBs on multiple
/// threads.
pub trait DbConnect<'a>: Sync {
/// The database type returned when connecting.
Expand All @@ -44,6 +44,16 @@ where
}

/// Trait for types that can create EVM instances.
///
/// Factories should contain configuration information like chain `EXT` types,
/// and database connections. They are intended to enable parallel instantiation
/// of multiple EVMs in multiple threads sharing some configuration or backing
/// store.
///
/// The lifetime on this trait allows the resulting EVM to borrow from the
/// connector. E.g. the connector may contain some `Db` and the resulting EVM
/// may contain `&Db`. This allows for (e.g.) shared caches between EVMs on
/// multiple threads.
pub trait EvmFactory<'a>: DbConnect<'a> {
/// The `Ext` type used in the resulting EVM.
type Ext: Sync;
Expand Down

0 comments on commit 7e56435

Please sign in to comment.