pub fn inject_response(&mut self, id: QueryId, res: Response) {
        let query = if let Some(query) = self.queries.remove(&id) {
            query.hdr
        } else {
            return;
        };
        tracing::trace!("{} {} {}", query.root, query.id, res);
        match res {
            Response::Have(peer, have) => {
                self.recv_have(query, peer, have);
            }
            Response::Block(peer, block) => {
                self.recv_block(query, peer, block);
            }
            Response::MissingBlocks(cids) => {
                self.recv_missing_blocks(query, cids);
            }
        }
    }
/// Dispatches the response to a query handler.
Dispatches the response to a query handler.
Dispatches the response to a query handler .
pub fn inject_response(&mut self, id: QueryId, res: Response) {
        let query = if let Some(query) = self.queries.remove(&id) {
            query.hdr
        } else {
            return;
        };
        tracing::trace!("{} {} {}", query.root, query.id, res);
        match res {
            Response::Have(peer, have) => {
                self.recv_have(query, peer, have);
            }
            Response::Block(peer, block) => {
                self.recv_block(query, peer, block);
            }
            Response::MissingBlocks(cids) => {
                self.recv_missing_blocks(query, cids);
            }
        }
    }
pub fn inject_response ( & mut self , id : QueryId , res : Response ) { let query = if let Some ( query ) = self . queries . remove ( & id ) { query . hdr } else { return ; } ; tracing :: trace ! ( " " query root query id res ) ; match res { Response :: Have ( peer , have ) => { self . recv_have ( query , peer , have ) ; } Response :: Block ( peer , block ) => { self . recv_block ( query , peer , block ) ; } Response :: MissingBlocks ( cids ) => { self . recv_missing_blocks ( query , cids ) ; } } }
Dispatches the response to a query handler.
Dispatches the response to a query handler .
&mut self
id
QueryId
res
Response
&mut self
id
QueryId
res
Response