async fn new_wrapper(node: &NodeId) -> Result<NodeWrapperPool, SvcError> {
        let mut node = Self {
            // if we can't even fetch the node, then no point in proceeding
            node: NodeWrapperPool::fetch_node(node).await?,
            ..Default::default()
        };

        // if the node is not online, don't even bother trying to connect
        if node.is_online() {
            let pools = node.fetch_pools().await?;
            let replicas = node.fetch_replicas().await?;

            for pool in &pools {
                let replicas = replicas
                    .iter()
                    .filter(|r| r.pool == pool.id)
                    .cloned()
                    .collect::<Vec<_>>();
                node.on_create_pool(pool, &replicas).await;
            }
        }
        // we've got a node, but we might not have the full picture if it's
        // offline
        Ok(node)
    }
/// New node wrapper for the pool service containing
/// a list of pools and replicas
New node wrapper for the pool service containing
a list of pools and replicas
New node wrapper for the pool service containing a list of pools and replicas
async fn new_wrapper(node: &NodeId) -> Result<NodeWrapperPool, SvcError> {
        let mut node = Self {
            // if we can't even fetch the node, then no point in proceeding
            node: NodeWrapperPool::fetch_node(node).await?,
            ..Default::default()
        };
        // if the node is not online, don't even bother trying to connect
        if node.is_online() {
            let pools = node.fetch_pools().await?;
            let replicas = node.fetch_replicas().await?;
            for pool in &pools {
                let replicas = replicas
                    .iter()
                    .filter(|r| r.pool == pool.id)
                    .cloned()
                    .collect::<Vec<_>>();
                node.on_create_pool(pool, &replicas).await;
            }
        }
        // we've got a node, but we might not have the full picture if it's
        // offline
        Ok(node)
    }
async fn new_wrapper ( node : & NodeId ) -> Result < NodeWrapperPool , SvcError > { let mut node = Self { // if we can't even fetch the node, then no point in proceeding node : NodeWrapperPool :: fetch_node ( node ) . await ? , .. Default :: default ( ) } ; // if the node is not online, don't even bother trying to connect if node . is_online ( ) { let pools = node . fetch_pools ( ) . await ? ; let replicas = node . fetch_replicas ( ) . await ? ; for pool in & pools { let replicas = replicas . iter ( ) . filter ( | r | r . pool == pool . id ) . cloned ( ) . collect :: < Vec < _ > > ( ) ; node . on_create_pool ( pool , & replicas ) . await ; } } // we've got a node, but we might not have the full picture if it's // offline Ok ( node ) }
New node wrapper for the pool service containing
a list of pools and replicas
New node wrapper for the pool service containing a list of pools and replicas
node
&NodeId