pub(crate) fn block_db(
        &self,
        db_name: DatabaseName<'static>,
    ) -> Result<BlockDatabaseGuard<'_>> {
        let mut state = self.state.write().expect("mutex poisoned");
        ensure!(
            !state.reservations.contains(&db_name),
            DatabaseReserved { db_name }
        );
        ensure!(
            !state.databases.contains_key(&db_name),
            DatabaseAlreadyExists { db_name }
        );

        state.reservations.insert(db_name.clone());
        Ok(BlockDatabaseGuard {
            db_name: Some(db_name),
            config: self,
        })
    }
/// Get guard that blocks database creations. Useful when messing with the preserved catalog of unregistered DBs.
///
/// While the handle is held, no other operations for the given database can be executed.
///
/// This only works if the database is not yet registered. To create a new database that is not yet known,
/// see [`create_db`](Self::create_db). To recover a database out of an uninitialized state, see
/// [`recover_db`](Self::recover_db).
Get guard that blocks database creations. Useful when messing with the preserved catalog of unregistered DBs.
While the handle is held, no other operations for the given database can be executed.

This only works if the database is not yet registered. To create a new database that is not yet known,
see [`create_db`](Self::create_db). To recover a database out of an uninitialized state, see
[`recover_db`](Self::recover_db).
Get guard that blocks database creations . Useful when messing with the preserved catalog of unregistered DBs . While the handle is held no other operations for the given database can be executed . This only works if the database is not yet registered . To create a new database that is not yet known see [ ` create_db ` ] ( Self :: create_db ) . To recover a database out of an uninitialized state see [ ` recover_db ` ] ( Self :: recover_db ) .
pub(crate) fn block_db(
        &self,
        db_name: DatabaseName<'static>,
    ) -> Result<BlockDatabaseGuard<'_>> {
        let mut state = self.state.write().expect("mutex poisoned");
        ensure!(
            !state.reservations.contains(&db_name),
            DatabaseReserved { db_name }
        );
        ensure!(
            !state.databases.contains_key(&db_name),
            DatabaseAlreadyExists { db_name }
        );
        state.reservations.insert(db_name.clone());
        Ok(BlockDatabaseGuard {
            db_name: Some(db_name),
            config: self,
        })
    }
pub ( crate ) fn block_db ( & self , db_name : DatabaseName < ' static > , ) -> Result < BlockDatabaseGuard < ' _ > > { let mut state = self . state . write ( ) . expect ( " " ) ; ensure ! ( state reservations contains ( db_name ) DatabaseReserved { db_name } ) ; ensure ! ( state databases contains_key ( db_name ) DatabaseAlreadyExists { db_name } ) ; state . reservations . insert ( db_name . clone ( ) ) ; Ok ( BlockDatabaseGuard { db_name : Some ( db_name ) , config : self , } ) }
Get guard that blocks database creations.
Get guard that blocks database creations .
&self
db_name
DatabaseName<'static>
&self
db_name
DatabaseName<'static>