async fn render_build_state_for_mutable(
    path_encoded: &str,
    mutable_store: &impl MutableStore,
) -> Result<(String, String, Option<String>), ServerError> {
    // Get the static HTML
    let html = mutable_store
        .read(&format!("static/{}.html", path_encoded))
        .await?;
    let head = mutable_store
        .read(&format!("static/{}.head.html", path_encoded))
        .await?;
    // Get the static JSON
    let state = match mutable_store
        .read(&format!("static/{}.json", path_encoded))
        .await
    {
        Ok(state) => Some(state),
        Err(_) => None,
    };

    Ok((html, head, state))
}
/// Renders a template that uses state generated at build-time. This is specifically for page that revalidate, because they store data
/// in the mutable store.
Renders a template that uses state generated at build-time. This is specifically for page that revalidate, because they store data
in the mutable store.
Renders a template that uses state generated at build - time . This is specifically for page that revalidate because they store data in the mutable store .
async fn render_build_state_for_mutable(
    path_encoded: &str,
    mutable_store: &impl MutableStore,
) -> Result<(String, String, Option<String>), ServerError> {
    // Get the static HTML
    let html = mutable_store
        .read(&format!("static/{}.html", path_encoded))
        .await?;
    let head = mutable_store
        .read(&format!("static/{}.head.html", path_encoded))
        .await?;
    // Get the static JSON
    let state = match mutable_store
        .read(&format!("static/{}.json", path_encoded))
        .await
    {
        Ok(state) => Some(state),
        Err(_) => None,
    };
    Ok((html, head, state))
}
async fn render_build_state_for_mutable ( path_encoded : & str , mutable_store : & impl MutableStore , ) -> Result < ( String , String , Option < String > ) , ServerError > { // Get the static HTML let html = mutable_store . read ( & format ! ( " " path_encoded ) ) . await ? ; let head = mutable_store . read ( & format ! ( " " path_encoded ) ) . await ? ; // Get the static JSON let state = match mutable_store . read ( & format ! ( " " path_encoded ) ) . await { Ok ( state ) => Some ( state ) , Err ( _ ) => None , } ; Ok ( ( html , head , state ) ) }
Renders a template that uses state generated at build-time.
Renders a template that uses state generated at build - time .
path_encoded
&str
mutable_store
&impl MutableStore
path_encoded
&str
mutable_store
&impl MutableStore