/// 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) {
            Ok(ParsedRequest::Sync(vmm_action)) => {
                self.serve_vmm_action_request(vmm_action, request_processing_start_us)
            }
            Ok(ParsedRequest::GetMMDS) => self.get_mmds(),
            Ok(ParsedRequest::PatchMMDS(value)) => self.patch_mmds(value),
            Ok(ParsedRequest::PutMMDS(value)) => self.put_mmds(value),
            Ok(ParsedRequest::ShutdownInternal) => {
                self.shutdown_flag = true;
                Response::new(Version::Http11, StatusCode::NoContent)
            }
            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 ) { Ok ( ParsedRequest :: Sync ( vmm_action ) ) => { self . serve_vmm_action_request ( vmm_action , request_processing_start_us ) } Ok ( ParsedRequest :: GetMMDS ) => self . get_mmds ( ) , Ok ( ParsedRequest :: PatchMMDS ( value ) ) => self . patch_mmds ( value ) , Ok ( ParsedRequest :: PutMMDS ( value ) ) => self . put_mmds ( value ) , Ok ( ParsedRequest :: ShutdownInternal ) => { self . shutdown_flag = true ; Response :: new ( Version :: Http11 , StatusCode :: NoContent ) } 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