Skip to main content

electron_sys/interface/
net_log.rs

1use crate::interface::StartLoggingOptions;
2use js_sys::{JsString, Promise};
3use wasm_bindgen::prelude::*;
4
5#[wasm_bindgen]
6extern {
7    #[derive(Clone, Debug, PartialEq)]
8    pub type NetLog;
9
10    //******************//
11    // Instance Methods //
12    //******************//
13
14    #[must_use]
15    #[wasm_bindgen(method, js_name = "startLogging")]
16    pub fn start_logging(this: &NetLog, path: &str, options: StartLoggingOptions) -> Promise;
17
18    #[must_use]
19    #[wasm_bindgen(method, js_name = "stopLogging")]
20    pub fn stop_logging(this: &NetLog) -> Promise;
21
22    //*********************//
23    // Instance Properties //
24    //*********************//
25
26    #[wasm_bindgen(method, getter, js_name = "currentlyLogging")] // readonly
27    pub fn currently_logging(this: &NetLog) -> bool;
28
29    #[wasm_bindgen(method, getter, js_name = "currentlyLoggingPath")] // readonly
30    pub fn currently_logging_path(this: &NetLog) -> JsString;
31}