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_id.rs
    path of file: ./repos/reth/crates/storage/provider/src/traits
    
    the code of the file until where you have to start completion: use super::BlockHashReader;
use reth_interfaces::provider::{ProviderError, ProviderResult};
use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, ChainInfo, B256};

/// Client trait for getting important block numbers (such as the latest block number), converting
/// block hashes to numbers, and fetching a block hash from its block number.
///
/// This trait also supports fetching block hashes and block 
    
    fn convert_block_number(&self, num: BlockNumberOrTag) -> ProviderResult<Option<BlockNumber>> {
        let num = match num {
            BlockNumberOrTag::Latest => self.best_block_number()?,
            BlockNumberOrTag::Earliest => 0,
            BlockNumberOrTag::Pending => {
                return self
                    .pending_block_num_hash()
                    .map(|res_opt| res_opt.map(|num_hash| num_hash.number))
            }
            BlockNumberOrTag::Number(num) => num,
            BlockNumberOrTag::Finalized => match self.finalized_block_number()? {
                Some(block_number) => block_number,
                None => return Err(ProviderError::FinalizedBlockNotFound),
            },
            BlockNumberOrTag::Safe => match self.safe_block_number()? {
                Some(block_number) => block_number,
                None => return Err(ProviderError::SafeBlockNotFound),
            },
        };
        Ok(Some(num))
    }