Skip to content

Commit bbe516c

Browse files
committed
docs: update DbConnect docs
1 parent 5347cb8 commit bbe516c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/db/traits.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ use std::{collections::BTreeMap, convert::Infallible, sync::Arc};
1111
/// They are intended to enable parallel instantiation of multiple EVMs in
1212
/// multiple threads sharing some database configuration
1313
///
14-
/// The lifetime on this trait allows the resulting DB to borrow from the
15-
/// connector. E.g. the connector may contain some `Db` and the resulting Db may
16-
/// contain `&Db`. This allows for (e.g.) shared caches between DBs on multiple
17-
/// threads.
14+
/// `DbConnect` is blanket implemented for clonable [`Database`] types by
15+
/// simply cloning the database instance. This allows already-instantiated DBs
16+
/// to be used as connectors, however, if the [`Database`] uses a shared
17+
/// resource like a file or network connection, care should be taken to ensure
18+
/// that the implementation does not share uintended state between EVM
19+
/// instances.
1820
pub trait DbConnect: Sync {
1921
/// The database type returned when connecting.
2022
type Database: Database;

0 commit comments

Comments
 (0)