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: state.rs
    path of file: ./repos/perseus/packages/perseus/src/reactor
    
    the code of the file until where you have to start completion: use super::Reactor;
use crate::{
    errors::*,
    path::*,
    state::{AnyFreeze, MakeRx, MakeUnrx, TemplateState},
};
#[cfg(any(client, doc))]
use crate::{
    router::RouterLoadState,
    state::{Freeze, FrozenApp, ThawPrefs},
};
use serde::{de::DeserializeOwned, Serialize};
#[cfg(any(client,
    
    fn freeze(&self) -> String {
        // This constructs a `FrozenApp`, which has everything the thawing reactor will
        // need
        let frozen_app = FrozenApp {
            // `GlobalStateType` -> `FrozenGlobalState`
            global_state: (&*self.global_state.0.borrow()).into(),
            route: match &*self.router_state.get_load_state_rc().get_untracked() {
                RouterLoadState::Loaded { path, .. } => Some(path.clone()),
                // It would be impressive to manage this timing, but it's fine to go to the route we
                // were in the middle of loading when we thaw
                RouterLoadState::Loading { path, .. } => Some(path.clone()),
                RouterLoadState::Server => None,
                // Error states are no longer propagated to the router, so we will attempt
                // to pick up the last successful load implicitly
            },
            state_store: self.state_store.freeze_to_hash_map(),
        };
        serde_json::to_string(&frozen_app).unwrap()
    }