pub async fn try_caching_replicas(
        &self,
        db: DB,
    ) -> Result<HashMap<String, Arc<CachingReplica>>, Report> {
        let mut result = HashMap::default();
        for (k, v) in self.replicas.iter().filter(|(_, v)| v.disabled.is_none()) {
            if k != &v.name {
                bail!(
                    "Replica key does not match replica name:\n key: {}  name: {}",
                    k,
                    v.name
                );
            }
            let signer = self.get_signer(&v.name).await;
            let replica = v.try_into_replica(signer).await?;
            let indexer = Arc::new(self.try_replica_indexer(v).await?);
            let optics_db = OpticsDB::new(replica.name(), db.clone());
            result.insert(
                v.name.clone(),
                Arc::new(CachingReplica::new(replica, optics_db, indexer)),
            );
        }
        Ok(result)
    }
/// Try to get all replicas from this settings object
Try to get all replicas from this settings object
Try to get all replicas from this settings object
pub async fn try_caching_replicas(
        &self,
        db: DB,
    ) -> Result<HashMap<String, Arc<CachingReplica>>, Report> {
        let mut result = HashMap::default();
        for (k, v) in self.replicas.iter().filter(|(_, v)| v.disabled.is_none()) {
            if k != &v.name {
                bail!(
                    "Replica key does not match replica name:\n key: {}  name: {}",
                    k,
                    v.name
                );
            }
            let signer = self.get_signer(&v.name).await;
            let replica = v.try_into_replica(signer).await?;
            let indexer = Arc::new(self.try_replica_indexer(v).await?);
            let optics_db = OpticsDB::new(replica.name(), db.clone());
            result.insert(
                v.name.clone(),
                Arc::new(CachingReplica::new(replica, optics_db, indexer)),
            );
        }
        Ok(result)
    }
pub async fn try_caching_replicas ( & self , db : DB , ) -> Result < HashMap < String , Arc < CachingReplica > > , Report > { let mut result = HashMap :: default ( ) ; for ( k , v ) in self . replicas . iter ( ) . filter ( | ( _ , v ) | v . disabled . is_none ( ) ) { if k != & v . name { bail ! ( " \n " k v name ) ; } let signer = self . get_signer ( & v . name ) . await ; let replica = v . try_into_replica ( signer ) . await ? ; let indexer = Arc :: new ( self . try_replica_indexer ( v ) . await ? ) ; let optics_db = OpticsDB :: new ( replica . name ( ) , db . clone ( ) ) ; result . insert ( v . name . clone ( ) , Arc :: new ( CachingReplica :: new ( replica , optics_db , indexer ) ) , ) ; } Ok ( result ) }
Try to get all replicas from this settings object
Try to get all replicas from this settings object
&self
db
DB
&self
db
DB