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: _environment_state.rs
    path of file: ./repos/aws-sdk-rust/sdk/proton/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>The detailed data about the current state of the environment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct EnvironmentState {
    /// <p>The environment spec that was used to create the environment.</p>
    pub spec: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment template that was used to create the environment.</p>
    pub template_name: ::std::string::String,
    /// <p>The major version of the environment template that was used to create the environment.</p>
    pub template_major_version: ::std::string::String,
    /// <p>The minor version of the environment template that was used to create the environment.</p>
    pub template_minor_version: ::std::string::String,
}
impl EnvironmentState {
    /// <p>The environment spec that was used to create the environment.</p>
    pub fn spec(&self) -> ::std::option::Option<&str> {
        self.spec.as_deref()
    }
    /// <p>The name of t
    
    pub fn build(self) -> ::std::result::Result<crate::types::EnvironmentState, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::EnvironmentState {
            spec: self.spec,
            template_name: self.template_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "template_name",
                    "template_name was not specified but it is required when building EnvironmentState",
                )
            })?,
            template_major_version: self.template_major_version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "template_major_version",
                    "template_major_version was not specified but it is required when building EnvironmentState",
                )
            })?,
            template_minor_version: self.template_minor_version.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "template_minor_version",
                    "template_minor_version was not specified but it is required when building EnvironmentState",
                )
            })?,
        })
    }