pub fn handle_request(
        &mut self,
        request: &Request,
        request_processing_start_us: u64,
    ) -> Response {
        match ParsedRequest::try_from_request(request).map(|r| r.into_parts()) {
            Ok((req_action, mut parsing_info)) => {
                let mut response = match req_action {
                    RequestAction::Sync(vmm_action) => {
                        self.serve_vmm_action_request(vmm_action, request_processing_start_us)
                    }
                    RequestAction::ShutdownInternal => {
                        self.shutdown_flag = true;
                        Response::new(Version::Http11, StatusCode::NoContent)
                    }
                };
                if let Some(message) = parsing_info.take_deprecation_message() {
                    warn!("{}", message);
                    response.set_deprecation();
                }
                response
            }
            Err(e) => {
                error!("{}", e);
                e.into()
            }
        }
    }
/// Handles an API request received through the associated socket.
Handles an API request received through the associated socket.
Handles an API request received through the associated socket .
pub fn handle_request(
        &mut self,
        request: &Request,
        request_processing_start_us: u64,
    ) -> Response {
        match ParsedRequest::try_from_request(request).map(|r| r.into_parts()) {
            Ok((req_action, mut parsing_info)) => {
                let mut response = match req_action {
                    RequestAction::Sync(vmm_action) => {
                        self.serve_vmm_action_request(vmm_action, request_processing_start_us)
                    }
                    RequestAction::ShutdownInternal => {
                        self.shutdown_flag = true;
                        Response::new(Version::Http11, StatusCode::NoContent)
                    }
                };
                if let Some(message) = parsing_info.take_deprecation_message() {
                    warn!("{}", message);
                    response.set_deprecation();
                }
                response
            }
            Err(e) => {
                error!("{}", e);
                e.into()
            }
        }
    }
pub fn handle_request ( & mut self , request : & Request , request_processing_start_us : u64 , ) -> Response { match ParsedRequest :: try_from_request ( request ) . map ( | r | r . into_parts ( ) ) { Ok ( ( req_action , mut parsing_info ) ) => { let mut response = match req_action { RequestAction :: Sync ( vmm_action ) => { self . serve_vmm_action_request ( vmm_action , request_processing_start_us ) } RequestAction :: ShutdownInternal => { self . shutdown_flag = true ; Response :: new ( Version :: Http11 , StatusCode :: NoContent ) } } ; if let Some ( message ) = parsing_info . take_deprecation_message ( ) { warn ! ( " " message ) ; response . set_deprecation ( ) ; } response } Err ( e ) => { error ! ( " " e ) ; e . into ( ) } } }
Handles an API request received through the associated socket.
Handles an API request received through the associated socket .
&mut self
request
&Request
request_processing_start_us
u64
&mut self
request
&Request
request_processing_start_us
u64