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: _metric.rs
    path of file: ./repos/aws-sdk-rust/sdk/codeguruprofiler/src/types
    
    the code of the file until where you have to start completion: // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Details about the metric that the analysis used when it detected the anomaly. The metric what is analyzed to create recommendations. It includes the name of the frame that was analyzed and the type and thread states used to derive the metric value for that fram
    
    pub fn build(self) -> ::std::result::Result<crate::types::Metric, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Metric {
            frame_name: self.frame_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "frame_name",
                    "frame_name was not specified but it is required when building Metric",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building Metric",
                )
            })?,
            thread_states: self.thread_states.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "thread_states",
                    "thread_states was not specified but it is required when building Metric",
                )
            })?,
        })
    }