1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/tauri-apps/gir-files)
// DO NOT EDIT

#[cfg(feature = "v2_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2_22")))]
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct JavascriptResult(Shared<ffi::WebKitJavascriptResult>);

    match fn {
        ref => |ptr| ffi::webkit_javascript_result_ref(ptr),
        unref => |ptr| ffi::webkit_javascript_result_unref(ptr),
        type_ => || ffi::webkit_javascript_result_get_type(),
    }
}

impl JavascriptResult {
  #[cfg(feature = "v2_22")]
  #[cfg_attr(docsrs, doc(cfg(feature = "v2_22")))]
  #[doc(alias = "webkit_javascript_result_get_js_value")]
  #[doc(alias = "get_js_value")]
  pub fn js_value(&self) -> Option<java_script_core::Value> {
    unsafe {
      from_glib_none(ffi::webkit_javascript_result_get_js_value(
        self.to_glib_none().0,
      ))
    }
  }
}