You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: block_monitor.rs
    path of file: ./repos/CYFS/src/meta/cyfs-meta-spv/src
    
    the code of the file until where you have to start completion: use cyfs_base::BuckyResult;
use cyfs_base_meta::{Block, BlockTrait, BlockDescTrait};
use cyfs_meta_lib::{MetaClient, MetaMinerTarget};
use std::time::Duration;
use crate::SPVChainStorageRef;
use std::str::FromStr;
use async_std::prelude::*;

pub struct BlockMonitor {
    meta_client: MetaClient,
    chain_storage: SPVChainStorageRef,
}

impl BlockMonitor {
    pub fn new(meta_host: &str, chain_storage: SPVChainStorageRef) -> Self {
        Self {
            meta
    
    pub async fn run(self) {
        async_std::task::spawn(async move {
            let mut interval = async_std::stream::interval(Duration::from_secs(10));
            while let Some(_) = interval.next().await {
                loop {
                    let cur_height = self.get_cur_block_height().await;
                    let local_height = match self.get_local_block_height().await {
                        Ok(height) => {
                            height
                        }
                        Err(_) => {
                            -1
                        }
                    };
                    if cur_height.is_ok() {
                        for i in local_height + 1..cur_height.unwrap() - 2 {
                            let block = self.meta_client.get_block(i).await;
                            if block.is_err() {
                                log::error!("get block {} err {}", i, block.err().unwrap());
                                continue;
                                // break;
                            }
                            let block = block.unwrap();
                            log::info!("get block {} height {}", block.header().hash().to_string(), i);

                            let ret = self.on_new_block(block).await;
                            if ret.is_err() {
                                log::error!("on_new_block err {}", ret.err().unwrap());
                                break;	
                            }
                        }
                    }
                    async_std::task::sleep(Duration::new(10, 0)).await
                }
            }
        });

    }