electron_sys/interface/
redirect_request.rs1use crate::{class::Session, interface::ProtocolResponseUploadData};
2use js_sys::JsString;
3use wasm_bindgen::prelude::*;
4
5#[wasm_bindgen]
6#[derive(Clone, Debug)]
7pub struct RedirectRequest {
8 method: Option<JsString>,
9 session: Option<Session>,
10 upload_data: Option<ProtocolResponseUploadData>,
11 url: JsString,
12}
13
14#[wasm_bindgen]
15impl RedirectRequest {
16 #[wasm_bindgen(constructor)]
17 pub fn new(
18 method: Option<JsString>,
19 session: Option<Session>,
20 upload_data: Option<ProtocolResponseUploadData>,
21 url: JsString,
22 ) -> RedirectRequest {
23 RedirectRequest {
24 method,
25 session,
26 upload_data,
27 url,
28 }
29 }
30
31 #[wasm_bindgen(getter)]
32 pub fn method(&self) -> Option<JsString> {
33 self.method.clone()
34 }
35
36 #[wasm_bindgen(setter)]
37 pub fn set_method(&mut self, value: Option<JsString>) {
38 self.method = value;
39 }
40
41 #[wasm_bindgen(getter)]
42 pub fn session(&self) -> Option<Session> {
43 self.session.clone()
44 }
45
46 #[wasm_bindgen(setter)]
47 pub fn set_session(&mut self, value: Option<Session>) {
48 self.session = value;
49 }
50
51 #[wasm_bindgen(getter)]
52 pub fn upload_data(&self) -> Option<ProtocolResponseUploadData> {
53 self.upload_data.clone()
54 }
55
56 #[wasm_bindgen(setter)]
57 pub fn set_upload_data(&mut self, value: Option<ProtocolResponseUploadData>) {
58 self.upload_data = value;
59 }
60
61 #[wasm_bindgen(getter)]
62 pub fn url(&self) -> JsString {
63 self.url.clone()
64 }
65
66 #[wasm_bindgen(setter)]
67 pub fn set_url(&mut self, value: JsString) {
68 self.url = value;
69 }
70}