pub fn get_defined(&self) -> Result<TemplateState, ServeError> {
        if self.both_defined() {
            return Err(ServeError::BothStatesDefined);
        }

        if !self.build_state.is_empty() {
            Ok(self.build_state.clone())
        } else if !self.request_state.is_empty() {
            Ok(self.request_state.clone())
        } else {
            Ok(TemplateState::empty())
        }
    }
Gets the only defined state if only one is defined. If no states are
defined, this will just return `None`. If both are defined,
this will return an error. (Under no other conditions may this
ever return an error.)
packages/perseus/src/template/states.rs