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: finalizer.rs
    path of file: ./repos/gotham/gotham/src/router/response
    
    the code of the file until where you have to start completion: //! Defines functionality for finalizing a `Response` after all pipelines, middlewares, handlers
//! and internal extenders have completed.

use std::collections::HashMap;
use std::pin::Pin;
use std::sync::Arc;

use futures_util::future::{self, FutureExt};
use hyper::{Body, Response, StatusCode};
use log::trace;

use crate::handler::HandlerFuture;
use crate::state::{request_id, State};

use crate::router::response::extender::ResponseExtender;

/// Holds an immu
    
    pub fn finalize(&self, mut state: State, mut res: Response<Body>) -> Pin<Box<HandlerFuture>> {
        match self.data.get(&res.status()) {
            Some(extender) => {
                trace!(
                    "[{}] invoking {} response extender",
                    request_id(&state),
                    res.status()
                );
                extender.extend(&mut state, &mut res);
            }
            None => {
                trace!(
                    "[{}] no response extender for {}",
                    request_id(&state),
                    res.status()
                );
            }
        }

        future::ok((state, res)).boxed()
    }