Skip to main content

attach_allow_change

Function attach_allow_change 

Source
pub fn attach_allow_change<R, Db>(db: &Db, op: impl FnOnce() -> R) -> R
where Db: ?Sized + Database,
Expand description

Attach the database to the current thread and execute op. Allows a different database than currently attached. The original database will be restored on return.

Note: Switching databases can cause bugs. If you do not intend to switch databases, prefer attach which will panic if you accidentally do.