fn ask_to_play<'a, 'bump>(
            root_rendering_component: &'a RootRenderingComponent,
            bump: &'bump Bump,
            invite_string: &str,
        ) -> Node<'bump>
        where
            'a: 'bump,
        {
            let mut vec_of_nodes = Vec::new();
            //I don't know how to solve the lifetime problems. So I just clone the small data.
            let a = root_rendering_component.game_data.content_folders.clone();
            for folder_name in a {
                vec_of_nodes.push(
                    h3(bump)
                        .attr("id", "ws_elem")
                        .attr("style", "color:green;")
                        .children([text(
                            //show Ask Player2 to Play!
                            bumpalo::format!(in bump, "{} for {} !", invite_string, folder_name)
                                .into_bump_str(),
                        )])
                        .on("click", move |root, vdom, _event| {
                            let root_rendering_component =
                                root.unwrap_mut::<RootRenderingComponent>();
                            //region: send WsMessage over websocket
                            root_rendering_component
                                .game_data
                                .this_machine_player_number = 1;
                            root_rendering_component.game_data.game_state = GameState::Asking;
                            root_rendering_component.game_data.content_folder_name =
                                folder_name.clone();

                            //send request to Websocket server for spellings
                            root_rendering_component
                                .game_data
                                .ws
                                .send_with_str(
                                    &serde_json::to_string(&WsMessage::RequestSpelling {
                                        filename: format!(
                                            "content/{}/text.json",
                                            root_rendering_component.game_data.content_folder_name
                                        ),
                                    })
                                    .expect("error sending RequestSpelling"),
                                )
                                .expect("Failed to send RequestSpelling");

                            root_rendering_component
                                .game_data
                                .ws
                                .send_with_str(
                                    &serde_json::to_string(&WsMessage::WantToPlay {
                                        my_ws_uid: root_rendering_component.game_data.my_ws_uid,
                                        content_folder_name: folder_name.clone(),
                                    })
                                    .expect("error sending WantToPlay"),
                                )
                                .expect("Failed to send WantToPlay");

                            //endregion
                            vdom.schedule_render();
                        })
                        .finish(),
                );
            }
            div(bump).children(vec_of_nodes).finish()
        }
///render ask to play for multiple contents/folders
render ask to play for multiple contents/folders
render ask to play for multiple contents / folders
fn ask_to_play<'a, 'bump>(
            root_rendering_component: &'a RootRenderingComponent,
            bump: &'bump Bump,
            invite_string: &str,
        ) -> Node<'bump>
        where
            'a: 'bump,
        {
            let mut vec_of_nodes = Vec::new();
            //I don't know how to solve the lifetime problems. So I just clone the small data.
            let a = root_rendering_component.game_data.content_folders.clone();
            for folder_name in a {
                vec_of_nodes.push(
                    h3(bump)
                        .attr("id", "ws_elem")
                        .attr("style", "color:green;")
                        .children([text(
                            //show Ask Player2 to Play!
                            bumpalo::format!(in bump, "{} for {} !", invite_string, folder_name)
                                .into_bump_str(),
                        )])
                        .on("click", move |root, vdom, _event| {
                            let root_rendering_component =
                                root.unwrap_mut::<RootRenderingComponent>();
                            //region: send WsMessage over websocket
                            root_rendering_component
                                .game_data
                                .this_machine_player_number = 1;
                            root_rendering_component.game_data.game_state = GameState::Asking;
                            root_rendering_component.game_data.content_folder_name =
                                folder_name.clone();
                            //send request to Websocket server for spellings
                            root_rendering_component
                                .game_data
                                .ws
                                .send_with_str(
                                    &serde_json::to_string(&WsMessage::RequestSpelling {
                                        filename: format!(
                                            "content/{}/text.json",
                                            root_rendering_component.game_data.content_folder_name
                                        ),
                                    })
                                    .expect("error sending RequestSpelling"),
                                )
                                .expect("Failed to send RequestSpelling");
                            root_rendering_component
                                .game_data
                                .ws
                                .send_with_str(
                                    &serde_json::to_string(&WsMessage::WantToPlay {
                                        my_ws_uid: root_rendering_component.game_data.my_ws_uid,
                                        content_folder_name: folder_name.clone(),
                                    })
                                    .expect("error sending WantToPlay"),
                                )
                                .expect("Failed to send WantToPlay");
                            //endregion
                            vdom.schedule_render();
                        })
                        .finish(),
                );
            }
            div(bump).children(vec_of_nodes).finish()
        }
fn ask_to_play < ' a , ' bump > ( root_rendering_component : & ' a RootRenderingComponent , bump : & ' bump Bump , invite_string : & str , ) -> Node < ' bump > where ' a : ' bump , { let mut vec_of_nodes = Vec :: new ( ) ; //I don't know how to solve the lifetime problems. So I just clone the small data. let a = root_rendering_component . game_data . content_folders . clone ( ) ; for folder_name in a { vec_of_nodes . push ( h3 ( bump ) . attr ( " " , " " ) . attr ( " " , " " ) . children ( [ text ( //show Ask Player2 to Play! bumpalo :: format ! ( in bump " " invite_string folder_name ) . into_bump_str ( ) , ) ] ) . on ( " " , move | root , vdom , _event | { let root_rendering_component = root . unwrap_mut :: < RootRenderingComponent > ( ) ; //region: send WsMessage over websocket root_rendering_component . game_data . this_machine_player_number = 1 ; root_rendering_component . game_data . game_state = GameState :: Asking ; root_rendering_component . game_data . content_folder_name = folder_name . clone ( ) ; //send request to Websocket server for spellings root_rendering_component . game_data . ws . send_with_str ( & serde_json :: to_string ( & WsMessage :: RequestSpelling { filename : format ! ( " " root_rendering_component game_data content_folder_name ) , } ) . expect ( " " ) , ) . expect ( " " ) ; root_rendering_component . game_data . ws . send_with_str ( & serde_json :: to_string ( & WsMessage :: WantToPlay { my_ws_uid : root_rendering_component . game_data . my_ws_uid , content_folder_name : folder_name . clone ( ) , } ) . expect ( " " ) , ) . expect ( " " ) ; //endregion vdom . schedule_render ( ) ; } ) . finish ( ) , ) ; } div ( bump ) . children ( vec_of_nodes ) . finish ( ) }
render ask to play for multiple contents/folders
render ask to play for multiple contents / folders
root_rendering_component
&'a RootRenderingComponent
bump
&'bump Bump
invite_string
&str
root_rendering_component
&'a RootRenderingComponent
bump
&'bump Bump
invite_string
&str