Function entity::global::with_db_from_box[][src]

pub fn with_db_from_box<F: FnMut() -> R, R>(
    database: Box<dyn Database>,
    f: F
) -> R

Executes the given function with the provided database as the new, global database, destroying the database once the function completes; locks execution of this function, only allowing one call to with_db at a time