/// Main entry point for running the Webview
Main entry point for running the Webview
Main entry point for running the Webview
pub(crate) fn run<A: ApplicationExt + 'static>(application: App<A>) -> crate::Result<()> {
  let plugin_config = application.context.config.plugins.clone();
  crate::async_runtime::block_on(async move {
    crate::plugin::initialize(A::plugin_store(), plugin_config).await
  })?;
  // setup the content using the config struct depending on the compile target
  let main_content = setup_content(&application.context)?;
  #[cfg(embedded_server)]
  {
    // setup the server url for the embedded-server
    let server_url = if let Content::Url(url) = &main_content {
      String::from(url)
    } else {
      String::from("")
    };
    // spawn the embedded server on our server url
    #[cfg(embedded_server)]
    spawn_server(server_url, &application.context);
  }
  // build the webview
  let webview_application = build_webview(application, main_content)?;
  // spin up the updater process
  #[cfg(feature = "updater")]
  spawn_updater();
  // run the webview
  webview_application.run();
  Ok(())
}
pub ( crate ) fn run < A : ApplicationExt + ' static > ( application : App < A > ) -> crate :: Result < ( ) > { let plugin_config = application . context . config . plugins . clone ( ) ; crate :: async_runtime :: block_on ( async move { crate :: plugin :: initialize ( A :: plugin_store ( ) , plugin_config ) . await } ) ? ; // setup the content using the config struct depending on the compile target let main_content = setup_content ( & application . context ) ? ; # [ cfg ( embedded_server ) ] { // setup the server url for the embedded-server let server_url = if let Content :: Url ( url ) = & main_content { String :: from ( url ) } else { String :: from ( " " ) } ; // spawn the embedded server on our server url # [ cfg ( embedded_server ) ] spawn_server ( server_url , & application . context ) ; } // build the webview let webview_application = build_webview ( application , main_content ) ? ; // spin up the updater process # [ cfg ( feature " " ) ] spawn_updater ( ) ; // run the webview webview_application . run ( ) ; Ok ( ( ) ) }
Main entry point for running the Webview
Main entry point for running the Webview
application
App<A>