pub async fn update_db_rules<F, E>(
        &self,
        db_name: &DatabaseName<'static>,
        update: F,
    ) -> std::result::Result<Arc<DatabaseRules>, UpdateError<E>>
    where
        F: FnOnce(DatabaseRules) -> Result<DatabaseRules, E> + Send,
    {
        let config = self.config()?;
        let rules = config
            .update_db_rules(db_name, update)
            .map_err(|e| match e {
                crate::config::UpdateError::Closure(e) => UpdateError::Closure(e),
                crate::config::UpdateError::Update(e) => UpdateError::Update(e),
            })?;

        // TODO: Move into DB (#2053)
        self.persist_database_rules(rules.as_ref().clone()).await?;
        Ok(rules)
    }
// Update database rules and save on success.
Update database rules and save on success.
Update database rules and save on success .
pub async fn update_db_rules<F, E>(
        &self,
        db_name: &DatabaseName<'static>,
        update: F,
    ) -> std::result::Result<Arc<DatabaseRules>, UpdateError<E>>
    where
        F: FnOnce(DatabaseRules) -> Result<DatabaseRules, E> + Send,
    {
        let config = self.config()?;
        let rules = config
            .update_db_rules(db_name, update)
            .map_err(|e| match e {
                crate::config::UpdateError::Closure(e) => UpdateError::Closure(e),
                crate::config::UpdateError::Update(e) => UpdateError::Update(e),
            })?;
        // TODO: Move into DB (#2053)
        self.persist_database_rules(rules.as_ref().clone()).await?;
        Ok(rules)
    }
pub async fn update_db_rules < F , E > ( & self , db_name : & DatabaseName < ' static > , update : F , ) -> std :: result :: Result < Arc < DatabaseRules > , UpdateError < E > > where F : FnOnce ( DatabaseRules ) -> Result < DatabaseRules , E > + Send , { let config = self . config ( ) ? ; let rules = config . update_db_rules ( db_name , update ) . map_err ( | e | match e { crate :: config :: UpdateError :: Closure ( e ) => UpdateError :: Closure ( e ) , crate :: config :: UpdateError :: Update ( e ) => UpdateError :: Update ( e ) , } ) ? ; // TODO: Move into DB (#2053) self . persist_database_rules ( rules . as_ref ( ) . clone ( ) ) . await ? ; Ok ( rules ) }
Update database rules and save on success.
Update database rules and save on success .
&self
db_name
&DatabaseName<'static>
update
F
&self
db_name
&DatabaseName<'static>
update
F