async fn execute_promise<
  A: ApplicationExt + 'static,
  F: std::future::Future<Output = crate::Result<InvokeResponse>> + Send + 'static,
>(
  webview_manager: &crate::WebviewManager<A>,
  task: F,
  success_callback: String,
  error_callback: String,
) {
  let callback_string = match format_callback_result(
    task
      .await
      .and_then(|response| response.json)
      .map_err(|err| err.to_string()),
    success_callback,
    error_callback.clone(),
  ) {
    Ok(callback_string) => callback_string,
    Err(e) => format_callback(error_callback, e.to_string()),
  };
  if let Ok(dispatcher) = webview_manager.current_webview() {
    let _ = dispatcher.eval(callback_string.as_str());
  }
}
/// Asynchronously executes the given task
/// and evaluates its Result to the JS promise described by the `success_callback` and `error_callback` function names.
///
/// If the Result `is_ok()`, the callback will be the `success_callback` function name and the argument will be the Ok value.
/// If the Result `is_err()`, the callback will be the `error_callback` function name and the argument will be the Err value.
Asynchronously executes the given task
and evaluates its Result to the JS promise described by the `success_callback` and `error_callback` function names.

If the Result `is_ok()`, the callback will be the `success_callback` function name and the argument will be the Ok value.
If the Result `is_err()`, the callback will be the `error_callback` function name and the argument will be the Err value.
Asynchronously executes the given task and evaluates its Result to the JS promise described by the ` success_callback ` and ` error_callback ` function names . If the Result ` is_ok () ` the callback will be the ` success_callback ` function name and the argument will be the Ok value . If the Result ` is_err () ` the callback will be the ` error_callback ` function name and the argument will be the Err value .
async fn execute_promise<
  A: ApplicationExt + 'static,
  F: std::future::Future<Output = crate::Result<InvokeResponse>> + Send + 'static,
>(
  webview_manager: &crate::WebviewManager<A>,
  task: F,
  success_callback: String,
  error_callback: String,
) {
  let callback_string = match format_callback_result(
    task
      .await
      .and_then(|response| response.json)
      .map_err(|err| err.to_string()),
    success_callback,
    error_callback.clone(),
  ) {
    Ok(callback_string) => callback_string,
    Err(e) => format_callback(error_callback, e.to_string()),
  };
  if let Ok(dispatcher) = webview_manager.current_webview() {
    let _ = dispatcher.eval(callback_string.as_str());
  }
}
async fn execute_promise < A : ApplicationExt + ' static , F : std :: future :: Future < Output = crate :: Result < InvokeResponse > > + Send + ' static , > ( webview_manager : & crate :: WebviewManager < A > , task : F , success_callback : String , error_callback : String , ) { let callback_string = match format_callback_result ( task . await . and_then ( | response | response . json ) . map_err ( | err | err . to_string ( ) ) , success_callback , error_callback . clone ( ) , ) { Ok ( callback_string ) => callback_string , Err ( e ) => format_callback ( error_callback , e . to_string ( ) ) , } ; if let Ok ( dispatcher ) = webview_manager . current_webview ( ) { let _ = dispatcher . eval ( callback_string . as_str ( ) ) ; } }
Asynchronously executes the given task
and evaluates its Result to the JS promise described by the `success_callback` and `error_callback` function names.
Asynchronously executes the given task and evaluates its Result to the JS promise described by the ` success_callback ` and ` error_callback ` function names .
webview_manager
&crate::WebviewManager<A>
task
F
success_callback
String
error_callback
String