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: bitswap.rs
    path of file: ./repos/rust-ipfs/http/src/v0
    
    the code of the file until where you have to start completion: use crate::v0::support::{with_ipfs, InvalidPeerId, StringError};
use ipfs::{BitswapStats, Ipfs, IpfsTypes};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use warp::{query, reply, Filter, Rejection, Reply};

#[derive(Debug, Deserialize)]
pub struct WantlistQuery {
    peer: Option<String>,
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct WantlistResponse {
    keys: Vec<Value>,
}

async fn wantlist_query<T: IpfsTypes>(
    ipfs: Ipfs<T>,
    query: WantlistQuery,
) -> Result<impl Reply, Rejection> {
    let peer_id = if let Some(peer_id) = query.peer {
        let peer_id = peer_id.parse().map_err(|_| InvalidPeerId)?
    
    fn from(stats: BitswapStats) -> Self {
        let wantlist = stats
            .wantlist
            .into_iter()
            .map(|(cid, _)| json!({"/": cid.to_string()}))
            .collect();
        let peers = stats
            .peers
            .into_iter()
            .map(|peer_id| peer_id.to_string())
            .collect();
        Self {
            blocks_received: stats.blocks_received,
            blocks_sent: stats.blocks_sent,
            data_received: stats.data_received,
            data_sent: stats.data_sent,
            dup_blks_received: stats.dup_blks_received,
            dup_data_received: stats.dup_data_received,
            peers,
            wantlist,
            messages_received: 0,
            provide_buf_len: 0,
        }
    }