pub(crate) async fn get_full_global_state(
        &self,
        req: Request,
    ) -> Result<TemplateState, ServerError> {
        let gsc = &self.global_state_creator;
        // We know the locale is supported
        let built_state = &self.global_state;

        let global_state = if gsc.uses_request_state() {
            let req_state = gsc.get_request_state(req).await?;
            // If we have a non-empty build-time state, we'll need to amalgamate
            if !built_state.is_empty() {
                if gsc.can_amalgamate_states() {
                    gsc.amalgamate_states(built_state.clone(), req_state)
                        .await?
                } else {
                    // No amalgamation capability, request time state takes priority
                    req_state
                }
            } else {
                req_state
            }
        } else {
            // This global state is purely generated at build-time (or nonexistent)
            built_state.clone()
        };

        Ok(global_state)
    }
Gets the full global state from the state generated at build-time and
the generator itself.

This should only be called once per API call.
packages/perseus/src/turbine/serve.rs